Skip to content

Commit 8dae4cc

Browse files
authored
Merge branch 'main' into julien/catchup-base
2 parents 3274ca2 + 805f927 commit 8dae4cc

75 files changed

Lines changed: 10470 additions & 386 deletions

File tree

Some content is hidden

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

.github/workflows/benchmark.yml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,13 @@ permissions: {}
88
pull_request:
99
branches:
1010
- main
11+
paths:
12+
- 'test/e2e/benchmark/**'
13+
- 'test/e2e/evm_contract_bench_test.go'
14+
- 'test/e2e/evm_test_common.go'
15+
- 'test/e2e/sut_helper.go'
16+
- 'block/internal/executing/**'
17+
- '.github/workflows/benchmark.yml'
1118
workflow_dispatch:
1219

1320
jobs:
@@ -62,12 +69,13 @@ jobs:
6269
- name: Run Spamoor smoke test
6370
run: |
6471
cd test/e2e && BENCH_JSON_OUTPUT=spamoor_bench.json go test -tags evm \
65-
-run='^TestSpamoorSmoke$' -v -timeout=15m --evm-binary=../../build/evm
72+
-run='^TestSpamoorSuite$/^TestSpamoorSmoke$' -v -timeout=15m \
73+
./benchmark/ --evm-binary=../../../build/evm
6674
- name: Upload benchmark results
6775
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
6876
with:
6977
name: spamoor-benchmark-results
70-
path: test/e2e/spamoor_bench.json
78+
path: test/e2e/benchmark/spamoor_bench.json
7179

7280
# single job to push all results to gh-pages sequentially, avoiding race conditions
7381
publish-benchmarks:
@@ -88,7 +96,7 @@ jobs:
8896
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
8997
with:
9098
name: spamoor-benchmark-results
91-
path: test/e2e/
99+
path: test/e2e/benchmark/
92100

93101
# only update the benchmark baseline on push/dispatch, not on PRs
94102
- name: Store EVM Contract Roundtrip result
@@ -135,7 +143,7 @@ jobs:
135143
with:
136144
name: Spamoor Trace Benchmarks
137145
tool: 'customSmallerIsBetter'
138-
output-file-path: test/e2e/spamoor_bench.json
146+
output-file-path: test/e2e/benchmark/spamoor_bench.json
139147
auto-push: ${{ github.event_name != 'pull_request' }}
140148
save-data-file: ${{ github.event_name != 'pull_request' }}
141149
github-token: ${{ secrets.GITHUB_TOKEN }}

.just/test.just

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ test-integration:
2525
[group('test')]
2626
test-e2e: build build-da build-evm docker-build-if-local
2727
@echo "--> Running e2e tests"
28-
@cd test/e2e && go test -mod=readonly -failfast -timeout=15m -tags='e2e evm' ./... --binary=../../build/testapp --evm-binary=../../build/evm
28+
@cd test/e2e && go test -mod=readonly -failfast -timeout=15m -tags='e2e evm' $(go list -tags='e2e evm' ./... | grep -v /benchmark) --binary=../../build/testapp --evm-binary=../../build/evm
2929

3030
# Run integration tests with coverage
3131
[group('test')]

docs/concepts/block-lifecycle.md

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

docs/concepts/data-availability.md

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# Data Availability
2+
3+
Data availability (DA) ensures that all transaction data required to verify the chain's state is accessible to anyone.
4+
5+
## Why DA Matters
6+
7+
Without data availability guarantees:
8+
9+
- Nodes can't verify state transitions
10+
- Users can't prove their balances
11+
- The chain's security model breaks down
12+
13+
Evolve uses external DA layers to provide these guarantees, rather than storing all data on L1.
14+
15+
## How Evolve Handles Data Availability
16+
17+
Evolve currently supports two DA modes:
18+
19+
### Local DA
20+
21+
- **Use case**: Development and testing
22+
- **Guarantee**: None (operator can withhold data)
23+
- **Latency**: Instant
24+
25+
### Celestia
26+
27+
- **Use case**: Production deployments
28+
- **Guarantee**: Data availability sampling (DAS)
29+
- **Latency**: ~12 seconds to finality
30+
31+
## DA Flow
32+
33+
```text
34+
Block Produced
35+
36+
37+
┌─────────────────┐
38+
│ Submitter │ Queues block for DA
39+
└────────┬────────┘
40+
41+
42+
┌─────────────────┐
43+
│ DA Layer │ Stores and orders data
44+
└────────┬────────┘
45+
46+
47+
┌─────────────────┐
48+
│ Full Nodes │ Retrieve and verify
49+
└─────────────────┘
50+
```
51+
52+
## Namespaces
53+
54+
Evolve uses DA namespaces to organize data:
55+
56+
| Namespace | Purpose |
57+
|-----------|---------|
58+
| Header | Block headers |
59+
| Data | Transaction data |
60+
61+
## Best Practices
62+
63+
- **Development**: Use Local DA for fast iteration
64+
- **Testnet**: Use Celestia testnet (Mocha or Arabica)
65+
- **Production**: Use Celestia mainnet or equivalent
66+
67+
## Learn More
68+
69+
- [Local DA Guide](/guides/da-layers/local-da)
70+
- [Celestia Guide](/guides/da-layers/celestia)
71+
- [DA Interface Reference](/reference/interfaces/da)

docs/concepts/fee-systems.md

