Skip to content

Commit a9c634f

Browse files
authored
Merge pull request algorand#6402 from Algo-devops-service/relstable4.2.1
2 parents 088f89d + 32dc751 commit a9c634f

File tree

394 files changed

+9947
-8914
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

394 files changed

+9947
-8914
lines changed

.circleci/config.yml

Lines changed: 0 additions & 729 deletions
This file was deleted.

.github/workflows/ci-nightly.yml

Lines changed: 494 additions & 0 deletions
Large diffs are not rendered by default.

.github/workflows/ci-pr.yml

Lines changed: 425 additions & 0 deletions
Large diffs are not rendered by default.

.github/workflows/codegen_verification.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
pull_request:
77
jobs:
88
codegen_verification:
9-
runs-on: ubuntu-22.04
9+
runs-on: ubuntu-24.04
1010
services:
1111
converter:
1212
image: swaggerapi/swagger-converter@sha256:dcfd1c2537f5f271cb4ec942d08aa59ca41b9a24078040061a772afca7e548ae # v1.0.4

.github/workflows/container.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ on:
1010
jobs:
1111
build-and-push:
1212
name: Build and Push to DockerHub
13-
runs-on: ubuntu-22.04
13+
runs-on: ubuntu-24.04
1414
steps:
1515
- name: Checkout Code
1616
uses: actions/checkout@v4

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,3 +78,6 @@ tools/x-repo-types/x-repo-types
7878

7979
# python virtual environment
8080
.venv
81+
82+
# ignore local claude config changes
83+
CLAUDE.local.md

AGENTS.md

