Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: op-reth #4377

Merged
merged 460 commits into from
Nov 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
460 commits
Select commit Hold shift + click to select a range
60b83b9
fix the base fee params for base mainnet
roberto-bayardo Aug 26, 2023
87909d4
Remove `c-kzg` patch from diff
clabby Aug 28, 2023
a053c26
Fix build warnings w/o `optimism` feature
clabby Aug 28, 2023
a01b9c9
Merge pull request #96 from anton-rs/clabby/remove-kzg-patch
refcell Aug 28, 2023
54957c4
Merge pull request #97 from anton-rs/clabby/bw
refcell Aug 28, 2023
3798be1
Merge pull request #91 from anton-rs/roberto/fix-base-fee
clabby Aug 28, 2023
a84ea91
perf(executor): pre-parse address constants
rkrasiuk Aug 28, 2023
6470379
Fix basefee tests
refcell Aug 28, 2023
6b110d9
Merge pull request #98 from anton-rs/rkrasiuk/perf-address-parsing
refcell Aug 28, 2023
4a12a3a
Document added feature flags
refcell Aug 28, 2023
5e046df
Switch chain names to kebab casing
refcell Aug 28, 2023
ce6731a
Fix tests :doh:
refcell Aug 28, 2023
a182909
Merge pull request #100 from anton-rs/refcell/feat-flag-docs
refcell Aug 28, 2023
f17dc3c
move compile error to cli run
refcell Aug 28, 2023
7edf44d
Remove the optimism feature flag attribute on the u64 serde helper
refcell Aug 28, 2023
5b3b524
Add an additional comment about reading the tx type from the compat e…
refcell Aug 28, 2023
3321955
Update crates/storage/provider/src/post_state/mod.rs
refcell Aug 28, 2023
738d7da
Fix nit to use signed tx helper method
refcell Aug 28, 2023
4dfb9fa
Fix nit to use signed tx helper method
refcell Aug 28, 2023
6966735
Remove the serde renames on the optimism-specific rpc tx receipt type…
refcell Aug 28, 2023
f2e6bd0
Bump the nonce on deposit EVM halt
clabby Aug 28, 2023
08ed3d3
Only bump on contract creation halt
clabby Aug 28, 2023
afb8172
Fix parse typo
refcell Aug 28, 2023
ee59168
Merge pull request #102 from anton-rs/refcell/feat-compile-error
refcell Aug 28, 2023
19d082d
Merge pull request #104 from anton-rs/refcell/compat-tx-type-comment
refcell Aug 28, 2023
06e503d
Merge pull request #105 from anton-rs/refcell/signed-tx-construction
refcell Aug 28, 2023
8924c5e
Merge pull request #106 from anton-rs/refcell/rename-redundancies
refcell Aug 28, 2023
c21a224
Merge pull request #99 from anton-rs/refcell/fix-basefee-tests
refcell Aug 28, 2023
7a4536a
Merge pull request #101 from anton-rs/refcell/chain-name-kebab-case
refcell Aug 28, 2023
d311c2e
Merge pull request #103 from anton-rs/refcell/remove-u64-serde-helper…
refcell Aug 28, 2023
2d70e0b
Merge pull request #107 from anton-rs/clabby/fix-deposit-contract-cre…
clabby Aug 28, 2023
973cc9a
Upstream sync - one minor payload builder conflict
refcell Aug 29, 2023
5b4bd07
fix basic payload builder default
refcell Aug 29, 2023
455d637
Merge pull request #109 from anton-rs/refcell/upstream-sync-open
refcell Aug 29, 2023
bf9901d
Another upstream sync
refcell Aug 29, 2023
e7a6771
Merge pull request #110 from anton-rs/another-upstream-sync
refcell Aug 29, 2023
9122353
Fix deposit transaction docstring
refcell Aug 29, 2023
5d7ea82
Merge pull request #112 from anton-rs/refcell/fix-deposit-tx-comments
refcell Aug 29, 2023
68b621a
Fix sequencer tx forwarding
clabby Aug 31, 2023
4c00711
Replace `hyper` w/ `reqwest`
clabby Aug 31, 2023
b8fd4dd
Merge pull request #113 from anton-rs/cl/sequencer_forwarding_fix
refcell Sep 1, 2023
2a89bcd
Merge branch 'main' into clabby/merge-upstream-831
clabby Sep 1, 2023
d7dd0e2
lints
clabby Sep 1, 2023
fc8ebf9
Merge pull request #114 from anton-rs/clabby/merge-upstream-831
refcell Sep 1, 2023
a8978e2
Run tests with and without `optimism` feature flag
clabby Sep 1, 2023
03395dc
Merge pull request #115 from anton-rs/clabby/fix-ci
clabby Sep 1, 2023
3bc22fa
Rename test jobs
clabby Sep 1, 2023
ada47ff
Resolve two small cargo toml conflicts
refcell Sep 1, 2023
c23408f
Merge pull request #116 from anton-rs/refcell/last-upstream-fix-maybe
refcell Sep 1, 2023
394dc00
Resolve payload attribute conflicts with beacon block root
refcell Sep 5, 2023
a956013
Merge pull request #117 from anton-rs/refcell/upstream-sync-new
clabby Sep 6, 2023
8fbba1e
Fix holesky chainspec additions and small rpc import fix
refcell Sep 8, 2023
c14c339
Update base mainnet to use named ethers chain over hardcoded chain id
refcell Sep 8, 2023
122be97
Merge pull request #119 from anton-rs/refcell/ethers-bump
refcell Sep 9, 2023
09ff7e4
Merge pull request #118 from anton-rs/refcell/quick-upstream-sync-2
refcell Sep 9, 2023
1decac7
Upstream sync for wed review
refcell Sep 12, 2023
588be43
Merge pull request #121 from anton-rs/refcell/up-sync
clabby Sep 13, 2023
0619eb9
Merge branch 'main' into cl/merge-upstream
clabby Sep 13, 2023
12c8750
Merge pull request #122 from anton-rs/cl/merge-upstream
refcell Sep 13, 2023
8c546b1
Merge upstream
clabby Oct 14, 2023
dc9ee70
More conflict resolving
clabby Oct 14, 2023
32c9046
checkpoint
clabby Oct 14, 2023
43309e1
Checkpoint bravo
clabby Oct 14, 2023
c2ea10f
revm env [wip]
clabby Oct 14, 2023
e173828
Start integrating `op-revm` into the payload builder + executor
clabby Oct 15, 2023
504273d
clippy + :broom:
clabby Oct 15, 2023
95abdc8
Patch revm
clabby Oct 15, 2023
dc97883
lint
clabby Oct 15, 2023
0977eb7
Add back gas limit check in FCU
clabby Oct 15, 2023
9cc55d5
Pass `compute_pending_block`
clabby Oct 15, 2023
a778a50
:broom:
clabby Oct 15, 2023
4e7cdfb
rm `compute_pending_block` for now
clabby Oct 16, 2023
0f2ea91
remove error handling for failed deposits; handle in revm
clabby Oct 16, 2023
d4b0fcf
Fix payload builder block gas limit
clabby Oct 16, 2023
3ce4b83
Receipt roots
clabby Oct 17, 2023
53b1a18
:broom:
clabby Oct 17, 2023
10b5881
db load smell
clabby Oct 18, 2023
89eba28
Merge branch 'main' into clabby/op-reth
clabby Oct 21, 2023
982a16f
Resolve conflicts
clabby Oct 21, 2023
308c2c0
@rkrasiuk Workflow nits
clabby Oct 21, 2023
841accd
@rkrasiuk tx gossip semantic nit
clabby Oct 21, 2023
6c7882c
More @rkrasiuk review
clabby Oct 21, 2023
d562387
Move `compute_pending_block`
clabby Oct 21, 2023
ba309ec
:broom:
clabby Oct 21, 2023
66e9ba0
Set forkchoice state on startup
clabby Oct 21, 2023
71836cd
Some cleanups
clabby Oct 21, 2023
784860c
Merge branch 'main' into clabby/op-reth
clabby Oct 25, 2023
0b45fb9
Resolve conflicts
clabby Oct 25, 2023
7ab8e06
@rkrasiuk comment nit
clabby Oct 25, 2023
5483c3b
Merge branch 'main' into clabby/op-reth
clabby Oct 26, 2023
365f784
Rebase on `main`
clabby Oct 26, 2023
5aa493f
remove `revm` patch
clabby Oct 26, 2023
3f159c5
Resolve conflicts
clabby Oct 26, 2023
0a2d948
rm diff-rpc file
clabby Oct 26, 2023
d3a7871
Merge branch 'main' into clabby/op-reth
clabby Oct 28, 2023
d1d24a4
Move `option_u64_hex` ser to `rpc-types`
clabby Oct 28, 2023
4f1b00f
Merge branch 'main' into clabby/op-reth
clabby Oct 29, 2023
44dee3e
Fix compute pending block doc comment.
refcell Oct 30, 2023
ad8fb13
Outline Optimism payload attributes
refcell Oct 30, 2023
766076e
outline and flatten optimism payload attributes
refcell Oct 30, 2023
2467bc1
outline and flatten optimism payload attributes
refcell Oct 30, 2023
d8b575f
Merge remote-tracking branch 'origin/main' into refcell/merge-upstrea…
refcell Oct 30, 2023
9572071
Merge pull request #129 from anton-rs/refcell/merge-upstream-sync
refcell Oct 30, 2023
150b9ff
Merge branch 'clabby/op-reth' into refcell/outline-optimism-payload-a…
refcell Oct 30, 2023
9bb9ade
Merge branch 'clabby/op-reth' into refcell/fix-doc-comment
refcell Oct 30, 2023
1a1a57f
fully qualify u6 optional deserializer
refcell Oct 30, 2023
a374ea0
move rollup node cli field
refcell Oct 30, 2023
47dd6ac
move rollup cli field in decomposition
refcell Oct 30, 2023
a78518a
add docs for genesis walkbalk
refcell Oct 30, 2023
ed6fd6a
Lightweight string referencing with deref
refcell Oct 30, 2023
6dc2aa4
Rip optimism network config into a separate grouped struct
refcell Oct 30, 2023
050fb91
Fix payload attributes and builder attributes
refcell Oct 30, 2023
07264fe
Format
refcell Oct 30, 2023
bc17092
fix optimism payload attributes in reth cli
refcell Oct 30, 2023
0cd95a9
rip out optimism error
refcell Oct 30, 2023
9275965
fix(rpc): forward to sequencer function, rpc error type
merklefruit Oct 30, 2023
3209735
deref
refcell Oct 30, 2023
f6b47a1
bad error imports
refcell Oct 30, 2023
af8281d
fix(rpc-types): optimism tx fields, renamed u64_hex_opt
merklefruit Oct 30, 2023
54a1cdc
Merge pull request #131 from anton-rs/refcell/error-refactor
refcell Oct 30, 2023
e7757ff
Merge pull request #128 from anton-rs/refcell/outline-optimism-payloa…
refcell Oct 30, 2023
6fca9cf
Merge pull request #132 from anton-rs/merklefruit/fix-rpc-op-crate
refcell Oct 30, 2023
ef538f5
Merge pull request #130 from anton-rs/refcell/deref-str
refcell Oct 30, 2023
f2e1e35
fix(primitives): pub U256, import spacing
merklefruit Oct 30, 2023
4d4d15f
chore: conflicts
merklefruit Oct 30, 2023
56aab40
chore: from value
merklefruit Oct 30, 2023
6abad49
Merge pull request #133 from anton-rs/merklefruit/fix-rpc-types-op
refcell Oct 30, 2023
91d710e
chore(primitives): fill tx env in separate fn
merklefruit Oct 30, 2023
d044bc7
clean up comments
refcell Oct 30, 2023
8f9a748
Merge pull request #127 from anton-rs/refcell/fix-doc-comment
refcell Oct 30, 2023
474b4f4
Merge pull request #134 from anton-rs/merklefruit/primitives-small-fixes
refcell Oct 30, 2023
ce2b28d
chore: remove optimism field in ChainSpec
merklefruit Oct 30, 2023
75eb78b
chore: small fix
merklefruit Oct 30, 2023
0b079b7
Merge pull request #135 from anton-rs/merklefruit/primitives-fill-tx-env
clabby Oct 30, 2023
f9344e0
sequencer endpoint comment
refcell Oct 30, 2023
055725f
chore: is_optimism() instead of chain.optimism
merklefruit Oct 30, 2023
88f4533
fix consensus beacon reorg control flow debug statement
refcell Oct 30, 2023
53b543c
Merge pull request #137 from anton-rs/refcell/sequencer-endpoint-comment
refcell Oct 30, 2023
1559f96
chore: fmt
merklefruit Oct 30, 2023
748f1ea
format changes
refcell Oct 30, 2023
92421ae
chore: .optimism -> .is_optimism()
merklefruit Oct 30, 2023
4b85a98
Merge pull request #138 from anton-rs/refcell/cfg-control-flow
refcell Oct 30, 2023
d5810ed
chore: .optimism -> .is_optimism()
merklefruit Oct 30, 2023
d6f7edf
fix conditional dispatch
refcell Oct 30, 2023
56460a5
add cfg_if
refcell Oct 30, 2023
d10dcb7
fix remove double operator formatter error
refcell Oct 30, 2023
699bed3
fix
refcell Oct 30, 2023
0a449d2
Update crates/consensus/beacon/src/engine/mod.rs
refcell Oct 30, 2023
d40e986
rip out optimism rpc error variants
refcell Oct 30, 2023
db68a1a
fix clippy
refcell Oct 30, 2023
c0c7346
fix clippy
refcell Oct 30, 2023
e19b137
Merge pull request #139 from anton-rs/refcell/fix-dispatch
refcell Oct 30, 2023
2aa54bc
fix optimism network
refcell Oct 31, 2023
568eec9
outline optimism interfaces error types
refcell Oct 31, 2023
1e771b5
outline optimism interfaces error types
refcell Oct 31, 2023
333103f
L1BlockInfoError Fixes
refcell Oct 31, 2023
c645b28
Outline the gas limit check function
refcell Oct 31, 2023
f542a75
Remove unused err
refcell Oct 31, 2023
39a8997
Merge pull request #140 from anton-rs/refcell/rpc-optimism-grouping
refcell Oct 31, 2023
bef336e
Merge pull request #141 from anton-rs/refcell/network-optimism-fixes
refcell Oct 31, 2023
21f551e
Merge pull request #142 from anton-rs/refcell/interfaces-fixes
refcell Oct 31, 2023
c0b7d34
Merge pull request #143 from anton-rs/refcell/outline-gas-lim-check
refcell Oct 31, 2023
227e472
Engine API divergence docs + trait bound consolidation
clabby Oct 31, 2023
c84dea0
Remove unused `revm` feature flags
clabby Oct 31, 2023
5d0d294
hoist precautions into binary
refcell Oct 31, 2023
1a9662d
remove trailing semi-colon
refcell Oct 31, 2023
589b724
fix optimism payload attributes nit
refcell Oct 31, 2023
ce627e2
Merge pull request #144 from anton-rs/refcell/precaution-hoist
clabby Oct 31, 2023
6762c34
inline absolute imports
refcell Oct 31, 2023
232f73d
remove trailing semi-colon
refcell Oct 31, 2023
c75b816
Merge branch 'clabby/op-reth' into refcell/small-nits
refcell Oct 31, 2023
aad68f7
remove trailing return semi-colon
refcell Oct 31, 2023
4e40abd
fix formatting
refcell Oct 31, 2023
e5ee08c
fix precaution
refcell Oct 31, 2023
3a0317c
unneeded change
refcell Oct 31, 2023
825cc73
Merge pull request #145 from anton-rs/refcell/small-nits
clabby Oct 31, 2023
c11ec55
fix cfg_if dispatch
refcell Oct 31, 2023
aaccff5
Merge branch 'clabby/op-reth' into refcell/inline-debug-logs
refcell Oct 31, 2023
a150662
Merge pull request #147 from anton-rs/refcell/inline-debug-logs
refcell Oct 31, 2023
2914165
derives on op net config
refcell Oct 31, 2023
6051516
derives on op net config builder + default
refcell Oct 31, 2023
00b8c4b
absolute import
refcell Oct 31, 2023
81128ad
remove redundant optimism feat flag macros
refcell Oct 31, 2023
b3c4867
fix rpc method name
refcell Oct 31, 2023
6f8139a
outline optimism block meta fields
refcell Oct 31, 2023
b752b9e
Merge pull request #149 from anton-rs/refcell/final-small-fixes
refcell Oct 31, 2023
e9f1263
feat: cfg-if in beacon validator
merklefruit Oct 31, 2023
28ede82
chore: fmt
merklefruit Oct 31, 2023
f5bf065
chore: comment
merklefruit Oct 31, 2023
ea5ab50
remove freestanding doc comment
refcell Oct 31, 2023
497b96e
chore: addressed comment
merklefruit Oct 31, 2023
773d566
Merge pull request #136 from anton-rs/merklefruit/rm-optimism-chain-s…
refcell Oct 31, 2023
0985ed8
outline optimism fields
refcell Oct 31, 2023
04cb5fc
add a clarifying arc comment
refcell Oct 31, 2023
53cf13f
make the reqwest dependency optional
refcell Oct 31, 2023
8bab946
remove value-256 feature
refcell Oct 31, 2023
f747108
fix is_optimism method to include chain ids
refcell Oct 31, 2023
9875971
fix tests
refcell Oct 31, 2023
a776ce8
remove primitives crate cyclical ref
refcell Oct 31, 2023
9139475
Merge pull request #152 from anton-rs/refcell/hoist-value-256-feat
refcell Oct 31, 2023
e28f740
Merge pull request #151 from anton-rs/refcell/more-small-fixes
refcell Oct 31, 2023
f740f34
Merge pull request #150 from anton-rs/refcell/outline-optimism-meta-b…
refcell Oct 31, 2023
da3a9c5
remove revm-primitives cargo toml
refcell Oct 31, 2023
07b23f6
fix small nits
refcell Oct 31, 2023
d082ae3
Merge pull request #153 from anton-rs/refcell/more-small-nits
clabby Oct 31, 2023
d3986a6
Reduce realloc
clabby Oct 31, 2023
96548c6
rm unnecessary pattern
clabby Oct 31, 2023
c1c09a1
receipt root nit
clabby Oct 31, 2023
89a5c53
`send_raw_transaction` optimism docs
clabby Oct 31, 2023
13d3b14
Pull out `build_transaction_receipt` into mutually exclusive fns
clabby Nov 1, 2023
bb585fb
Remove `ethereum` feature
clabby Nov 1, 2023
ef487c0
`OptimismBlockMeta` -> `OptimismTxMeta`
clabby Nov 1, 2023
779ca19
Add runtime check for non-OP Stack chains when the `optimism` feature…
clabby Nov 1, 2023
6de2577
fix refcell nits
refcell Nov 1, 2023
23e9440
Merge pull request #154 from anton-rs/refcell/fix-refcell-nits
refcell Nov 2, 2023
3190b1f
move optimism tx meta to new file
refcell Nov 2, 2023
63cd43d
fix nits
refcell Nov 3, 2023
9c7ab40
resolve two small conflicts
refcell Nov 3, 2023
0474763
joined future block and receipt fetching
refcell Nov 3, 2023
ac050a2
referenced chainspec instead of arcs
refcell Nov 3, 2023
018789f
remove trailing semi-colons
refcell Nov 3, 2023
9be3212
missed one trailing semicolon
refcell Nov 3, 2023
7e87683
Merge pull request #156 from anton-rs/refcell/upstream-sync-again
refcell Nov 3, 2023
45017e6
Merge pull request #155 from anton-rs/refcell/hoist-optimism-tx-meta
refcell Nov 3, 2023
1e68098
`ethereum` feature flag comment
clabby Nov 3, 2023
ac96757
Move `optimism` chainspec safety check to higher level CLI runner
clabby Nov 3, 2023
fe52763
chore: minor nits
merklefruit Nov 3, 2023
eeb2c97
Remove `optimism` runtime check in `reth` bin
clabby Nov 3, 2023
3652bca
Merge pull request #158 from anton-rs/cl/merklefruit-nits
clabby Nov 3, 2023
8cab07b
WIP: bin split
clabby Nov 4, 2023
9423c95
wip: splitting bins
merklefruit Nov 4, 2023
3f9b4e9
Fixup makefile
clabby Nov 4, 2023
b53ed2c
CI fix
clabby Nov 4, 2023
93d5c20
Move mainnet bin file back to `main.rs`
clabby Nov 4, 2023
8492578
Merge upstream / resolve conflicts in workflows
clabby Nov 5, 2023
cd0efc2
Resolve conflicts
clabby Nov 5, 2023
af6d37b
fix implemented doc comment
refcell Nov 5, 2023
05ca268
move the reqwest client into the eth api inner
refcell Nov 5, 2023
db54081
fix sanity workflow
refcell Nov 5, 2023
619ce45
chore: nits
merklefruit Nov 5, 2023
7482db8
remove nightly
refcell Nov 5, 2023
ec97477
Merge pull request #159 from anton-rs/cl/bin-split
refcell Nov 5, 2023
32324c9
Merge pull request #160 from anton-rs/refcell/prevent-client-reinstan…
refcell Nov 5, 2023
b2768d0
Fix workflows
clabby Nov 5, 2023
53e8fc3
Address Dani's CI nits
clabby Nov 5, 2023
6215e45
Merge branch 'main' into clabby/op-reth
clabby Nov 5, 2023
1d6febf
`GITHUB_STATE` -> `GITHUB_OUTPUT`
clabby Nov 5, 2023
d261c71
Update crates/primitives/src/constants/mod.rs
clabby Nov 5, 2023
1c4acfd
Update crates/primitives/src/constants/mod.rs
clabby Nov 5, 2023
62f8111
Merge pull request #161 from anton-rs/merklefruit/nits
clabby Nov 5, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,13 @@ concurrency:

