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

fusaka light client: implement Ssz and Log EIPs to enable merkle proof generation and validation #3452

Closed
wants to merge 17 commits into from

Conversation

g11tech
Copy link
Contributor

@g11tech g11tech commented Jun 13, 2024

WIP

ref: - https://github.com/ethereum/EIPs/blob/master/EIPS/eip-6493.md

How to :

git clone the repo and checkout/pull the eip-6493 branch

in repo root run: npm i this will build all packages:

test ssz spec for the ssz wrappers
  1. cd packages/util
  2. (build the package if changed something from last build); npm run build
  3. run test spec: npx vitest run test/ssz.spec.ts
Fusaka light client
Work

doesn't include 7702 support, EL p2p still stays RLP which also implies that 6493 ssz txs out of scope. so for beacon payload, it shifts to the ssz stablecontainer format for txs, as well as the roots shift to ssz HTR

Note

  1. please note that a dummy hardfork eip6493 has been added for ease of development testing and devnet creation (on top of prague) so that will be cleaned up later when the work will become mergable
  2. some parts of the code will be cleaned up/optimized later

@g11tech g11tech changed the title common,util,tx: implement aip 6493 stable container txs common,util,tx: implement EIP-6493 stable container txs Jun 13, 2024
Copy link

codecov bot commented Jun 14, 2024

Codecov Report

Attention: Patch coverage is 33.73984% with 163 lines in your changes missing coverage. Please review.

Project coverage is 37.67%. Comparing base (4470cc3) to head (8821e70).
Report is 105 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

Flag Coverage Δ
block ?
blockchain 83.49% <ø> (?)
client ?
common 89.90% <100.00%> (?)
devp2p 0.00% <ø> (?)
evm 65.18% <100.00%> (?)
genesis 0.00% <ø> (?)
mpt 51.69% <ø> (?)
statemanager 67.41% <ø> (?)
tx ?
vm 55.18% <30.63%> (?)
wallet 0.00% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

@paulmillr
Copy link
Member

paulmillr commented Jun 21, 2024

FYI micro-eth-signer (https://github.com/paulmillr/micro-eth-signer) ssz implementation was like 8 times smaller the last time i've checked.

It's tree-shakeable, so you won't need to use the entire package.

@holgerd77
Copy link
Member

🤔

Atm this work here is conceptual only (so: not to be merged soon), but might be worth a try.

@wemeetagain
Copy link
Contributor

@paulmillr nice library, if you implement https://github.com/ethereum/EIPs/blob/master/EIPS/eip-7495.md there, then it can be used

@etan-status
Copy link

@paulmillr thanks, have added it to https://stabilitynow.box

@g11tech g11tech changed the title common,util,tx: implement EIP-6493 stable container txs common,util,tx,block,client: implement EIP-6493 stable container txs Jun 23, 2024
@g11tech g11tech force-pushed the eip-6493 branch 2 times, most recently from 86eb2fa to beffd4b Compare June 30, 2024 11:37
@g11tech g11tech force-pushed the eip-6493 branch 2 times, most recently from f314666 to 838f25d Compare September 23, 2024 16:05
@paulmillr
Copy link
Member

@wemeetagain @etan-status SSZ stable containers have been implemented in eth-signer v0.12.

@etan-status
Copy link

@wemeetagain @etan-status SSZ stable containers have been implemented in eth-signer v0.12.

Cool, have added the checkmark on https://stabilitynow.box – Thanks!!

@paulmillr
Copy link
Member

@etan-status doesn't seem like the site got updated? Also url to micro-eth-signer is wrong, instead of github it's some random website

@etan-status
Copy link

etan-status commented Sep 24, 2024

Yeah, I noticed that weird link as well and informed @philknows - something weird with that notion instance going on (the link is correct in the editor but points to this weird caching server that has wrong http headers once rendered)

@g11tech g11tech changed the title common,util,tx,block,client: implement EIP-6493 stable container txs fukasa light client: implement Ssz and Log EIPs to enable merkle proof generation and validation Sep 25, 2024
@philknows
Copy link

Yeah, I noticed that weird link as well and informed @philknows - something weird with that notion instance going on (the link is correct in the editor but points to this weird caching server that has wrong http headers once rendered)

This has been fixed now @paulmillr , thanks for bringing it to our attention!

@paulmillr
Copy link
Member

@g11tech to clarify, micro-eth-signer, which you're already using in monorepo, supports stable container ssz out-of-box, today. I will make some benchmarks, but even the code size is 5x+ smaller.

@g11tech
Copy link
Contributor Author

g11tech commented Oct 4, 2024

@g11tech to clarify, micro-eth-signer, which you're already using in monorepo, supports stable container ssz out-of-box, today. I will make some benchmarks, but even the code size is 5x+ smaller.

hey @paulmillr ! awesome!
although will look into the replacement a bit down the line :)