Lines changed: 157 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,157 @@
1+
# Fee Systems
2+
3+
Evolve chains have two layers of fees: execution fees (paid to process transactions) and DA fees (paid to post data).
4+
5+
## Execution Fees
6+
7+
### EVM (ev-reth)
8+
9+
Uses EIP-1559 fee model:
10+
11+
```text
12+
Transaction Fee = (Base Fee + Priority Fee) × Gas Used
13+
```
14+
15+
| Component | Destination | Purpose |
16+
|-----------|-------------|---------|
17+
| Base Fee | Burned (or redirected) | Congestion pricing |
18+
| Priority Fee | Sequencer | Incentive for inclusion |
19+
20+
#### Base Fee Redirect
21+
22+
By default, base fees are burned. ev-reth can redirect them to a treasury:
23+
24+
```json
25+
{
26+
"config": {
27+
"evolve": {
28+
"baseFeeSink": "0xTREASURY",
29+
"baseFeeRedirectActivationHeight": 0
30+
}
31+
}
32+
}
33+
```
34+
35+
See [Base Fee Redirect](/ev-reth/features/base-fee-redirect) for details.
36+
37+
### Cosmos SDK (ev-abci)
38+
39+
Uses standard Cosmos SDK fee model:
40+
41+
```text
42+
Transaction Fee = Gas Price × Gas Used
43+
```
44+
45+
Configure minimum gas prices:
46+
47+
```toml
48+
# app.toml
49+
minimum-gas-prices = "0.025stake"
50+
```
51+
52+
Fees go to the fee collector module and can be distributed via standard Cosmos mechanisms.
53+
54+
## DA Fees
55+
56+
Both execution environments incur DA fees when blocks are posted to the DA layer.
57+
58+
### Cost Factors
59+
60+
| Factor | Impact |
61+
|--------|--------|
62+
| Block size | Linear cost increase |
63+
| DA gas price | Market-driven, varies |
64+
| Batching | Amortizes overhead |
65+
| Compression | Reduces data size |
66+
67+
### Who Pays?
68+
69+
The sequencer pays DA fees from their own funds. They recover costs through:
70+
71+
- Priority fees from users
72+
- Base fee redirect (if configured)
73+
- External subsidy
74+
75+
### Optimization Strategies
76+
77+
#### Lazy Aggregation
78+
79+
Only produce blocks when there are transactions:
80+
81+
```yaml
82+
node:
83+
lazy-aggregator: true
84+
lazy-block-time: 1s # Max wait time
85+
```
86+
87+
Reduces empty blocks and DA costs.
88+
89+
#### Batching
90+
91+
ev-node batches multiple blocks into single DA submissions:
92+
93+
```yaml
94+
da:
95+
batch-size-threshold: 100000 # bytes
96+
batch-max-delay: 5s
97+
```
98+
99+
#### Compression
100+
101+
Enable blob compression:
102+
103+
```yaml
104+
da:
105+
compression: true
106+
```
107+
108+
## Fee Flow Diagram
109+
110+
```text
111+
User Transaction
112+
113+
│ Pays: Gas Price × Gas
114+
115+
┌─────────────────┐
116+
│ Sequencer │
117+
│ │
118+
│ Receives:
119+
│ - Priority fees │
120+
│ - Base fees* │
121+
└────────┬────────┘
122+
123+
│ Pays: DA fees
124+
125+
┌─────────────────┐
126+
│ DA Layer │
127+
│ (Celestia) │
128+
└─────────────────┘
129+
130+
* If base fee redirect is enabled
131+
```
132+
133+
## Estimating Costs
134+
135+
### Execution Costs
136+
137+
EVM:
138+
139+
```bash
140+
cast estimate --rpc-url http://localhost:8545 <CONTRACT> "transfer(address,uint256)" <TO> <AMOUNT>
141+
```
142+
143+
Cosmos:
144+
145+
```bash
146+
appd tx bank send <FROM> <TO> 1000stake --gas auto --gas-adjustment 1.3
147+
```
148+
149+
### DA Costs
150+
151+
Depends on:
152+
153+
- DA layer pricing (e.g., Celestia gas price)
154+
- Data size per block
155+
- Submission frequency
156+
157+
Use the [Celestia Gas Calculator](/guides/tools/celestia-gas-calculator) for estimates.

docs/concepts/finality.md

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# Finality
2+
3+
Finality determines when a transaction is irreversible. Evolve has a multi-stage finality model.
4+
5+
## Finality Stages
6+
7+
```text
8+
Transaction Submitted
9+
10+
11+
┌───────────────────┐
12+
│ Soft Confirmed │ ← Block produced, gossiped via P2P
13+
└─────────┬─────────┘
14+
15+
16+
┌───────────────────┐
17+
│ DA Finalized │ ← DA layer confirms inclusion
18+
└───────────────────┘
19+
```
20+
21+
### Soft Confirmation
22+
23+
When a block is produced and gossiped via P2P:
24+
25+
- **Latency**: Milliseconds (block time)
26+
- **Guarantee**: Sequencer has committed to this ordering
27+
- **Risk**: Sequencer could equivocate (produce conflicting blocks)
28+
29+
### DA Finalized
30+
31+
When the DA layer confirms the block is included:
32+
33+
- **Latency**: ~6 seconds (Celestia)
34+
- **Guarantee**: Block data is permanently available and ordered
35+
- **Risk**: None (assuming DA layer security)
36+
37+
## Choosing Finality Thresholds
38+
39+
| Use Case | Recommended Finality |
40+
|----------|---------------------|
41+
| Display balance | Soft confirmation |
42+
| Accept payment | Soft confirmation |
43+
| Process withdrawal | DA finalized |
44+
| Bridge transfer | DA finalized |
45+
46+
## Configuration
47+
48+
Block time affects soft confirmation latency:
49+
50+
```yaml
51+
node:
52+
block-time: 100ms
53+
```
54+
55+
DA finality depends on the DA layer. Celestia provides ~6 second finality.

0 commit comments

Comments
 (0)