jobs:
test:
name: test (${{ matrix.partition }}/${{ strategy.job-total }})
name: test (${{ matrix.network }} | ${{ matrix.partition }}/${{ strategy.job-total }})
runs-on:
group: Reth
strategy:
matrix:
partition: [1, 2]
network: ["ethereum", "optimism"]
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
Expand All @@ -34,10 +35,20 @@ jobs:
- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
- name: Set binary value
id: binary
run: |
if [[ "${{ matrix.network }}" == "ethereum" ]]; then
echo "binary=reth" >> $GITHUB_OUTPUT
else
echo "binary=op-reth" >> $GITHUB_OUTPUT
fi
- name: Run tests
run: |
cargo nextest run \
--locked --all-features --workspace --exclude examples --exclude ef-tests \
--locked --features "${{ matrix.network }}" \
--bin ${{ steps.binary.outputs.binary }} \
--workspace --exclude examples --exclude ef-tests \
--partition hash:${{ matrix.partition }}/${{ strategy.job-total }} \
-E 'kind(test)'

Expand Down
9 changes: 8 additions & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@ jobs:
name: clippy
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
matrix:
include:
- binary: "reth"
network: "ethereum"
- binary: "op-reth"
network: "optimism"
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@clippy
Expand All @@ -22,7 +29,7 @@ jobs:
- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
- run: cargo clippy --workspace --all-targets --all-features
- run: cargo clippy --bin "${{ matrix.binary }}" --workspace --features "${{ matrix.network }}"
env:
RUSTFLAGS: -D warnings

Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/sanity.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,15 @@ env:
jobs:
unused-dependencies:
runs-on: ubuntu-latest
strategy:
matrix:
network: ["ethereum", "optimism"]
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
- uses: taiki-e/install-action@cargo-udeps
- name: Check for unused dependencies
run: cargo udeps --all-features --all-targets
run: cargo udeps --features "jemalloc,${{ matrix.network }}"
- uses: JasonEtco/create-an-issue@v2
if: ${{ failure() }}
env:
Expand Down
23 changes: 19 additions & 4 deletions .github/workflows/unit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,13 @@ concurrency:

jobs:
test:
name: tests (${{ matrix.partition }}/${{ strategy.job-total }})
name: tests (${{ matrix.network }} | ${{ matrix.partition }}/${{ strategy.job-total }})
runs-on:
group: Reth
strategy:
matrix:
partition: [1, 2]
network: ["ethereum", "optimism"]
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
Expand All @@ -32,10 +33,20 @@ jobs:
with:
cache-on-failure: true
- uses: taiki-e/install-action@nextest
- name: Set binary value
id: binary
run: |
if [[ "${{ matrix.network }}" == "ethereum" ]]; then
echo "binary=reth" >> $GITHUB_OUTPUT
else
echo "binary=op-reth" >> $GITHUB_OUTPUT
fi
- name: Run tests
run: |
cargo nextest run \
--locked --all-features --workspace --exclude examples --exclude ef-tests \
--locked --features "${{ matrix.network }}" \
--bin ${{ steps.binary.outputs.binary }} \
--workspace --exclude examples --exclude ef-tests \
--partition hash:${{ matrix.partition }}/${{ strategy.job-total }} \
-E "kind(lib) | kind(bin) | kind(proc-macro)"

Expand Down Expand Up @@ -63,17 +74,21 @@ jobs:
- run: cargo nextest run --release -p ef-tests --features ef-tests

doc:
name: doc tests
name: doc tests (${{ matrix.network }})
runs-on:
group: Reth
timeout-minutes: 30
strategy:
matrix:
network: ["ethereum", "optimism"]
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
- run: cargo test --doc --workspace --all-features
- name: Run doctests
run: cargo test --doc --workspace --features "${{ matrix.network }}"

unit-success:
name: unit success
Expand Down
5 changes: 4 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 26 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,20 @@ install: ## Build and install the reth binary under `~/.cargo/bin`.
--profile "$(PROFILE)" \
$(CARGO_INSTALL_EXTRA_FLAGS)

.PHONY: install-op
install-op: ## Build and install the op-reth binary under `~/.cargo/bin`.
cargo install --path bin/reth --bin op-reth --force --locked \
--features "optimism,$(FEATURES)" \
--profile "$(PROFILE)" \
$(CARGO_INSTALL_EXTRA_FLAGS)

# Builds the reth binary natively.
build-native-%:
cargo build --bin reth --target $* --features "$(FEATURES)" --profile "$(PROFILE)"

op-build-native-%:
cargo build --bin op-reth --target $* --features "optimism,$(FEATURES)" --profile "$(PROFILE)"

# The following commands use `cross` to build a cross-compile.
#
# These commands require that:
Expand All @@ -70,6 +80,10 @@ build-%:
RUSTFLAGS="-C link-arg=-lgcc -Clink-arg=-static-libgcc" \
cross build --bin reth --target $* --features "$(FEATURES)" --profile "$(PROFILE)"

op-build-%:
RUSTFLAGS="-C link-arg=-lgcc -Clink-arg=-static-libgcc" \
cross build --bin op-reth --target $* --features "optimism,$(FEATURES)" --profile "$(PROFILE)"

# Unfortunately we can't easily use cross to build for Darwin because of licensing issues.
# If we wanted to, we would need to build a custom Docker image with the SDK available.
#
Expand Down Expand Up @@ -105,19 +119,30 @@ build-release-tarballs: ## Create a series of `.tar.gz` files in the BIN_DIR dir

##@ Test

UNIT_TEST_ARGS := --locked --workspace --all-features -E 'kind(lib)' -E 'kind(bin)' -E 'kind(proc-macro)'
UNIT_TEST_ARGS := --locked --workspace --features 'jemalloc-prof' -E 'kind(lib)' -E 'kind(bin)' -E 'kind(proc-macro)'
UNIT_TEST_ARGS_OP := --locked --workspace --features 'jemalloc-prof,optimism' -E 'kind(lib)' -E 'kind(bin)' -E 'kind(proc-macro)'
COV_FILE := lcov.info

.PHONY: test-unit
test-unit: ## Run unit tests.
cargo install cargo-nextest --locked
cargo nextest run $(UNIT_TEST_ARGS)

.PHONY: test-unit-op
test-unit-op: ## Run unit tests (with optimism feature flag enabled).
cargo install cargo-nextest --locked
cargo nextest run $(UNIT_TEST_ARGS_OP)

.PHONY: cov-unit
cov-unit: ## Run unit tests with coverage.
rm -f $(COV_FILE)
cargo llvm-cov nextest --lcov --output-path $(COV_FILE) $(UNIT_TEST_ARGS)

.PHONY: cov-unit-op
cov-unit-op: ## Run unit tests with coverage (with optimism feature flag enabled).
rm -f $(COV_FILE)
cargo llvm-cov nextest --lcov --output-path $(COV_FILE) $(UNIT_TEST_ARGS_OP)

.PHONY: cov-report-html
cov-report-html: cov-unit ## Generate a HTML coverage report and open it in the browser.
cargo llvm-cov report --html
Expand Down
24 changes: 24 additions & 0 deletions bin/reth/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,30 @@ min-warn-logs = ["tracing/release_max_level_warn"]
min-info-logs = ["tracing/release_max_level_info"]
min-debug-logs = ["tracing/release_max_level_debug"]
min-trace-logs = ["tracing/release_max_level_trace"]
optimism = [
"reth-primitives/optimism",
"reth-revm/optimism",
"reth-interfaces/optimism",
"reth-rpc/optimism",
"reth-rpc-engine-api/optimism",
"reth-transaction-pool/optimism",
"reth-provider/optimism",
"reth-beacon-consensus/optimism",
"reth-basic-payload-builder/optimism",
"reth-network/optimism",
"reth-network-api/optimism"
]
# no-op feature flag for switching between the `optimism` and default functionality in CI matrices
ethereum = []
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we need this?
what is this used for?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a no-op feature, specifically for the CI matrix. We added the ethereum feature as a switch for CI with and without optimism enabled.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, makes sense imo

let's add s one line note


[build-dependencies]
vergen = { version = "8.0.0", features = ["build", "cargo", "git", "gitcl"] }

[[bin]]
name = "reth"
path = "src/main.rs"

[[bin]]
name = "op-reth"
path = "src/optimism.rs"
required-features = ["optimism"]
6 changes: 6 additions & 0 deletions bin/reth/src/args/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@ pub use dev_args::DevArgs;
mod pruning_args;
pub use pruning_args::PruningArgs;

/// RollupArgs for configuring the op-reth rollup
#[cfg(feature = "optimism")]
mod rollup_args;
#[cfg(feature = "optimism")]
pub use rollup_args::RollupArgs;

pub mod utils;

pub mod types;
17 changes: 17 additions & 0 deletions bin/reth/src/args/payload_builder_args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,18 @@ pub struct PayloadBuilderArgs {
/// Maximum number of tasks to spawn for building a payload.
#[arg(long = "builder.max-tasks", help_heading = "Builder", default_value = "3", value_parser = RangedU64ValueParser::<usize>::new().range(1..))]
pub max_payload_tasks: usize,

/// By default the pending block equals the latest block
/// to save resources and not leak txs from the tx-pool,
/// this flag enables computing of the pending block
/// from the tx-pool instead.
clabby marked this conversation as resolved.
Show resolved Hide resolved
///
/// If `compute_pending_block` is not enabled, the payload builder
/// will use the payload attributes from the latest block. Note
/// that this flag is not yet functional.
#[cfg(feature = "optimism")]
#[arg(long = "rollup.compute-pending-block")]
pub compute_pending_block: bool,
Comment on lines +45 to +50
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wdym "not yet functional"?

Copy link
Collaborator Author

@clabby clabby Nov 5, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As in, not yet implemented. For context - the compute_pending_block flag was added to op-geth around the time that Lattice was making OP Craft to enable higher throughput. This flag is not necessary for MVP, so we decided to stub it out for now.

In practice, the compute_pending_block flag is meant to allow for skipping the pending block computation in the payload job poller. See: https://github.com/ethereum-optimism/op-geth/blob/7b2e04673aaca3c33c78165d28089b4f5c456417/miner/worker.go#L429-L440

}

impl PayloadBuilderConfig for PayloadBuilderArgs {
Expand All @@ -58,6 +70,11 @@ impl PayloadBuilderConfig for PayloadBuilderArgs {
fn max_payload_tasks(&self) -> usize {
self.max_payload_tasks
}

#[cfg(feature = "optimism")]
fn compute_pending_block(&self) -> bool {
self.compute_pending_block
}
}

#[derive(Clone, Debug, Default)]
Expand Down
19 changes: 19 additions & 0 deletions bin/reth/src/args/rollup_args.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
//! clap [Args](clap::Args) for op-reth rollup configuration

/// Parameters for rollup configuration
#[derive(Debug, clap::Args)]
#[command(next_help_heading = "Rollup")]
pub struct RollupArgs {
/// HTTP endpoint for the sequencer mempool
#[arg(long = "rollup.sequencer-http", value_name = "HTTP_URL")]
pub sequencer_http: Option<String>,

/// Disable transaction pool gossip
#[arg(long = "rollup.disable-tx-pool-gossip")]
pub disable_txpool_gossip: bool,

/// Enable walkback to genesis on startup. This is useful for re-validating the existing DB
/// prior to beginning normal syncing.
#[arg(long = "rollup.enable-genesis-walkback")]
pub enable_genesis_walkback: bool,
}
20 changes: 20 additions & 0 deletions bin/reth/src/args/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ use std::{
time::Duration,
};

#[cfg(feature = "optimism")]
use reth_primitives::{BASE_GOERLI, BASE_MAINNET};

/// Helper to parse a [Duration] from seconds
pub fn parse_duration_from_secs(arg: &str) -> eyre::Result<Duration, std::num::ParseIntError> {
let seconds = arg.parse()?;
Expand All @@ -27,6 +30,10 @@ pub fn chain_spec_value_parser(s: &str) -> eyre::Result<Arc<ChainSpec>, eyre::Er
"sepolia" => SEPOLIA.clone(),
"holesky" => HOLESKY.clone(),
"dev" => DEV.clone(),
#[cfg(feature = "optimism")]
"base-goerli" => BASE_GOERLI.clone(),
#[cfg(feature = "optimism")]
"base" => BASE_MAINNET.clone(),
_ => {
let raw = fs::read_to_string(PathBuf::from(shellexpand::full(s)?.into_owned()))?;
serde_json::from_str(&raw)?
Expand All @@ -46,6 +53,10 @@ pub fn genesis_value_parser(s: &str) -> eyre::Result<Arc<ChainSpec>, eyre::Error
"sepolia" => SEPOLIA.clone(),
"holesky" => HOLESKY.clone(),
"dev" => DEV.clone(),
#[cfg(feature = "optimism")]
"base-goerli" => BASE_GOERLI.clone(),
#[cfg(feature = "optimism")]
"base" => BASE_MAINNET.clone(),
_ => {
// try to read json from path first
let mut raw =
Expand Down Expand Up @@ -156,6 +167,15 @@ mod tests {
use secp256k1::rand::thread_rng;
use std::collections::HashMap;

#[cfg(feature = "optimism")]
#[test]
fn parse_optimism_chain_spec() {
for chain in ["base-goerli", "base"] {
chain_spec_value_parser(chain).unwrap();
genesis_value_parser(chain).unwrap();
}
}

#[test]
fn parse_known_chain_spec() {
for chain in ["mainnet", "sepolia", "goerli", "holesky"] {
Expand Down
4 changes: 4 additions & 0 deletions bin/reth/src/cli/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,4 +97,8 @@ pub trait PayloadBuilderConfig {

/// Maximum number of tasks to spawn for building a payload.
fn max_payload_tasks(&self) -> usize;

/// Returns whether or not to construct the pending block.
#[cfg(feature = "optimism")]
fn compute_pending_block(&self) -> bool;
}
Loading
Loading