Commit 4e98a4a
feat: implement EIP-6110 (#6042)
* Add immutable in the dependencies
* Initial change to pubkeyCache
* Added todos
* Moved unfinalized cache to epochCache
* Move populating finalized cache to afterProcessEpoch
* Specify unfinalized cache during state cloning
* Move from unfinalized to finalized cache in afterProcessEpoch
* Confused myself
* Clean up
* Change logic
* Fix cloning issue
* Clean up redundant code
* Add CarryoverData in epochCtx.createFromState
* Fix typo
* Update usage of pubkeyCache
* Update pubkeyCache usage
* Fix lint
* Fix lint
* Add 6110 to ChainConfig
* Add 6110 to BeaconPreset
* Define 6110 fork and container
* Add V6110 api to execution engine
* Update test
* Add depositReceiptsRoot to process_execution_payload
* State transitioning to EIP6110
* State transitioning to EIP6110
* Light client change in EIP-6110
* Update tests
* produceBlock
* Refactor processDeposit to match the spec
* Implement processDepositReceipt
* Implement 6110 fork guard for pubkeyCache
* Handle changes in eth1 deposit
* Update eth1 deposit test
* Fix typo
* Lint
* Remove embarassing comments
* Address comments
* Modify applyDeposit signature
* Update packages/state-transition/src/cache/epochCache.ts
Co-authored-by: Lion - dapplion <35266934+dapplion@users.noreply.github.com>
* Update packages/state-transition/src/cache/epochCache.ts
Co-authored-by: Lion - dapplion <35266934+dapplion@users.noreply.github.com>
* Update packages/state-transition/src/cache/pubkeyCache.ts
Co-authored-by: Lion - dapplion <35266934+dapplion@users.noreply.github.com>
* Remove old code
* Rename fields in epochCache and immutableData
* Remove CarryoverData
* Move isAfter6110 from var to method
* Fix cyclic import
* Fix operations spec runner
* Fix for spec test
* Fix spec test
* state.depositReceiptsStartIndex to BigInt
* getDeposit requires cached state
* default depositReceiptsStartIndex value in genesis
* Fix pubkeyCache bug
* newUnfinalizedPubkeyIndexMap in createCachedBeaconState
* Lint
* Pass epochCache instead of pubkey2IndexFn in apis
* Address comments
* Add unit test on pubkey cache cloning
* Add unfinalizedPubkeyCacheSize to metrics
* Add unfinalizedPubkeyCacheSize to metrics
* Clean up code
* Add besu to el-interop
* Add 6110 genesis file
* Template for sim test
* Add unit test for getEth1DepositCount
* Update sim test
* Update besudocker
* Finish beacon api calls in sim test
* Update epochCache.createFromState()
* Fix bug unfinalized validators are not finalized
* Add sim test to run a few blocks
* Lint
* Merge branch 'unstable' into 611
* Add more check to sim test
* Update besu docker image instruction
* Update sim test with correct tx
* Address comment + cleanup
* Clean up code
* Properly handle promise rejection
* Lint
* Update packages/beacon-node/src/execution/engine/types.ts
Co-authored-by: Lion - dapplion <35266934+dapplion@users.noreply.github.com>
* Update comments
* Accept type undefined in ExecutionPayloadBodyRpc
* Update comment and semantic
* Remove if statement when adding finalized validator
* Comment on repeated insert on finalized cache
* rename createFromState
* Add comment on getPubkey()
* Stash change to reduce diffs
* Stash change to reduce diffs
* Lint
* addFinalizedPubkey on finalized checkpoint
* Update comment
* Use OrderedMap for unfinalized cache
* Pull out logic of deleting pubkeys for batch op
* Add updateUnfinalizedPubkeys in regen
* Update updateUnfinalizedPubkeys logic
* Add comment
* Add metrics for state context caches
* Address comment
* Address comment
* Deprecate eth1Data polling when condition is reached
* Fix conflicts
* Fix sim test
* Lint
* Fix type
* Fix test
* Fix test
* Lint
* Update packages/light-client/src/spec/utils.ts
Co-authored-by: Lion - dapplion <35266934+dapplion@users.noreply.github.com>
* Fix spec test
* Address comments
* Improve cache logic on checkpoint finalized
* Update sim test according to new cache logic
* Update comment
* Lint
* Finalized pubkey cache only update once per checkpoint
* Add perf test for updateUnfinalizedPubkeys
* Add perf test for updateUnfinalizedPubkeys
* Tweak params for perf test
* Freeze besu docker image version for 6110
* Add benchmark result
* Use Map instead of OrderedMap. Update benchmark
* Minor optimization
* Minor optimization
* Add memory test for immutable.js
* Update test
* Reduce code duplication
* Lint
* Remove try/catch in updateUnfinalizedPubkeys
* Introduce EpochCache metric
* Add historicalValidatorLengths
* Polish code
* Migrate state-transition unit tests to vitest
* Fix calculation of pivot index
* `historicalValidatorLengths` only activate post 6110
* Update sim test
* Lint
* Update packages/state-transition/src/cache/epochCache.ts
Co-authored-by: Lion - dapplion <35266934+dapplion@users.noreply.github.com>
* Improve readability on historicalValidatorLengths
* Update types
* Fix calculation
* Add eth1data poll todo
* Add epochCache.getValidatorCountAtEpoch
* Add todo
* Add getStateIterator for state cache
* Partial commit
* Update perf test
* updateUnfinalizedPubkeys directly modify states from regen
* Update sim test. Lint
* Add todo
* some improvements and a fix for effectiveBalanceIncrements fork safeness
* rename eip6110 to elctra
* fix electra-interop.test.ts
---------
Co-authored-by: Lion - dapplion <35266934+dapplion@users.noreply.github.com>
Co-authored-by: gajinder <develop@g11tech.io>1 parent 1e4afd9 commit 4e98a4a
81 files changed
Lines changed: 2096 additions & 213 deletions
File tree
- packages
- beacon-node
- src
- chain
- regen
- stateCache
- eth1
- utils
- execution/engine
- metrics/metrics
- test
- memory
- perf/chain
- opPools
- produceBlock
- stateCache
- scripts/el-interop
- besudocker
- besu
- sim
- spec
- presets
- utils
- unit
- chain
- lightclient
- opPools
- stateCache
- eth1/utils
- executionEngine
- network
- utils
- validationData
- config/src/chainConfig/configs
- light-client/src/spec
- params/src
- presets
- state-transition
- src
- block
- cache
- signatureSets
- slot
- util
- test/unit
- util
- types
- src
- allForks
- electra
- primitive
- validator/src/util
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
871 | 871 | | |
872 | 872 | | |
873 | 873 | | |
| 874 | + | |
| 875 | + | |
| 876 | + | |
874 | 877 | | |
875 | 878 | | |
876 | 879 | | |
| |||
959 | 962 | | |
960 | 963 | | |
961 | 964 | | |
| 965 | + | |
| 966 | + | |
| 967 | + | |
| 968 | + | |
| 969 | + | |
| 970 | + | |
| 971 | + | |
| 972 | + | |
| 973 | + | |
| 974 | + | |
| 975 | + | |
| 976 | + | |
| 977 | + | |
| 978 | + | |
| 979 | + | |
| 980 | + | |
| 981 | + | |
| 982 | + | |
| 983 | + | |
| 984 | + | |
| 985 | + | |
| 986 | + | |
| 987 | + | |
| 988 | + | |
| 989 | + | |
| 990 | + | |
| 991 | + | |
| 992 | + | |
| 993 | + | |
| 994 | + | |
| 995 | + | |
| 996 | + | |
| 997 | + | |
| 998 | + | |
962 | 999 | | |
963 | 1000 | | |
964 | 1001 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
125 | 125 | | |
126 | 126 | | |
127 | 127 | | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
128 | 176 | | |
129 | 177 | | |
130 | 178 | | |
| |||
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
172 | 172 | | |
173 | 173 | | |
174 | 174 | | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
175 | 179 | | |
176 | 180 | | |
177 | 181 | | |
| |||
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
587 | 587 | | |
588 | 588 | | |
589 | 589 | | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
590 | 594 | | |
591 | 595 | | |
592 | 596 | | |
| |||
Lines changed: 5 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
| 36 | + | |
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| |||
127 | 127 | | |
128 | 128 | | |
129 | 129 | | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
130 | 134 | | |
131 | 135 | | |
132 | 136 | | |
| |||
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
167 | 167 | | |
168 | 168 | | |
169 | 169 | | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
170 | 174 | | |
171 | 175 | | |
172 | 176 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
31 | 32 | | |
32 | 33 | | |
33 | 34 | | |
| |||
65 | 66 | | |
66 | 67 | | |
67 | 68 | | |
| 69 | + | |
68 | 70 | | |
69 | 71 | | |
70 | 72 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
4 | 9 | | |
5 | 10 | | |
6 | 11 | | |
| |||
67 | 72 | | |
68 | 73 | | |
69 | 74 | | |
| 75 | + | |
| 76 | + | |
70 | 77 | | |
71 | 78 | | |
72 | 79 | | |
| |||
81 | 88 | | |
82 | 89 | | |
83 | 90 | | |
| 91 | + | |
| 92 | + | |
84 | 93 | | |
85 | 94 | | |
86 | 95 | | |
| |||
109 | 118 | | |
110 | 119 | | |
111 | 120 | | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
112 | 126 | | |
113 | 127 | | |
114 | 128 | | |
115 | | - | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
116 | 137 | | |
117 | 138 | | |
118 | 139 | | |
| |||
141 | 162 | | |
142 | 163 | | |
143 | 164 | | |
144 | | - | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
145 | 169 | | |
146 | 170 | | |
147 | 171 | | |
| |||
162 | 186 | | |
163 | 187 | | |
164 | 188 | | |
165 | | - | |
| 189 | + | |
166 | 190 | | |
167 | 191 | | |
168 | 192 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
106 | 106 | | |
107 | 107 | | |
108 | 108 | | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
109 | 113 | | |
110 | 114 | | |
111 | 115 | | |
| |||
140 | 144 | | |
141 | 145 | | |
142 | 146 | | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
143 | 151 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
65 | 70 | | |
66 | 71 | | |
67 | 72 | | |
| |||
0 commit comments