Commit 8a4f66e
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 <[email protected]>
* Update packages/state-transition/src/cache/epochCache.ts
Co-authored-by: Lion - dapplion <[email protected]>
* Update packages/state-transition/src/cache/pubkeyCache.ts
Co-authored-by: Lion - dapplion <[email protected]>
* 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 <[email protected]>
* 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 <[email protected]>
* 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 <[email protected]>
* 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 <[email protected]>
Co-authored-by: gajinder <[email protected]>
lint and tsc
small cleanup1 parent ea43dc5 commit 8a4f66e
File tree
81 files changed
+2100
-213
lines changed- 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.
81 files changed
+2100
-213
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
927 | 927 | | |
928 | 928 | | |
929 | 929 | | |
| 930 | + | |
| 931 | + | |
| 932 | + | |
930 | 933 | | |
931 | 934 | | |
932 | 935 | | |
| |||
1015 | 1018 | | |
1016 | 1019 | | |
1017 | 1020 | | |
| 1021 | + | |
| 1022 | + | |
| 1023 | + | |
| 1024 | + | |
| 1025 | + | |
| 1026 | + | |
| 1027 | + | |
| 1028 | + | |
| 1029 | + | |
| 1030 | + | |
| 1031 | + | |
| 1032 | + | |
| 1033 | + | |
| 1034 | + | |
| 1035 | + | |
| 1036 | + | |
| 1037 | + | |
| 1038 | + | |
| 1039 | + | |
| 1040 | + | |
| 1041 | + | |
| 1042 | + | |
| 1043 | + | |
| 1044 | + | |
| 1045 | + | |
| 1046 | + | |
| 1047 | + | |
| 1048 | + | |
| 1049 | + | |
| 1050 | + | |
| 1051 | + | |
| 1052 | + | |
| 1053 | + | |
| 1054 | + | |
1018 | 1055 | | |
1019 | 1056 | | |
1020 | 1057 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
194 | 194 | | |
195 | 195 | | |
196 | 196 | | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
197 | 245 | | |
198 | 246 | | |
199 | 247 | | |
| |||
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
173 | 173 | | |
174 | 174 | | |
175 | 175 | | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
176 | 180 | | |
177 | 181 | | |
178 | 182 | | |
| |||
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
177 | 177 | | |
178 | 178 | | |
179 | 179 | | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
180 | 184 | | |
181 | 185 | | |
182 | 186 | | |
| |||
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
597 | 597 | | |
598 | 598 | | |
599 | 599 | | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
600 | 604 | | |
601 | 605 | | |
602 | 606 | | |
| |||
Lines changed: 5 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
| 37 | + | |
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| |||
128 | 128 | | |
129 | 129 | | |
130 | 130 | | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
131 | 135 | | |
132 | 136 | | |
133 | 137 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
| |||
70 | 71 | | |
71 | 72 | | |
72 | 73 | | |
| 74 | + | |
73 | 75 | | |
74 | 76 | | |
75 | 77 | | |
| |||
| 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