@g11tech g11tech changed the title fukasa light client: implement Ssz and Log EIPs to enable merkle proof generation and validation fusaka light client: implement Ssz and Log EIPs to enable merkle proof generation and validation Oct 4, 2024
@paulmillr
Copy link
Member

SSZ benchmarks have been added to eth-signer. chainsafe/ssz is faster, however, it is not correct, and fails consensus-spec-tests. E.g. ChainSafe/ssz#406

@g11tech
Copy link
Contributor Author

g11tech commented Oct 7, 2024

SSZ benchmarks have been added to eth-signer. chainsafe/ssz is faster, however, it is not correct, and fails consensus-spec-tests. E.g. ChainSafe/ssz#406

yes this is correct, for 64 bit uint, this type is supposed to be used: UintBn64 (so we choose accordingly)

@paulmillr
Copy link
Member

Update: chainsafe maintainer mentioned consensus-spec-tests are not supposed to pass with the implementation:

ChainSafe/ssz#406 (comment)

Yes, this UintNum64 type will not pass all consensus spec tests for the uint64 type

debug and fix the legacy ssz encoding decoding

add a spec test for legacy ssz encoding decoding

add the ssztx boilerplate to other tx types

implement sszRaw value for 2930 tx

add 2930 spec test and debug/fix ssz encoding/decoding

add the ssz encoding decoding to 1559 tx

add eip 1559 testcase and get it working

add 4844 ssz encoding decoding

add eip 4844 testcase and get it working

define block transactions ssz type and test ssz transactionsRoot

handle ssz roots for transactions and withdrawals in block when 6493 activated

handle the roots gen in the build block

fix the transaction stable container

update the execution payload serialization deserialization for 6493

add 6493 hardfork for the testing/devnet

refactor the transaction factory ssz tx deserialization

add ssz profile<>stablecontaiber conversion spec test

add eip6493 support to common

debug and fix the block transaction withdrawal root comparision by removing null keccak hash hardcoding

enhance eip6493 tx test by testing transaction factory deserialization which uses stable container

add client eip6493 end to end spec and fix the payload generation

refactor tx serialization deserializion with respect to execution/beacon payload

add, debug and fix the transactionv1 or hex transactions validator and debug/fix the newpayloadeip6493 spec test

add 6493 to electra for kurtosis testing

console log error for debugging

console log error for debugging

txpool fix attempt

add more descriptive checks for nulloroptional

add more descriptive checks for nulloroptional

log full error

debug and fix handling of replay vs legacy tx w.r.t. v/ypartity and confirm via spec test

build fix

dev and add transaction inclusion proof to the getTransactionX apis

workaround to get the proof since stable container impl for proof seems buggy and breaking

refactor the proof format based on feedback

debug, discuss and fix the signature packing scheme

add hack to schedule 6493 on prague in cli for stablecontainer devnets

debug and fix newpayload eip6493 spec

debug rebase and spec fixes in tx utils

debug and fix block build

fix the vm build

debug and get 6493 end to end client spec working

rebase 4844 fixes

add ssz blockheader type and update the blockhash to use when ssz activated

debug and update client spec with ssz blockhash

update ssz field to receiptstrie

updates after discussion with etan

update test
…and add log proofing capabilities by multiple filters
@g11tech
Copy link
Contributor Author

g11tech commented Oct 21, 2024

superseded by #3756 because of branch rename to more appropriate one

@g11tech g11tech closed this Oct 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants