Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
530 commits
Select commit Hold shift + click to select a range
98fd52c
test: fix fastlane lib deploy
krogla Feb 26, 2026
d638dbc
fix: code cleanup & minor refactor
krogla Feb 26, 2026
a0806ef
Merge pull request #1675 from lidofinance/fix/srv3-code-cleanup
krogla Feb 26, 2026
8051b2f
fix: tests
hweawer Feb 26, 2026
8e5e1a4
Merge branch 'feat/vebo-srv3' of https://github.com/lidofinance/core …
hweawer Feb 26, 2026
ff9f2bc
fix: _handleConsensusReportData only format=1
hweawer Feb 26, 2026
d4e0bc9
fix: incorrect tests
hweawer Feb 26, 2026
288025d
fix: external -> public BeaconChainDepositor lib
Amuhar Feb 26, 2026
1771856
fix: fix submit data
hweawer Feb 26, 2026
0f0b105
fix: fix tests with missing mocks
hweawer Feb 26, 2026
cab7eae
fix: max exit 1700 validators in test
hweawer Feb 26, 2026
81ce20b
Merge pull request #1643 from lidofinance/feat/vebo-srv3
mkurayan Feb 26, 2026
204c1b5
feat: srv3 negative rebase sanity check
eddort Feb 26, 2026
88fc7de
fix: check module return doesnt exceed target
Amuhar Feb 26, 2026
0a3d2a4
feat: srv3 negative rebase sanity check migration
eddort Feb 26, 2026
1501965
Merge branch 'feat/staking-router-3.0' of https://github.com/lidofina…
eddort Feb 26, 2026
b916d06
fix: external -> public BeaconChainDepositor lib
Amuhar Feb 26, 2026
3ab564a
Merge branch 'feat/staking-router-3.0' into fix/lib-beacon-chain-depo…
Amuhar Feb 27, 2026
e234d30
Merge pull request #1676 from lidofinance/fix/lib-beacon-chain-depositor
Amuhar Feb 27, 2026
e72e75d
fix: wc change notification
krogla Feb 27, 2026
6b44f7b
fix: scratch deploy
krogla Feb 27, 2026
863cff1
fix: increase node max_old_space_size
krogla Feb 27, 2026
0af4dcd
Merge pull request #1679 from lidofinance/fix/srv3-test-fixes
krogla Feb 27, 2026
808caff
feat: srv3 sanity checks
eddort Feb 28, 2026
3eaafbb
Merge branch 'feat/staking-router-3.0' of https://github.com/lidofina…
eddort Feb 28, 2026
8822062
feat: sanity checker e2e
eddort Feb 28, 2026
e92d7fa
feat: update exited and consolidation ETH amount per day limits in sa…
eddort Mar 1, 2026
c5ec38c
feat: implement module active balance calculation and enhance negativ…
eddort Mar 1, 2026
550f8d8
refactor: rename "active balance" to "validator balance"
mkurayan Mar 2, 2026
0f45df7
refactor: rename storage slot from "active balance" to "validator bal…
mkurayan Mar 2, 2026
87c62dd
refactor: use plural forms where appropriate
mkurayan Mar 2, 2026
0243759
refactor: remove stale comments
mkurayan Mar 2, 2026
92ab91b
feat: enhance OracleReportSanityChecker to track actual CL withdrawal…
eddort Mar 2, 2026
828e43d
style: fix naming
krogla Mar 3, 2026
71fab3a
Merge pull request #1682 from lidofinance/feat/staking-router-3.0-ren…
krogla Mar 3, 2026
96d2ba0
feat: add unit tests
eddort Mar 3, 2026
be88a69
feat: fix console warnings
mkurayan Mar 3, 2026
be899ee
feat: align getProcessingState interface
mkurayan Mar 3, 2026
b95ae52
style: fix naming
krogla Mar 3, 2026
7bc0e4a
feat: add to ignore list
mkurayan Mar 3, 2026
ca51bcb
Merge pull request #1683 from lidofinance/feat/staking-router-3.0-abi…
mkurayan Mar 3, 2026
b0f2110
Merge pull request #1684 from lidofinance/feat/staking-router-3.0-upd…
mkurayan Mar 3, 2026
5e92cc1
refactor: unify modules interface
mkurayan Mar 3, 2026
0203006
Update test/0.8.25/srv3/contracts/SSZValidatorsMerkleTree.sol
mkurayan Mar 3, 2026
afb68fd
feat: max eb values as SR constructor params + refactor, cleanup
krogla Mar 4, 2026
a21d729
fix: add wc scripts helper
krogla Mar 4, 2026
9f9c4ab
fix: fix SR scratch deploy flows
krogla Mar 4, 2026
3c4df85
test: update SR interface, minor refactor
krogla Mar 4, 2026
27f708b
feat: reverted VEBO constructor parameters - maxeb weights, fix depl…
krogla Mar 4, 2026
708ee51
Merge pull request #1687 from lidofinance/fix/srv3-constructor-params
krogla Mar 4, 2026
e5b87b1
refactor: clean-up code
mkurayan Mar 4, 2026
e64bf68
Merge pull request #1688 from lidofinance/feat/staking-router-3.0-sr-…
mkurayan Mar 4, 2026
1163c5e
refactor: fix naming
mkurayan Mar 4, 2026
eae72fd
feat: update max CL balance decrease to 360 basis points across confi…
eddort Mar 4, 2026
6b0e116
Merge pull request #1686 from lidofinance/feat/staking-router-3.0-con…
eddort Mar 4, 2026
89917b1
fix: pubkey length error name & sr balance after deposit check
Amuhar Mar 4, 2026
7086eee
Merge branch 'feat/staking-router-3.0' of https://github.com/lidofina…
eddort Mar 4, 2026
cd9a015
feat: replace FastLane with buffered ether allocation and update tests
Psirex Mar 4, 2026
0abd61a
feat: track only a pending batches in the consolidation bus
mkurayan Mar 5, 2026
52f40b2
feat: sanity check e2e
eddort Mar 5, 2026
2ba654e
feat: update integration tests
eddort Mar 5, 2026
d8f4b1e
feat: update integration tests
eddort Mar 5, 2026
bd7c816
Merge pull request #1690 from lidofinance/feat/buffered-ether-allocation
krogla Mar 6, 2026
77bd800
Merge pull request #1692 from lidofinance/feat/staking-router-3.0-con…
eddort Mar 6, 2026
de19199
refactor: simplify CL balance checks
eddort Mar 6, 2026
da3c4b7
feat: add updateModuleShares method to SR
mkurayan Mar 6, 2026
f1fec88
Merge pull request #1689 from lidofinance/fix/sr-small-changes
Amuhar Mar 8, 2026
66e3424
feat: update exitedValidatorEthAmountLimit to use whole ETH units
eddort Mar 8, 2026
bf3547b
Merge pull request #1694 from lidofinance/feat/staking-router-3.0-upd…
krogla Mar 9, 2026
9c9eb9c
refactor: split sanity checker limiter
eddort Mar 9, 2026
497c050
feat: update ReportData struct to use smaller data types
eddort Mar 9, 2026
9dd5d16
feat: rename active balance references to validators balance in sanit…
eddort Mar 9, 2026
c0734dc
fix: remove key index from checks
hweawer Mar 10, 2026
cb3864f
fix: move max effective balance weight defaults to sanity checker
eddort Mar 10, 2026
0cee2b7
refactor: remove module decrease check from sanity checker
eddort Mar 10, 2026
f6c01e7
feat: add tests for module balance limits in OracleReportSanityChecker
eddort Mar 10, 2026
1311487
refactor: document withdrawal transfer guard
eddort Mar 10, 2026
3ce99c8
Merge branch 'feat/staking-router-3.0' of https://github.com/lidofina…
eddort Mar 10, 2026
43fefc0
fix: extend module state getters with balances
krogla Mar 10, 2026
358c930
Merge pull request #1696 from lidofinance/feat/srv3-extend-ao-methods
krogla Mar 10, 2026
8a93fe1
fix: storage slots optimization, minor refactor
krogla Mar 11, 2026
229f0b3
Merge pull request #1697 from lidofinance/fix/srv3-lido-optimize
mkurayan Mar 11, 2026
44b466c
Merge pull request #1695 from lidofinance/fix/srv3-remove-key-index-f…
mkurayan Mar 11, 2026
cafdb2d
Merge commit '44b466c2270e8f0b893c2104cc467dde6c1c744d' into feat/sta…
mkurayan Mar 11, 2026
f8c5674
refactor: remove unused methods
mkurayan Mar 11, 2026
30cbd38
refactor: remove unused struct definition
mkurayan Mar 11, 2026
56e11c6
Merge pull request #1698 from lidofinance/feat/staking-router-3.0-ao-…
mkurayan Mar 11, 2026
78ea699
feat: consolidation requests processing paused if DSM stopped deposits
mkurayan Mar 12, 2026
b748c1e
refactor: fix typo in executor role name
mkurayan Mar 12, 2026
8b18241
feat: update consolidation bus test
mkurayan Mar 12, 2026
9fc3a9f
fix: gh actions timeout increase
hweawer Mar 12, 2026
e03603f
fix: increase ram
hweawer Mar 12, 2026
fc60a07
fix: ram
hweawer Mar 12, 2026
0d53c83
fix: remove 1700
hweawer Mar 12, 2026
47c18c6
Merge pull request #1699 from lidofinance/feat/staking-router-3.0-con…
mkurayan Mar 12, 2026
bcf7b1f
Merge pull request #1700 from lidofinance/feat/staking-router-3.0-con…
mkurayan Mar 12, 2026
31caaea
fix: remove unused and fix natspec comments
tamtamchik Mar 12, 2026
669e5e5
fix: top up gateway slot check to timestamp check & sr deposits 0 rev…
Amuhar Mar 12, 2026
eed2e98
Merge pull request #1701 from lidofinance/fix/fix-gh-action-coverage-…
mkurayan Mar 12, 2026
439d699
Merge pull request #1703 from lidofinance/fix/sr-small-changes
mkurayan Mar 12, 2026
4ae003d
Merge pull request #1702 from lidofinance/feat/yt-review
mkurayan Mar 12, 2026
c32341f
feat: fix allocation tests
mkurayan Mar 12, 2026
ce8577b
Merge pull request #1704 from lidofinance/feat/staking-router-3.0-fix…
mkurayan Mar 12, 2026
04490fd
fix: add REMOVE_ROLE, minor refactor
krogla Mar 12, 2026
04d9d31
fix: SR roles storage migration
krogla Mar 11, 2026
4388f35
fix: remove unused role grant
krogla Mar 12, 2026
218a4d7
Merge pull request #1705 from lidofinance/fix/srv3-consolidation-roles
mkurayan Mar 12, 2026
3e01482
Merge pull request #1706 from lidofinance/fix/srv3-role-migration
mkurayan Mar 12, 2026
873e41e
feat: use AccessControlEnumerable instead of AccessControlEnumerableU…
mkurayan Mar 13, 2026
01833d0
Merge pull request #1707 from lidofinance/feat/staking-router-3.0-ace
mkurayan Mar 13, 2026
a9e263f
refactor: pause and resume roles keccak
mkurayan Mar 13, 2026
b492200
Merge pull request #1708 from lidofinance/feat/staking-router-3.0-con…
mkurayan Mar 13, 2026
c1b5f31
Merge pull request #1681 from lidofinance/feat/staking-router-3.0-ao-…
mkurayan Mar 13, 2026
121b3df
feat: add tests for veb coverage
hweawer Mar 13, 2026
8749daa
wip: pending deposits sanity check
eddort Mar 13, 2026
1b65a5e
fix: increase timeout
hweawer Mar 13, 2026
878316c
chore: remove unused events and constants
tamtamchik Mar 13, 2026
3e82803
chore: remove unused InvalidSignLength error
tamtamchik Mar 13, 2026
83d9ba0
chore: remove unused code across contracts
tamtamchik Mar 13, 2026
46a086f
chore: align interface params with implementations
tamtamchik Mar 13, 2026
fc83550
fix: add missing consolidationGateway to test
tamtamchik Mar 13, 2026
7eeabf7
fix: remove 1000
hweawer Mar 13, 2026
6d9209f
Merge branch 'feat/staking-router-3.0' into fix/add-tests-veb
hweawer Mar 13, 2026
9baf7f7
fix: fix test
hweawer Mar 13, 2026
d5b9067
Merge branch 'fix/add-tests-veb' of https://github.com/lidofinance/co…
hweawer Mar 13, 2026
1c642d8
fix: remove test
hweawer Mar 13, 2026
dcfa28c
chore: rename interface
mkurayan Mar 13, 2026
c1b240c
Merge pull request #1712 from lidofinance/feat/staking-router-3.0-ren…
mkurayan Mar 13, 2026
4ee74fd
fix: return 1000
hweawer Mar 13, 2026
90fe51c
refactor: extract system contract addresses to constructor
mkurayan Mar 13, 2026
684ea07
feat: pending deposits sanity check
eddort Mar 13, 2026
9397ad4
Merge pull request #1710 from lidofinance/feat/dead-code
krogla Mar 13, 2026
48465a8
refactor: check addresses in constuctor
mkurayan Mar 13, 2026
991cc42
chore: remove finalizeUpgrade_v2
mkurayan Mar 13, 2026
99e7c7e
fix: unit & integration tests & return cl sanity check
eddort Mar 13, 2026
937a836
fix: integration tests & formatting
eddort Mar 13, 2026
b0f06cd
Merge branch 'feat/staking-router-3.0' of https://github.com/lidofina…
eddort Mar 14, 2026
ed572be
feat: add check total CL balance increase against active appeared eth
eddort Mar 15, 2026
8811b57
fix: update maxPendingLimit logic and add test for hidden validator d…
eddort Mar 15, 2026
36b9478
feat: add getDepositAllocations method
mkurayan Mar 15, 2026
c7a1dd3
feat: handle module sanity cold start and add tests
eddort Mar 15, 2026
dfee98f
feat: remove getDepositsAllocation and getTopUpAllocation methods
mkurayan Mar 15, 2026
914fd00
fix: prevent buffered eth movements until report
krogla Mar 16, 2026
5a92000
Merge branch 'feat/staking-router-3.0' into fix/add-tests-veb
hweawer Mar 16, 2026
b493ba7
docs: allocation logic explain
krogla Mar 16, 2026
9d03f12
fix: remove 1000
hweawer Mar 16, 2026
cc6b59d
fix: comments, remove unused i-face
krogla Mar 16, 2026
39324b1
fix: 600
hweawer Mar 16, 2026
58d9d6b
fix: revert wq
hweawer Mar 16, 2026
3ff8ffe
Merge pull request #1709 from lidofinance/fix/add-tests-veb
mkurayan Mar 16, 2026
52c5910
test: lido canDeposit depends on report
krogla Mar 16, 2026
7dbf599
feat: use validator balances in module pending sanity check
eddort Mar 16, 2026
982478d
Merge pull request #1714 from lidofinance/feat/staking-router-3.0-pen…
mkurayan Mar 16, 2026
b2736a5
Merge pull request #1719 from lidofinance/feat/srv3-lido-prevent-depo…
mkurayan Mar 16, 2026
19abf46
feat: add allocation tests
mkurayan Mar 16, 2026
444cc83
fix: increase Node memory and use correct flag syntax
tamtamchik Mar 16, 2026
01f873a
chore: try to reduce code complexity
tamtamchik Mar 16, 2026
7e34bb6
feat: bump oracle version
mkurayan Mar 16, 2026
c252a81
fix: dev comment for dsm contract canDeposit method
Amuhar Mar 16, 2026
daaaa21
Merge pull request #1713 from lidofinance/feat/staking-router-3.0-wv-…
mkurayan Mar 16, 2026
00c7087
refactor: explicit return
mkurayan Mar 16, 2026
f17e939
Merge pull request #1721 from lidofinance/feat/staking-router-3.0-bum…
mkurayan Mar 16, 2026
0c34486
Merge pull request #1717 from lidofinance/feat/staking-router-3.0-dep…
mkurayan Mar 16, 2026
ea09656
Merge pull request #1720 from lidofinance/feat/fix-coverage
mkurayan Mar 16, 2026
baa02dd
Merge pull request #1722 from lidofinance/fix/desc-for-candeposit
mkurayan Mar 16, 2026
6ea5c93
fix: disable upgrade until report
krogla Mar 16, 2026
f2c3f9d
test: fix test
krogla Mar 16, 2026
1b70f39
Merge pull request #1725 from lidofinance/fix/srv3-no-upgrade-until-r…
mkurayan Mar 16, 2026
62ff986
fix: prevent sr finalize until report
krogla Mar 16, 2026
4920732
Merge pull request #1726 from lidofinance/fix/srv3-no-sr-upgrade-unti…
mkurayan Mar 16, 2026
72f7b36
feat: new deposit tracker
krogla Mar 18, 2026
e213671
fix: cl top up verifier -> cl validator verifier
Amuhar Mar 19, 2026
3fe6eba
fix: import
Amuhar Mar 19, 2026
cc6bdc3
feat: group consolidation requests
mkurayan Mar 19, 2026
83913c7
feat: add unit tests for empty groups
mkurayan Mar 19, 2026
69c2d6b
feat: add max groups in batch limit
mkurayan Mar 19, 2026
81e6973
feat: module balance sanity checks and add integration coverage
eddort Mar 19, 2026
c3514a6
feat: add max groups in batch limit
mkurayan Mar 19, 2026
2cc250e
fix: accounting oracle sanity check unit tests
eddort Mar 19, 2026
bb6584b
Merge pull request #1735 from lidofinance/feat/srv3-sanity-check-e2e
eddort Mar 19, 2026
245652b
feat: add consolidation target proof
mkurayan Mar 19, 2026
42abbb9
Merge pull request #1732 from lidofinance/feat/universal-cl-val-verifier
Amuhar Mar 20, 2026
f0940bd
feat: remove redundant checks in ConsolidationMigrator
mkurayan Mar 20, 2026
8068ce5
refactor: remove redundant _extractPubkey function in ConsolidationMi…
mkurayan Mar 20, 2026
5b5bdb0
feat: remove redundant validateConsolidationBatch method
mkurayan Mar 20, 2026
81b3b73
feat: rename witness parameter in consolidation flow
mkurayan Mar 20, 2026
b2c5c8a
feat: check consolidation preconditions
mkurayan Mar 20, 2026
bccf31a
feat: make executeConsolidation in consolidation buss permissionless
mkurayan Mar 20, 2026
d88d894
feat: add consolidation requests execution delay in consolidation bus
mkurayan Mar 20, 2026
654ed1b
feat: improve consolidation gateway tests, add proof verification
mkurayan Mar 21, 2026
f963775
refactor: remove redundant wrapper in consolidation gateway
mkurayan Mar 21, 2026
3a79e1f
feat: update gas tests for consolidation
mkurayan Mar 21, 2026
f3d116b
feat: get wc from withdrawal vault address
mkurayan Mar 22, 2026
df28ad2
feat: add consolidation gateway deploy params
mkurayan Mar 22, 2026
f1ed689
feat: add consolidation bus and migrator deploy params
mkurayan Mar 22, 2026
9ac2d98
feat: deposits tracking in Lido
krogla Mar 22, 2026
db2076c
refactor: auto format contract
mkurayan Mar 22, 2026
fa94252
feat: remove pendingDeposits from SR
krogla Mar 22, 2026
e720514
fix: mem optimization in SR
krogla Mar 22, 2026
036eb2d
fix: sr tests, minor refactor
krogla Mar 22, 2026
e3c1df4
feat: validate pubkey length in consolidation bus
mkurayan Mar 22, 2026
aa330a8
feat: add execution delay comment
mkurayan Mar 22, 2026
f854376
refactor: remove unreachable event in consolidation migrator
mkurayan Mar 22, 2026
b453836
feat: revert if try remove empty batches array in consolidation bus
mkurayan Mar 22, 2026
4956a32
refactor: improve addConsolidationRequests method comment in consolid…
mkurayan Mar 22, 2026
f3245e3
feat: add failing CL proof tests for consolidation gateway
mkurayan Mar 22, 2026
ef819aa
refactor: improve consolidation flow tests
mkurayan Mar 23, 2026
32e46d2
refactor: move consolidation contracts to dedicated folder
mkurayan Mar 23, 2026
aead963
feat: specify InvalidProof error
mkurayan Mar 23, 2026
6082f89
feat: improve consolidation gateway
mkurayan Mar 23, 2026
b3f766e
feat: module balance sanity checks and add integration coverage
eddort Mar 19, 2026
99aba92
fix: accounting oracle sanity check unit tests
eddort Mar 19, 2026
44c7162
feat: refactor sanity checker and update per module checks
eddort Mar 22, 2026
3920b75
refactor: remove outdated sanity check tests and update error messages
eddort Mar 22, 2026
e051388
fix: cl top up verifier -> cl validator verifier
Amuhar Mar 19, 2026
f559cfb
fix: import
Amuhar Mar 19, 2026
221b565
fix: sanity checks unit tests
eddort Mar 22, 2026
5c4e35e
fix: accounting e2e tests
eddort Mar 22, 2026
6d3838e
refactor: accounting e2e tests
eddort Mar 22, 2026
32b0584
refactor: clean up test code formatting and improve readability
eddort Mar 22, 2026
ce11110
fix: revert report data structure
krogla Mar 23, 2026
88c730b
refactor: check consolidation preconditions before main proof check
mkurayan Mar 23, 2026
f932c29
Merge branch 'feat/staking-router-3.0' into feat/srv3-deposit-tracker…
krogla Mar 23, 2026
9a3c01f
feat: remove double encoding in consolidation bus
mkurayan Mar 23, 2026
8198764
fix: AO unit tests
eddort Mar 24, 2026
3674d59
fix: AO e2e tests
eddort Mar 24, 2026
8e5957e
fix: format
eddort Mar 24, 2026
2a4ec11
fix: eslint
eddort Mar 24, 2026
c166bcd
feat: add separate role for disallow operator pair in consolidation m…
mkurayan Mar 24, 2026
9aeec82
Merge pull request #1736 from lidofinance/feat/staking-router-3.0-con…
mkurayan Mar 25, 2026
4b40fe6
feat: allows a submitter to disallow their own pair in consolidation …
mkurayan Mar 25, 2026
cbf7fd4
feat: add proxy for consolidation bus and migrator
mkurayan Mar 25, 2026
13cdcc9
feat: implement post-migration handling in OracleReportSanityChecker
eddort Mar 25, 2026
8c19f7e
refactor: remove deprecated operator balances reporting and update re…
eddort Mar 26, 2026
e796a24
Merge pull request #1744 from lidofinance/feat/staking-router-3.0-con…
mkurayan Mar 26, 2026
ec20d19
feat: enforce consistent modules fee
krogla Mar 26, 2026
13fa6e5
refactor: remove pending by module from accounting oracle report data…
eddort Mar 26, 2026
4dd7a14
fix: depositedForCurrentReport in getBalanceStats
krogla Mar 26, 2026
77345cd
test: fix migration state
krogla Mar 26, 2026
5c1faa4
Merge pull request #1748 from lidofinance/feat/srv3-force-consistent-…
krogla Mar 26, 2026
58501c8
chore: remove deprecated event
mkurayan Mar 16, 2026
1867c79
refactor: sr modules data validation flow
eddort Mar 27, 2026
5c72973
feat: wrap consolidation requests to struct
mkurayan Mar 27, 2026
6709b00
refactor: accounting tests
eddort Mar 27, 2026
ecd6b84
feat: remove migration role from sanity checker baseline bootstrap
eddort Mar 27, 2026
e93c694
Merge pull request #1751 from lidofinance/feat/srv3-module-data-valid…
eddort Mar 27, 2026
014e788
chore: remove todo
mkurayan Mar 27, 2026
69f47d7
Merge pull request #1729 from lidofinance/feat/srv3-deposit-tracker-o…
mkurayan Mar 27, 2026
e70aec6
Merge commit '69f47d79eb019f37b0361a4c24d34f1b19ef19a9' into feat/sta…
mkurayan Mar 27, 2026
b0c3278
Merge pull request #1752 from lidofinance/feat/staking-router-3.0-con…
mkurayan Mar 27, 2026
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
5 changes: 2 additions & 3 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ jobs:
coverage:
name: Hardhat / Unit Tests
runs-on: ubuntu-latest
env:
NODE_OPTIONS: --max_old_space_size=6400

permissions:
contents: write
Expand All @@ -24,7 +22,8 @@ jobs:
uses: ./.github/workflows/setup

- name: Collect coverage
run: yarn test:coverage
run: NODE_OPTIONS="--max-old-space-size=10240" yarn test:coverage
timeout-minutes: 30

- name: Produce the coverage report
uses: lidofinance/coverage-action@a94351baa279790f736655b1891178b1515594ea
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests-integration-hoodi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 120
env:
NODE_OPTIONS: --max_old_space_size=7200
NODE_OPTIONS: --max_old_space_size=10240
SKIP_GAS_REPORT: true
SKIP_CONTRACT_SIZE: true
SKIP_INTERFACES_CHECK: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests-integration-mainnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 120
env:
NODE_OPTIONS: --max_old_space_size=7200
NODE_OPTIONS: --max_old_space_size=10240
SKIP_GAS_REPORT: true
SKIP_CONTRACT_SIZE: true
SKIP_INTERFACES_CHECK: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests-unit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
uses: ./.github/workflows/setup

- name: Run unit tests
run: yarn test
run: NODE_OPTIONS="--max-old-space-size=10240" yarn test

test_foundry_fuzzing:
name: Foundry / Fuzzing & Invariants
Expand Down
736 changes: 491 additions & 245 deletions contracts/0.4.24/Lido.sol

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions contracts/0.4.24/template/LidoTemplate.sol
Original file line number Diff line number Diff line change
Expand Up @@ -614,8 +614,7 @@ contract LidoTemplate is IsContract {
perms[1] = _state.lido.RESUME_ROLE();
perms[2] = _state.lido.STAKING_PAUSE_ROLE();
perms[3] = _state.lido.STAKING_CONTROL_ROLE();
perms[4] = _state.lido.UNSAFE_CHANGE_DEPOSITED_VALIDATORS_ROLE();
for (i = 0; i < 5; ++i) {
for (i = 0; i < 4; ++i) {
_createPermissionForAgent(acl, _state.lido, perms[i], agent);
}
}
Expand Down
108 changes: 108 additions & 0 deletions contracts/0.8.25/CLValidatorVerifier.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
// SPDX-FileCopyrightText: 2025 Lido <[email protected]>
// SPDX-License-Identifier: GPL-3.0

pragma solidity 0.8.25;

import {GIndex, pack, concat} from "contracts/common/lib/GIndex.sol";
import {SSZ} from "contracts/common/lib/SSZ.sol";
import {BLS12_381} from "contracts/common/lib/BLS.sol";
import {BeaconRootData, ValidatorWitness} from "contracts/common/interfaces/ValidatorWitness.sol";

/**
* @title CLValidatorVerifier
* @author Lido
* @notice
*
* Smart contract verifying CL data of validators
*/
abstract contract CLValidatorVerifier {
// BeaconBlockHeader: state_root field gindex
uint8 private constant STATE_ROOT_DEPTH = 3;
uint256 private constant STATE_ROOT_POSITION = 3;
GIndex public immutable GI_STATE_ROOT = pack((1 << STATE_ROOT_DEPTH) + STATE_ROOT_POSITION, STATE_ROOT_DEPTH);

// Position (from the end) of parent(slot, proposerIndex) node inside concatenated proof
uint256 private constant SLOT_PROPOSER_PARENT_PROOF_OFFSET = 2;
// EIP-4788 system contract
address public constant BEACON_ROOTS = 0x000F3df6D732807Ef1319fB7B8bB8522d0Beac02;

// validators[0] gindex before/after fork layout change
GIndex public immutable GI_FIRST_VALIDATOR_PREV;
GIndex public immutable GI_FIRST_VALIDATOR_CURR;
uint64 public immutable PIVOT_SLOT;

error InvalidSlot();
error RootNotFound();

constructor(GIndex _gIFirstValidatorPrev, GIndex _gIFirstValidatorCurr, uint64 _pivotSlot) {
GI_FIRST_VALIDATOR_PREV = _gIFirstValidatorPrev;
GI_FIRST_VALIDATOR_CURR = _gIFirstValidatorCurr;
PIVOT_SLOT = _pivotSlot;
}

/// @notice Proves validator[i] under the same EIP-4788 anchor, checks WC, checks active status
function _verifyValidator(
BeaconRootData calldata _beaconRootData,
ValidatorWitness calldata _vw,
uint256 _validatorIndex,
bytes32 _expectedWithdrawalCredentials
) internal view virtual {
_verifySlot(_vw.proofValidator, _beaconRootData.slot, _beaconRootData.proposerIndex);

bytes32 parentBlockRoot = _getParentBlockRoot(_beaconRootData.childBlockTimestamp);

GIndex gIndexValidator = concat(GI_STATE_ROOT, _getValidatorGI(_validatorIndex, _beaconRootData.slot));
bytes32 validatorLeaf = _validatorHashTreeRoot(_vw, _expectedWithdrawalCredentials);
SSZ.verifyProof({proof: _vw.proofValidator, root: parentBlockRoot, leaf: validatorLeaf, gI: gIndexValidator});
}

/// @dev SSZ hash_tree_root(Validator) computed from witness fields.
function _validatorHashTreeRoot(ValidatorWitness calldata _w, bytes32 _expectedWithdrawalCredentials)
internal
view
returns (bytes32)
{
bytes32[8] memory leaves;
leaves[0] = BLS12_381.pubkeyRoot(_w.pubkey);
leaves[1] = _expectedWithdrawalCredentials;
leaves[2] = SSZ.toLittleEndian(_w.effectiveBalance);
leaves[3] = SSZ.toLittleEndian(_w.slashed ? uint64(1) : 0);
leaves[4] = SSZ.toLittleEndian(_w.activationEligibilityEpoch);
leaves[5] = SSZ.toLittleEndian(_w.activationEpoch);
leaves[6] = SSZ.toLittleEndian(_w.exitEpoch);
leaves[7] = SSZ.toLittleEndian(_w.withdrawableEpoch);

bytes32[4] memory l1;
l1[0] = BLS12_381.sha256Pair(leaves[0], leaves[1]);
l1[1] = BLS12_381.sha256Pair(leaves[2], leaves[3]);
l1[2] = BLS12_381.sha256Pair(leaves[4], leaves[5]);
l1[3] = BLS12_381.sha256Pair(leaves[6], leaves[7]);

bytes32[2] memory l2;
l2[0] = BLS12_381.sha256Pair(l1[0], l1[1]);
l2[1] = BLS12_381.sha256Pair(l1[2], l1[3]);

return BLS12_381.sha256Pair(l2[0], l2[1]);
}

/// @dev Checks that (slot, proposerIndex) parent node is present in the same concatenated proof.
function _verifySlot(bytes32[] calldata _proof, uint64 _slot, uint64 _proposerIndex) internal view {
bytes32 parentSlotProposer = BLS12_381.sha256Pair(SSZ.toLittleEndian(_slot), SSZ.toLittleEndian(_proposerIndex));
if (_proof[_proof.length - SLOT_PROPOSER_PARENT_PROOF_OFFSET] != parentSlotProposer) {
revert InvalidSlot();
}
}

/// @dev GIndex for Validator[i] given slot (fork-aware).
function _getValidatorGI(uint256 _offset, uint64 _provenSlot) internal view returns (GIndex) {
GIndex gI = _provenSlot < PIVOT_SLOT ? GI_FIRST_VALIDATOR_PREV : GI_FIRST_VALIDATOR_CURR;
return gI.shr(_offset);
}

/// @dev Reads parent_beacon_block_root from EIP-4788 by timestamp.
function _getParentBlockRoot(uint64 _childBlockTimestamp) internal view returns (bytes32) {
(bool success, bytes memory data) = BEACON_ROOTS.staticcall(abi.encode(_childBlockTimestamp));
if (!success || data.length == 0) revert RootNotFound();
return abi.decode(data, (bytes32));
}
}
Loading
Loading