Lines changed: 174 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,174 @@
1+
# CLAUDE.md
2+
3+
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4+
5+
## Common Development Commands
6+
7+
### Build
8+
```bash
9+
make build # Build all binaries
10+
make install # Build and install binaries to $GOPATH/bin
11+
make buildsrc # Build main source (faster than full build)
12+
```
13+
14+
### Testing
15+
```bash
16+
make test # Run unit tests
17+
make fulltest # Run unit tests with race detection
18+
make shorttest # Run short tests with race detection
19+
make integration # Run integration tests
20+
make testall # Run all tests (unit + integration)
21+
```
22+
23+
### Code Quality
24+
```bash
25+
make sanity # Run all checks (fmt, lint, fix, tidy)
26+
make fmt # Format code and check licenses
27+
make lint # Run linter (requires deps)
28+
make fix # Run algofix tool
29+
make vet # Run go vet
30+
make tidy # Clean up go.mod files
31+
```
32+
33+
### Code Generation
34+
35+
Some code must be re-generated after changes. Run the following to regenerate auto-generated code if changes are made to relevant files.
36+
37+
```
38+
make rebuild_kmd_swagger # Rebuild swagger.json files
39+
make generate # Regenerate for stringer et al.
40+
make expectlint # Run expect linter
41+
touch data/transactions/logic/fields_string.go # Ensure rebuild of teal specs
42+
make -C data/transactions/logic # Update TEAL Specs
43+
touch daemon/algod/api/algod.oas2.json # Ensure rebuild of API spec
44+
make -C daemon/algod/api generate # Regenerate REST server
45+
make msgp # Regenerate msgp files
46+
```
47+
48+
To verify that this wasn't missed, we run verification steps, which can be found in `scripts/travis/codegen_verification.sh`. If code is not clean, it will fail CI checks.
49+
50+
### Development Setup
51+
```bash
52+
./scripts/configure_dev.sh # Initial environment setup
53+
./scripts/buildtools/install_buildtools.sh # Install build tools
54+
make deps # Check/install dependencies
55+
```
56+
57+
### Single Test Execution
58+
```bash
59+
go test -v -run TestName ./path/to/package # Run specific test
60+
go test -v ./agreement/... # Run tests in package tree rooted at agreement
61+
go test -v ./agreement/ # Run tests for just the agreement package
62+
```
63+
64+
### Running E2E tests
65+
E2E tests run one or more algod processes, each with their own data directory containing logs and configuration (created in a subdirectory of TESTDIR). If an E2E test fails, useful information can often be found in the node.log files produced by algod while running the test. For example:
66+
```bash
67+
export NODEBINDIR=~/go/bin # path to algod, goal, etc. Code changes to goal or algod require rebuilding with "make" to place new binaries here before running E2E tests.
68+
export TESTDATADIR=`pwd`/test/testdata # path to go-algorand/test/testdata
69+
export TESTDIR=/tmp
70+
# network and node data will be created in /tmp/TestAssetSend/, logs in /tmp/TestAssetSend/Primary/node.log and /tmp/TestAssetSend/Node/node.log
71+
go test ./test/e2e-go/features/transactions -run TestAssetSend -v -timeout=0
72+
```
73+
74+
## Architecture Overview
75+
76+
### Main Binaries
77+
- **`algod`**: Core blockchain node daemon (consensus, networking, REST API)
78+
- **`kmd`**: Key Management Daemon (secure wallet operations, isolated process)
79+
- **`goal`**: Primary CLI tool for node interaction and account management
80+
- **`algokey`**: Standalone key generation and management utility
81+
82+
### Core Components
83+
84+
#### Node Layer (`node/`)
85+
Central orchestrator that integrates all subsystems. The `AlgorandFullNode` struct manages:
86+
- Ledger state and transaction pool
87+
- Network communication and message routing
88+
- Agreement service for consensus participation
89+
- Catchup service for blockchain synchronization
90+
91+
#### Agreement Layer (`agreement/`)
92+
Implements Algorand's Byzantine Agreement protocol:
93+
- **Service**: Main consensus coordinator
94+
- **State Machine**: Manages consensus rounds, periods, and steps
95+
- **Vote/Proposal Managers**: Handle consensus message flow
96+
- **CryptoVerifier**: Asynchronous signature verification
97+
98+
#### Ledger Layer (`ledger/`)
99+
Manages blockchain state using tracker-based architecture:
100+
- **Blockchain Storage**: Sequential block storage with certificates
101+
- **Trackers**: Independent state machines consuming blockchain events
102+
- `accountUpdates`: Account balances and application state
103+
- `acctsOnline`: Online account tracking for consensus
104+
- `catchpointTracker`: Catchpoint generation for fast sync
105+
- `txTail`: Recent transaction tracking
106+
- **Atomic Updates**: Coordinated state transitions across trackers
107+
108+
#### Network Layer (`network/`)
109+
Supports multiple networking implementations through `GossipNode` interface:
110+
- **WebSocket Network**: Traditional relay-based topology
111+
- **P2P Network**: LibP2P-based peer-to-peer networking
112+
- **Hybrid Network**: Combines both approaches
113+
114+
#### Data Layer (`data/`)
115+
- **Transaction Pool**: Manages pending transactions
116+
- **Transaction Handler**: Processes incoming network transactions
117+
- **Account Manager**: Handles participation key lifecycle
118+
- **Core Types**: Transactions, blocks, accounts, and protocol structures
119+
120+
#### Cryptography (`crypto/`)
121+
- Ed25519 signatures, multisig, LogicSig (smart signatures)
122+
- VRF (Verifiable Random Functions) for consensus leader selection
123+
- State proof cryptography for light client verification
124+
- Merkle tree implementations for data integrity
125+
126+
### Key Architectural Patterns
127+
128+
#### Interface-Based Design
129+
System boundaries defined by Go interfaces:
130+
- `GossipNode`: Network abstraction
131+
- `BlockValidator`/`BlockFactory`: Consensus integration
132+
- `Ledger`: Storage abstraction
133+
- `KeyManager`: Cryptographic operations
134+
135+
#### Tracker Pattern
136+
Ledger uses independent state machines that can rebuild from blockchain events, enabling:
137+
- Stateless tracker logic with optional persistent caching
138+
- Atomic coordinated updates across different state types
139+
- Efficient state rebuilding and validation
140+
141+
#### Concurrent Architecture
142+
- Agreement service separates concurrent I/O from serialized protocol logic
143+
- Crypto verification runs in dedicated thread pools
144+
- Network and disk operations use separate goroutines
145+
146+
#### Security Isolation
147+
- KMD runs as separate process to isolate key material
148+
- Transaction verification separated from consensus participation
149+
- Clear boundaries between trusted and untrusted operations
150+
151+
## Development Guidelines
152+
153+
### Testing Strategy
154+
- Unit tests focus on individual component logic
155+
- Integration tests verify cross-component interactions
156+
- Race detection enabled for concurrent code validation
157+
- Benchmark tests for performance-critical paths
158+
159+
### Code Organization
160+
- Interface-first design for testability and modularity
161+
- Dependency injection for component assembly
162+
- Clear separation between protocol logic and implementation details
163+
- Consistent error handling patterns throughout
164+
165+
### Performance Considerations
166+
- Tracker pattern enables efficient state caching
167+
- Asynchronous block writing with in-memory queues
168+
- Parallel transaction verification
169+
- Catchpoint mechanism for fast node synchronization
170+
171+
### Protocol Evolution
172+
- Consensus parameters support versioning for upgrades
173+
- Backward compatibility maintained through careful interface design
174+
- Feature flags and gradual rollout mechanisms

CLAUDE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
AGENTS.md

Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
FROM ubuntu:20.04 as builder
1+
FROM ubuntu:24.04 AS builder
22

3-
ARG GO_VERSION="1.23.3"
3+
ARG GO_VERSION="1.23.9"
44

55
ARG CHANNEL
66
ARG URL
@@ -41,7 +41,7 @@ RUN /dist/files/build/install.sh \
4141
-b "${BRANCH}" \
4242
-s "${SHA}"
4343

44-
FROM debian:bookworm-20240311-slim as final
44+
FROM debian:bookworm-20250630-slim AS final
4545

4646
ENV PATH="/node/bin:${PATH}" ALGOD_PORT="8080" KMD_PORT="7833" ALGORAND_DATA="/algod/data"
4747

0 commit comments

Comments
 (0)