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

Implement EIP-4844 #26283

Closed
wants to merge 283 commits into from
Closed
Show file tree
Hide file tree
Changes from 202 commits
Commits
Show all changes
283 commits
Select commit Hold shift + click to select a range
803f31e
core: don't reinject incomplete transactions on reorg
protolambda Feb 21, 2022
c971490
core/types: encode/decode the block with transactions the minimal way
protolambda Feb 22, 2022
d19e6ee
core: consider blobs count for intrinsic gas check
protolambda Feb 25, 2022
a922276
Merge pull request #3 from asn-d6/prune-gokzg
protolambda Feb 25, 2022
587a212
eth/catalyst: implement GetBlobsBundleV1 - EIP-4844 engine api extension
protolambda Mar 12, 2022
4b0c1cb
core/types: compute kzgs for blobs list
protolambda Mar 13, 2022
e9279d9
accounts,internal/ethapi: blob transaction api arguments
protolambda Mar 13, 2022
5fa43da
signer/core/apitypes: fix wrap-data NewTx option
protolambda Mar 13, 2022
e539920
core/types: fix marshal/unmarshal text Blob type, BLSFieldElement, KZ…
protolambda Mar 13, 2022
184ba49
Add functions to extract the crypto out of Blobs/KZGCommitment/BlobKzgs
asn-d6 Mar 1, 2022
6cd16f1
Use optimized VerifyBlobs() function
asn-d6 Mar 1, 2022
dafbb4d
Add unittest for VerifyBlobs() function
asn-d6 Mar 1, 2022
0c236b0
kzg: Rename CRS variables to match the EIP naming
asn-d6 Mar 1, 2022
9f6e026
kzg: Document kzg code further
asn-d6 Mar 1, 2022
5009206
core/types: clean up blob and commitment parse methods, use ptr recei…
protolambda Mar 15, 2022
f80048e
tests: blob test update, Parse blobs/commitments, fix mutation on copy
protolambda Mar 15, 2022
d48a83e
params,core/types: remove duplicate kzg version param
protolambda Mar 15, 2022
52abcb8
core/vm,crypto/kzg,tests: remove versioned-hash func from crypto, app…
protolambda Mar 15, 2022
6e4051e
tests: benchmark kzg funcs
protolambda Mar 15, 2022
db23602
crypto/kzg: batch verification for multiple txs
protolambda Mar 17, 2022
d3ab1dd
core/types: support blobs batch-verify of multiple txs
protolambda Mar 17, 2022
6f21779
core: refactor TxPool.add and .addTxsLocked to batch-verify txs
protolambda Mar 17, 2022
bfe1f35
Update LatestSignerForChainID() to return a danksigner by default
asn-d6 Mar 21, 2022
7512b91
Transaction inner size should be computed on-demand
asn-d6 Mar 21, 2022
f87c6d6
Include versioned hashes when creating a transaction using the JSON-R…
asn-d6 Mar 22, 2022
d6fb210
Merge pull request #5 from asn-d6/eip4844-tooling
protolambda Mar 22, 2022
0b1adb9
Merge branch 'master' into eip-4844
mdehoog Jun 3, 2022
36cbb54
Cleanup after merge
mdehoog Jun 3, 2022
b58bd6e
remove blob verification precompile in favor of point evaluation prec…
protolambda Jun 7, 2022
ff35a44
fix lint
protolambda Jun 7, 2022
6d4820c
Merge branch 'datablobs' into eip-4844
mdehoog Jun 7, 2022
d614a91
Fix missing copy of AccessList for EIP-4844 transactions
mdehoog Jun 12, 2022
372dbc7
Use SSZ instead of RLP
mdehoog Jun 12, 2022
7af28b5
Use minimal transaction format as block codec
Inphi Jun 12, 2022
13c3f67
Fix missing copy of AccessList for EIP-4844 transactions
mdehoog Jun 12, 2022
2ba73e3
fix blob tx gossip encoding in mempool
Inphi Jun 13, 2022
f15311b
Merge pull request #1 from Inphi/eip-4844-fix-blob-tx-enc
mdehoog Jun 13, 2022
177f16e
fix semantic merge conflict
Inphi Jun 13, 2022
87a4c33
Merge pull request #2 from Inphi/inphi/quickfix
mdehoog Jun 13, 2022
08cdb3a
ethapi: Fix gas esitmation for blob txs
Inphi Jun 14, 2022
42c8071
Merge pull request #3 from Inphi/eip-4844
mdehoog Jun 14, 2022
1430b67
Add BlobVersionedHashes to JSON-RPC Transaction result
Inphi Jun 15, 2022
49c0328
Merge pull request #4 from Inphi/eip-4844
mdehoog Jun 15, 2022
16e5bad
Enable Point Evaluation Precompile
dapperscene6 Jun 16, 2022
c190f29
Merge pull request #5 from dapperscene6/dapperscene6/enable-point-eva…
mdehoog Jun 16, 2022
f625430
Fix point evaluation
dapperscene6 Jun 16, 2022
35856fb
Merge pull request #6 from dapperscene6/dapperscene6/fix-point-evalua…
mdehoog Jun 16, 2022
e221824
Fix NetworkTransaction packet receive handling
Inphi Jun 21, 2022
576614f
Merge pull request #7 from Inphi/inphi/net-mempool
mdehoog Jun 23, 2022
d43042a
remove debug println (#8)
Inphi Jun 23, 2022
c76d2bd
Optimize Blob Transaction Validation (#9)
Inphi Jul 19, 2022
c5a0bd9
fix Blobs and KZG merklelization (#10)
Inphi Jul 21, 2022
c229ee8
Recompute aggregated proof for blobs bundle (#11)
Inphi Aug 3, 2022
769f148
add --eip4844 devnet flag (#12)
Inphi Aug 9, 2022
d704423
Update eip-4844 genesis
Inphi Aug 16, 2022
39d6ce1
merging eip4844 with latest geth master
roberto-bayardo Aug 18, 2022
219d446
Merge pull request #13 from roberto-bayardo/eip4844-rebase
roberto-bayardo Aug 18, 2022
1bc670f
turn of authenticated engine_ requests until we can rebase the beacon…
roberto-bayardo Aug 18, 2022
df336b7
crypto/kzg: Faster blob transaction verification (#14)
Inphi Aug 19, 2022
fce14ba
Efficient Fiat-Shamir challenges using hashing (#15)
Inphi Aug 25, 2022
e5291ef
fix potential index out of range bugs in opDataHash (#16)
roberto-bayardo Sep 8, 2022
d8e92d1
Fee Market Updates (#17)
Inphi Sep 19, 2022
c09fdfa
Merge in latest (v1.10.25) geth changes (#19)
roberto-bayardo Sep 20, 2022
d49f0be
Flexible BlobTx JSON codec
Inphi Sep 22, 2022
9e93167
Fix txpool.add
Inphi Sep 26, 2022
ede1eaa
Fix extBlockTx rlp decode
Inphi Sep 27, 2022
9ce143a
Make excess_blobs Header field optional
Inphi Sep 27, 2022
31021e5
Fix 4844 fork transition header bug
Inphi Sep 29, 2022
a1385c9
non-nil BlockGen.ExcessBlobs
Inphi Oct 3, 2022
f673a93
Enforce MAX_BLOBS_PER_BLOCK consensus rules
Inphi Oct 4, 2022
82cf924
add new maxFeePerDataGas field to blob tx message in preparation for …
roberto-bayardo Oct 6, 2022
773cfb2
change from excess blobs to excess data gas (#24)
roberto-bayardo Oct 6, 2022
a7f7378
add max-fee-per-data-gas to tx message (#25)
roberto-bayardo Oct 6, 2022
619c609
Fix excess_data_gas field in Execution Payload
Inphi Oct 7, 2022
28e8789
handle data gas / data gas fees appropriately (#26)
roberto-bayardo Oct 7, 2022
cda7293
Notes
dgcoffman Oct 7, 2022
8ba40cb
Plausibly working implementation
dgcoffman Oct 7, 2022
4aee8d8
Remove comments
dgcoffman Oct 7, 2022
cfdd6e7
Disable failing tests for now
mdehoog Oct 7, 2022
06a46d8
Clearer comments
dgcoffman Oct 7, 2022
b38efe1
- fix issue with not using proper parent block excess data gas by mak…
roberto-bayardo Oct 7, 2022
8b14002
Add MaxFeePerDataGas to transaction JSON
Inphi Oct 7, 2022
6297fa0
Merge branch 'eip-4844' into dgc/reverse-bit-ordering
mdehoog Oct 8, 2022
dc3740c
Restrict data gas prechecks to only txs with data
Inphi Oct 8, 2022
ca62042
addressing a few last nits around data gas (#31)
roberto-bayardo Oct 8, 2022
2da86b0
Merge branch 'eip-4844' into dgc/reverse-bit-ordering
mdehoog Oct 8, 2022
a53789d
Merge pull request #28 from mdehoog/dgc/reverse-bit-ordering
mdehoog Oct 8, 2022
0aa8f1d
Address nit in earlier PR (#33)
Inphi Oct 8, 2022
91322eb
Make tx/message data get accessed consistently through st.msg (#35)
roberto-bayardo Oct 13, 2022
0a53f99
fix panic issue when ExcessDataGas is nil (#37)
roberto-bayardo Oct 14, 2022
022f8f0
add test confirming transition from non-sharding to sharding works ev…
roberto-bayardo Oct 19, 2022
8397b86
remove dependency on forked go-kzg (#39)
roberto-bayardo Oct 25, 2022
8925aee
use EvaluatePolyInEvaluationForm from the latest go-kzg (#40)
roberto-bayardo Oct 25, 2022
4ace6f3
remove lingering dependency on the now removed go-kzg fork (#41)
roberto-bayardo Oct 29, 2022
60ce55a
Moving latest development work back into eip-4844 (#51)
roberto-bayardo Nov 16, 2022
381b51e
change kzg trusted setup to use values from consensus spec (#53)
roberto-bayardo Nov 17, 2022
a720ac1
fix bug in versioned hash checking (#52)
roberto-bayardo Nov 17, 2022
3ef8a4d
- return missing error
kevaundray Nov 17, 2022
c4dbf02
Merge pull request #54 from kevaundray/kw/hash-to-field
kevaundray Nov 18, 2022
6a58261
write polyDegree and number of polynomials to the buffer
kevaundray Nov 18, 2022
0bb217d
Merge pull request #55 from kevaundray/kw/fix-hash-to-bls-field
kevaundray Nov 18, 2022
fa6027f
remove now-unsed sszHash function (#56)
roberto-bayardo Nov 19, 2022
c60610c
Merge branch 'master' into eip-4844
roberto-bayardo Nov 20, 2022
9313891
clean up unused kzg stuff (#58)
roberto-bayardo Nov 21, 2022
dfddf51
Merge branch 'master' into merge-with-master
roberto-bayardo Nov 22, 2022
f1f7d86
update geth to use new go-kzg eth api (#59)
roberto-bayardo Nov 22, 2022
d75b06d
merge with latest eip-4844
roberto-bayardo Nov 22, 2022
389ad0a
set min data gas to 1 per latest spec, remove unused ssz hash related…
roberto-bayardo Nov 23, 2022
a35ae26
Merge branch 'eip-4844' into merge-with-master
roberto-bayardo Nov 23, 2022
b91cb5e
Merge branch 'master' into merge-with-master
roberto-bayardo Nov 23, 2022
fdeb627
remove check to see if there are no blobs
kevaundray Nov 23, 2022
c7541cd
Merge pull request #57 from mdehoog/merge-with-master
roberto-bayardo Nov 24, 2022
34980a3
revert changes to IntrinsicGas from earlier EIP-4844 work
roberto-bayardo Nov 26, 2022
d287418
make Transaction.Hash() invoke SSZ hash for blob txs
roberto-bayardo Nov 27, 2022
ef12c39
Merge pull request #63 from mdehoog/fix-hash
roberto-bayardo Nov 28, 2022
536fa4b
Merge pull request #62 from mdehoog/revert-intrinsic-gas
roberto-bayardo Nov 28, 2022
d4a5151
update header sanity check & storage size estimates to consider new f…
roberto-bayardo Nov 28, 2022
210ecb7
Merge pull request #64 from mdehoog/roberto-dev
roberto-bayardo Nov 28, 2022
b75e1a6
copy/pasta more of the Withdrawals PR
roberto-bayardo Nov 29, 2022
f9f2e60
Merge pull request #65 from mdehoog/roberto-dev
roberto-bayardo Nov 29, 2022
1bc36d6
update go-kzg to latest and affected precompile test case
roberto-bayardo Nov 30, 2022
786c595
Merge pull request #66 from mdehoog/update-kzg
roberto-bayardo Nov 30, 2022
54ff50e
remove unused kzg related utility
roberto-bayardo Nov 30, 2022
e4ed254
Merge pull request #61 from kevaundray/kw/specs-3093
kevaundray Nov 30, 2022
72f4850
initialize empty slices in blobs bundle
roberto-bayardo Dec 1, 2022
3b9c1aa
Merge pull request #67 from mdehoog/remove-kzg-cruft
roberto-bayardo Dec 1, 2022
d5563a1
Merge pull request #68 from mdehoog/roberto-dev
roberto-bayardo Dec 1, 2022
f2d8e79
Use Network transactions in les protocol (#69)
Inphi Dec 2, 2022
a9531e8
Fix les fuzzer test (#70)
Inphi Dec 2, 2022
01d1f49
Fix missing withdrawalsRoot in ethapi; set edg in gen (#71)
Inphi Dec 2, 2022
f7464d9
params: core: enable shanghai based on timestamps
MariusVanDerWijden Sep 27, 2022
6f6d871
params: nitpicks
MariusVanDerWijden Oct 31, 2022
dac0e11
make sharding a time-based fork
roberto-bayardo Dec 2, 2022
b2d6f07
Merge pull request #73 from mdehoog/time-based-forking
roberto-bayardo Dec 5, 2022
adac24d
Use V3 engine API methods for EIP-4844 (#74)
Inphi Dec 6, 2022
6fa30be
update 4844 parameters per latest spec
roberto-bayardo Dec 6, 2022
ff64102
Merge pull request #75 from mdehoog/roberto-dev
roberto-bayardo Dec 6, 2022
c4b56fd
Ensure withdrawals in payload is non-nil (#76)
Inphi Dec 7, 2022
7f341c6
Merge branch 'master' into eip-4844
roberto-bayardo Dec 8, 2022
af6ec7c
Merge pull request #78 from mdehoog/merge-with-master
roberto-bayardo Dec 8, 2022
2644d77
Merge branch 'master' into eip-4844
roberto-bayardo Dec 8, 2022
70bca5a
remove TODO to make this fork work with updated CL clients
roberto-bayardo Dec 8, 2022
b697b44
Merge pull request #79 from mdehoog/roberto-update
roberto-bayardo Dec 8, 2022
5ac5c8f
pull in more time based fork updates
roberto-bayardo Dec 12, 2022
c312131
Merge pull request #80 from mdehoog/fork2
roberto-bayardo Dec 13, 2022
b58bd9b
core/types: make fetchers fetch withdrawals without transactions
MariusVanDerWijden Dec 1, 2022
c75e2d8
internal/ethapi: add withdrawals to full block
MariusVanDerWijden Nov 22, 2022
ec55ffb
internal/ethapi: add comment
MariusVanDerWijden Dec 7, 2022
ce68688
core: set withdrawals hash in genesis
Inphi Dec 15, 2022
c29a6e1
Merge pull request #81 from Inphi/json-rpc
Inphi Dec 15, 2022
92cf4af
minor/cosmetic improvements to data gas handling in state transition
roberto-bayardo Dec 16, 2022
a915d56
Merge pull request #83 from mdehoog/cleanup
roberto-bayardo Dec 17, 2022
03149d7
fix wrong json field name for maxFeePerDataGas
roberto-bayardo Dec 21, 2022
cb237ac
Merge pull request #84 from mdehoog/typo
roberto-bayardo Dec 21, 2022
2bd3a3c
Fix out of data gas error in tracer (#85)
Inphi Dec 29, 2022
b4d3e40
Make blob id hash computation include the signature, and make both si…
roberto-bayardo Dec 29, 2022
ed01dbb
Merge pull request #87 from mdehoog/blob-tx-hash2
roberto-bayardo Jan 6, 2023
2b556db
add BlockValue to GetPayloadV2/V3 result (#88)
roberto-bayardo Jan 8, 2023
4c3a671
add gencodec directive for ExecutableDataV2 (#89)
roberto-bayardo Jan 10, 2023
ff85f65
Merge branch 'master' into eip-4844
roberto-bayardo Jan 12, 2023
eb84895
fix bug in txWrapDataMax value
roberto-bayardo Jan 13, 2023
4a0b0e1
fix bug in txWrapDataMax value (#90)
roberto-bayardo Jan 13, 2023
2e2980d
Merge pull request #82 from mdehoog/merge-master
roberto-bayardo Jan 16, 2023
ae5e685
check correct error message for rejected blob txs (#91)
roberto-bayardo Jan 19, 2023
d8a774b
require datagasfee to be bumped for tx replacement (#92)
roberto-bayardo Jan 19, 2023
db177b8
don't broadcast blob txs per eip-4844 (#77)
roberto-bayardo Jan 19, 2023
9db2778
Merge remote-tracking branch 'upstream/master' into eip-4844
roberto-bayardo Jan 20, 2023
2fb9c3c
merge with latest upstream
roberto-bayardo Jan 20, 2023
845a510
Merge pull request #93 from mdehoog/merge
roberto-bayardo Jan 20, 2023
cbd067e
make fakeExponential non-exported
roberto-bayardo Jan 26, 2023
3461d23
make sure excessDataGas is nil pre-sharding
roberto-bayardo Jan 26, 2023
20d3ce8
add todo for verifying excess data gas value
roberto-bayardo Jan 26, 2023
2ef8c3c
fix bug in json unmarshaling missing blob tx datagas field
roberto-bayardo Jan 27, 2023
5e5214d
Merge pull request #94 from mdehoog/json-bug
roberto-bayardo Jan 27, 2023
39ef7d7
Replaces go-kzg with gnark-kzg (#95)
kevaundray Feb 1, 2023
ad5a771
Fix Blob UnmarshalText (#96)
Inphi Feb 6, 2023
61e0fd7
Merge remote-tracking branch 'origin/master' into upstream-merge
Inphi Feb 6, 2023
5b3ce90
eip4844 api test w/ txs
Inphi Feb 7, 2023
a3253b1
access lists on blob txs should always be non-nil
Feb 7, 2023
367f3d9
make sure blob versioned hashes is always non-nil after blob tx deser…
roberto-bayardo Feb 7, 2023
38c1325
Remove old gen_blockparams
Inphi Feb 7, 2023
cbe4964
Merge pull request #97 from mdehoog/upstream-merge
Inphi Feb 7, 2023
d3ef900
Fix syntax errors in tests
Inphi Feb 7, 2023
83bc851
Merge pull request #99 from mdehoog/accesslist-fix
roberto-bayardo Feb 7, 2023
8444ecf
Merge pull request #100 from mdehoog/eip4844-tests
Inphi Feb 7, 2023
bdafa4d
cmd/evm: add excess data gas to t8n environment
marioevz Feb 7, 2023
ea15afa
cmd/evm: excess data gas fixes
marioevz Feb 7, 2023
2731415
Fix EIP-4844 Signer hash
Inphi Feb 8, 2023
6cc08ec
Merge pull request #98 from marioevz/eip-4844-fix-t8n
Inphi Feb 8, 2023
dc1f4a3
Merge pull request #101 from mdehoog/eip4844-tests
Inphi Feb 8, 2023
2a87ce6
Optional access list in BlobTx unmarshaling
Inphi Feb 8, 2023
3098528
Require blobVersionedHashes in tx MarshalJSON
Inphi Feb 9, 2023
3584bf7
Merge pull request #103 from mdehoog/opt-al2
Inphi Feb 9, 2023
972f739
Merge remote-tracking branch 'origin/master' into eip-4844-merge
Inphi Feb 16, 2023
5ee2738
Merge pull request #104 from mdehoog/eip-4844-merge
Inphi Feb 16, 2023
dd7fdaa
update crypto
kevaundray Mar 14, 2023
3f1ffee
remove kzg bench and tests -- This lives in crypto code now
kevaundray Mar 14, 2023
0e59877
update import: serialisation -> serialization
kevaundray Mar 14, 2023
052b8b9
update the previous functions
kevaundray Mar 14, 2023
602ad1f
fix typo -- aggregated proof -> proofs
kevaundray Mar 14, 2023
b64dfe5
Merge pull request #105 from kevaundray/kw/crypto-free-the-blobs
kevaundray Mar 14, 2023
81828d7
fix broken tests (#106)
roberto-bayardo Mar 15, 2023
6713fd5
Merge with latest upstream (#107)
roberto-bayardo Mar 17, 2023
82a204c
cmd/evm: fix ExcessDataGas marshalling in b11r
marioevz Feb 8, 2023
d4c557d
cmd/evm: add ExcessDataGas to execution result
marioevz Mar 22, 2023
029d8e7
Fix verification of blob txs
Inphi Mar 22, 2023
22f9817
Merge pull request #108 from mdehoog/inphi/fix-kzg-verify
terencechain Mar 22, 2023
becee4d
add kzg file -- This will now compute the ctx in an init method
kevaundray Mar 22, 2023
50010e3
modify files to use the new kzg file
kevaundray Mar 22, 2023
baefcc1
Merge branch 'eip-4844' into kw/add-kzg-file
kevaundray Mar 22, 2023
23b9a14
remove package rename since serialization is a distinct package from …
kevaundray Mar 22, 2023
f3a382f
Merge pull request #109 from kevaundray/kw/add-kzg-file
Inphi Mar 22, 2023
72fef7d
update to 22e22c6
kevaundray Mar 22, 2023
a6d0e1d
add type wrappers
kevaundray Mar 22, 2023
8569d91
Merge pull request #110 from kevaundray/kw/update-gnark
Inphi Mar 23, 2023
abf34ed
Lazy KZG crypto context initialization
Inphi Mar 23, 2023
ae66830
cmd/evm: fix t8n excess data calculation
marioevz Mar 24, 2023
4a2dd17
tests: add excessDataGas to header parser
marioevz Mar 24, 2023
b51448c
cmd/evm: fix
marioevz Mar 24, 2023
4607abe
Merge pull request #102 from marioevz/fix-b11r-excess-data-gas
Inphi Mar 24, 2023
f40a4bc
update gnark-kzg to `829bf64`
kevaundray Mar 25, 2023
a1dcfc8
Use exposed identity point in gnark-kzg instead of having it as a har…
kevaundray Mar 25, 2023
04c616f
Merge pull request #112 from kevaundray/kw/add-zero-constant
Inphi Mar 25, 2023
b6f59c2
Validate excess_data_gas value in block header
Inphi Mar 28, 2023
26975b6
Update consensus/misc/eip4844.go
Inphi Mar 28, 2023
37dc1f1
Merge pull request #113 from mdehoog/inphi/header-check-edg
Inphi Mar 28, 2023
5d6fa4f
Merge pull request #111 from mdehoog/inphi/init-kzg
Inphi Mar 28, 2023
48d9cea
tests: Add ShanghaiToShardingAtTime15k
marioevz Mar 29, 2023
9239edf
Update engine capabilities set
Inphi Mar 30, 2023
e864ddd
Merge pull request #114 from mdehoog/inphi/caps
Inphi Mar 30, 2023
fef4acf
Merge pull request #115 from marioevz/add-sharding-fork-transition-t8n
Inphi Apr 4, 2023
d0b90b3
update kzg lib to latest (#118)
roberto-bayardo Apr 17, 2023
ea43bc1
cmd/evm: change tx signer to latest (#116)
marioevz Apr 17, 2023
1782f74
Change Blob Transaction Type to 0x03
Inphi Apr 18, 2023
b72ce2e
Merge pull request #119 from mdehoog/inphi/tx-type
Inphi Apr 18, 2023
a05b83b
add UsedDataGas and DataGasPrice to the receipt (#117)
roberto-bayardo Apr 18, 2023
df61e91
txpool: Update blob tx wrap data size
Inphi Apr 21, 2023
1ea2f96
Merge pull request #120 from mdehoog/inphi/txpool-limit
Inphi Apr 21, 2023
15504a6
merge GetBlobsBundleV1 with GetPayloadV3 per spec update (#121)
roberto-bayardo Apr 21, 2023
47cf187
properly unify payload/blob returning in API, add proofs to blob bund…
roberto-bayardo Apr 21, 2023
16b76ac
engine: Update BlobsBundle fields
Inphi Apr 24, 2023
70807cd
Merge pull request #123 from mdehoog/kzg-to-commit
Inphi Apr 24, 2023
6f54b68
fix typo & remove unused constants in kzg package (#124)
roberto-bayardo Apr 24, 2023
0927b9c
Add blob length errors for engine api and transition tool.
spencer-tb Apr 25, 2023
674b2b1
Fix errors for engine api.
spencer-tb Apr 25, 2023
4bf5349
Trigger EIP-4844 on Cancun fork
Inphi Apr 25, 2023
7d7c642
Merge pull request #126 from mdehoog/cancun
Inphi Apr 25, 2023
04bc070
Update validation errors appropriately.
spencer-tb Apr 27, 2023
ac64c44
Merge pull request #125 from spencer-tb/len-blob-errors
Inphi May 3, 2023
853c366
remove unnecessary & uninitialized DataGasLimit from Message
roberto-bayardo May 8, 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
16 changes: 13 additions & 3 deletions accounts/abi/bind/backends/simulated.go
Original file line number Diff line number Diff line change
Expand Up @@ -645,11 +645,18 @@ func (b *SimulatedBackend) callContract(ctx context.Context, call ethereum.CallM
msg := callMsg{call}

txContext := core.NewEVMTxContext(msg)
evmContext := core.NewEVMBlockContext(block.Header(), b.blockchain, nil)

var excessDataGas *big.Int
// Get the last block header
ph := b.blockchain.GetHeaderByHash(block.ParentHash())
if ph != nil {
excessDataGas = ph.ExcessDataGas
}
evmContext := core.NewEVMBlockContext(block.Header(), excessDataGas, b.blockchain, nil)
// Create a new environment which holds all relevant information
// about the transaction and calling mechanisms.
vmEnv := vm.NewEVM(evmContext, txContext, stateDB, b.config, vm.Config{NoBaseFee: true})
gasPool := new(core.GasPool).AddGas(math.MaxUint64)
gasPool := new(core.GasPool).AddGas(math.MaxUint64).AddDataGas(params.MaxDataGasPerBlock)

return core.NewStateTransition(vmEnv, msg, gasPool).TransitionDb()
}
Expand All @@ -665,7 +672,7 @@ func (b *SimulatedBackend) SendTransaction(ctx context.Context, tx *types.Transa
return fmt.Errorf("could not fetch parent")
}
// Check transaction validity
signer := types.MakeSigner(b.blockchain.Config(), block.Number())
signer := types.MakeSigner(b.blockchain.Config(), block.Number(), block.Time())
sender, err := types.Sender(signer, tx)
if err != nil {
return fmt.Errorf("invalid transaction: %v", err)
Expand Down Expand Up @@ -827,10 +834,13 @@ func (m callMsg) To() *common.Address { return m.CallMsg.To }
func (m callMsg) GasPrice() *big.Int { return m.CallMsg.GasPrice }
func (m callMsg) GasFeeCap() *big.Int { return m.CallMsg.GasFeeCap }
func (m callMsg) GasTipCap() *big.Int { return m.CallMsg.GasTipCap }
func (m callMsg) DataGas() uint64 { return params.DataGasPerBlob * uint64(len(m.CallMsg.DataHashes)) }
func (m callMsg) MaxFeePerDataGas() *big.Int { return m.CallMsg.MaxFeePerDataGas }
func (m callMsg) Gas() uint64 { return m.CallMsg.Gas }
func (m callMsg) Value() *big.Int { return m.CallMsg.Value }
func (m callMsg) Data() []byte { return m.CallMsg.Data }
func (m callMsg) AccessList() types.AccessList { return m.CallMsg.AccessList }
func (m callMsg) DataHashes() []common.Hash { return m.CallMsg.DataHashes }

// filterBackend implements filters.Backend to support filtering for logs without
// taking bloom-bits acceleration structures into account.
Expand Down
12 changes: 12 additions & 0 deletions accounts/external/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,18 @@ func (api *ExternalSigner) SignTx(account accounts.Account, tx *types.Transactio
case types.DynamicFeeTxType:
args.MaxFeePerGas = (*hexutil.Big)(tx.GasFeeCap())
args.MaxPriorityFeePerGas = (*hexutil.Big)(tx.GasTipCap())
case types.BlobTxType:
hashes, _, blobs, aggProof := tx.BlobWrapData()
if len(hashes) != len(blobs) {
return nil, fmt.Errorf("missing blobs data, expected %d blobs", len(hashes))
}
var z types.KZGProof
if aggProof == z {
return nil, fmt.Errorf("missing aggregated proof in blobs")
}
args.MaxFeePerGas = (*hexutil.Big)(tx.GasFeeCap())
args.MaxPriorityFeePerGas = (*hexutil.Big)(tx.GasTipCap())
args.Blobs = blobs
default:
return nil, fmt.Errorf("unsupported tx type %d", tx.Type())
}
Expand Down
12 changes: 8 additions & 4 deletions cmd/devp2p/internal/ethtest/transaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ func sendSuccessfulTx(s *Suite, tx *types.Transaction, prevTx *types.Transaction
return fmt.Errorf("peering failed: %v", err)
}
// Send the transaction
if err = sendConn.Write(&Transactions{tx}); err != nil {
if err = sendConn.Write(&Transactions{types.NewNetworkTransaction(tx)}); err != nil {
return fmt.Errorf("failed to write to connection: %v", err)
}
// peer receiving connection to node
Expand All @@ -84,7 +84,7 @@ func sendSuccessfulTx(s *Suite, tx *types.Transaction, prevTx *types.Transaction
recTxs := *msg
// if you receive an old tx propagation, read from connection again
if len(recTxs) == 1 && prevTx != nil {
if recTxs[0] == prevTx {
if recTxs[0].Tx == prevTx {
continue
}
}
Expand Down Expand Up @@ -184,7 +184,7 @@ func sendMaliciousTx(s *Suite, tx *types.Transaction) error {
}

// write malicious tx
if err = conn.Write(&Transactions{tx}); err != nil {
if err = conn.Write(&Transactions{types.NewNetworkTransaction(tx)}); err != nil {
return fmt.Errorf("failed to write to connection: %v", err)
}
return nil
Expand All @@ -195,7 +195,11 @@ var nonce = uint64(99)
// sendMultipleSuccessfulTxs sends the given transactions to the node and
// expects the node to accept and propagate them.
func sendMultipleSuccessfulTxs(t *utesting.T, s *Suite, txs []*types.Transaction) error {
txMsg := Transactions(txs)
ntxs := make([]*types.NetworkTransaction, len(txs))
for i := range txs {
ntxs[i] = types.NewNetworkTransaction(txs[i])
}
txMsg := Transactions(ntxs)
t.Logf("sending %d txs\n", len(txs))

sendConn, recvConn, err := s.createSendAndRecvConns()
Expand Down
77 changes: 41 additions & 36 deletions cmd/evm/internal/t8ntool/block.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,22 +38,24 @@ import (

//go:generate go run github.com/fjl/gencodec -type header -field-override headerMarshaling -out gen_header.go
type header struct {
ParentHash common.Hash `json:"parentHash"`
OmmerHash *common.Hash `json:"sha3Uncles"`
Coinbase *common.Address `json:"miner"`
Root common.Hash `json:"stateRoot" gencodec:"required"`
TxHash *common.Hash `json:"transactionsRoot"`
ReceiptHash *common.Hash `json:"receiptsRoot"`
Bloom types.Bloom `json:"logsBloom"`
Difficulty *big.Int `json:"difficulty"`
Number *big.Int `json:"number" gencodec:"required"`
GasLimit uint64 `json:"gasLimit" gencodec:"required"`
GasUsed uint64 `json:"gasUsed"`
Time uint64 `json:"timestamp" gencodec:"required"`
Extra []byte `json:"extraData"`
MixDigest common.Hash `json:"mixHash"`
Nonce *types.BlockNonce `json:"nonce"`
BaseFee *big.Int `json:"baseFeePerGas" rlp:"optional"`
ParentHash common.Hash `json:"parentHash"`
OmmerHash *common.Hash `json:"sha3Uncles"`
Coinbase *common.Address `json:"miner"`
Root common.Hash `json:"stateRoot" gencodec:"required"`
TxHash *common.Hash `json:"transactionsRoot"`
ReceiptHash *common.Hash `json:"receiptsRoot"`
Bloom types.Bloom `json:"logsBloom"`
Difficulty *big.Int `json:"difficulty"`
Number *big.Int `json:"number" gencodec:"required"`
GasLimit uint64 `json:"gasLimit" gencodec:"required"`
GasUsed uint64 `json:"gasUsed"`
Time uint64 `json:"timestamp" gencodec:"required"`
Extra []byte `json:"extraData"`
MixDigest common.Hash `json:"mixHash"`
Nonce *types.BlockNonce `json:"nonce"`
BaseFee *big.Int `json:"baseFeePerGas" rlp:"optional"`
WithdrawalsHash *common.Hash `json:"withdrawalsRoot" rlp:"optional"`
ExcessDataGas *big.Int `json:"excessDataGas" rlp:"optional"`
}

type headerMarshaling struct {
Expand All @@ -67,10 +69,11 @@ type headerMarshaling struct {
}

type bbInput struct {
Header *header `json:"header,omitempty"`
OmmersRlp []string `json:"ommers,omitempty"`
TxRlp string `json:"txs,omitempty"`
Clique *cliqueInput `json:"clique,omitempty"`
Header *header `json:"header,omitempty"`
OmmersRlp []string `json:"ommers,omitempty"`
TxRlp string `json:"txs,omitempty"`
Withdrawals []*types.Withdrawal `json:"withdrawals,omitempty"`
Clique *cliqueInput `json:"clique,omitempty"`

Ethash bool `json:"-"`
EthashDir string `json:"-"`
Expand Down Expand Up @@ -114,21 +117,23 @@ func (c *cliqueInput) UnmarshalJSON(input []byte) error {
// ToBlock converts i into a *types.Block
func (i *bbInput) ToBlock() *types.Block {
header := &types.Header{
ParentHash: i.Header.ParentHash,
UncleHash: types.EmptyUncleHash,
Coinbase: common.Address{},
Root: i.Header.Root,
TxHash: types.EmptyRootHash,
ReceiptHash: types.EmptyRootHash,
Bloom: i.Header.Bloom,
Difficulty: common.Big0,
Number: i.Header.Number,
GasLimit: i.Header.GasLimit,
GasUsed: i.Header.GasUsed,
Time: i.Header.Time,
Extra: i.Header.Extra,
MixDigest: i.Header.MixDigest,
BaseFee: i.Header.BaseFee,
ParentHash: i.Header.ParentHash,
UncleHash: types.EmptyUncleHash,
Coinbase: common.Address{},
Root: i.Header.Root,
TxHash: types.EmptyRootHash,
ReceiptHash: types.EmptyRootHash,
Bloom: i.Header.Bloom,
Difficulty: common.Big0,
Number: i.Header.Number,
GasLimit: i.Header.GasLimit,
GasUsed: i.Header.GasUsed,
Time: i.Header.Time,
Extra: i.Header.Extra,
MixDigest: i.Header.MixDigest,
BaseFee: i.Header.BaseFee,
WithdrawalsHash: i.Header.WithdrawalsHash,
ExcessDataGas: i.Header.ExcessDataGas,
}

// Fill optional values.
Expand All @@ -153,7 +158,7 @@ func (i *bbInput) ToBlock() *types.Block {
if header.Difficulty != nil {
header.Difficulty = i.Header.Difficulty
}
return types.NewBlockWithHeader(header).WithBody(i.Txs, i.Ommers)
return types.NewBlockWithHeader(header).WithBody2(i.Txs, i.Ommers, i.Withdrawals)
}

// SealBlock seals the given block using the configured engine.
Expand Down
3 changes: 2 additions & 1 deletion cmd/evm/internal/t8ntool/execution.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ func (pre *Prestate) Apply(vmConfig vm.Config, chainConfig *params.ChainConfig,
}
var (
statedb = MakePreState(rawdb.NewMemoryDatabase(), pre.Pre)
signer = types.MakeSigner(chainConfig, new(big.Int).SetUint64(pre.Env.Number))
signer = types.MakeSigner(chainConfig, new(big.Int).SetUint64(pre.Env.Number), pre.Env.Timestamp)
gaspool = new(core.GasPool)
blockHash = common.Hash{0x13, 0x37}
rejectedTxs []*rejectedTx
Expand All @@ -132,6 +132,7 @@ func (pre *Prestate) Apply(vmConfig vm.Config, chainConfig *params.ChainConfig,
receipts = make(types.Receipts, 0)
txIndex = 0
)
// TODO(4844): Add DataGasLimit to prestate
gaspool.AddGas(pre.Env.GasLimit)
vmContext := vm.BlockContext{
CanTransfer: core.CanTransfer,
Expand Down
76 changes: 44 additions & 32 deletions cmd/evm/internal/t8ntool/gen_header.go

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

2 changes: 1 addition & 1 deletion cmd/evm/internal/t8ntool/transaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ func Transaction(ctx *cli.Context) error {
return NewError(ErrorIO, errors.New("only rlp supported"))
}
}
signer := types.MakeSigner(chainConfig, new(big.Int))
signer := types.MakeSigner(chainConfig, new(big.Int), 0)
// We now have the transactions in 'body', which is supposed to be an
// rlp list of transactions
it, err := rlp.NewListIterator([]byte(body))
Expand Down
2 changes: 1 addition & 1 deletion cmd/evm/internal/t8ntool/transition.go
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ func Transition(ctx *cli.Context) error {
}
}
// We may have to sign the transactions.
signer := types.MakeSigner(chainConfig, big.NewInt(int64(prestate.Env.Number)))
signer := types.MakeSigner(chainConfig, big.NewInt(int64(prestate.Env.Number)), prestate.Env.Timestamp)

if txs, err = signUnsignedTransactions(txsWithKeys, signer); err != nil {
return NewError(ErrorJson, fmt.Errorf("failed signing transactions: %v", err))
Expand Down
4 changes: 4 additions & 0 deletions cmd/geth/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,9 @@ func prepare(ctx *cli.Context) {
case ctx.IsSet(utils.SepoliaFlag.Name):
log.Info("Starting Geth on Sepolia testnet...")

case ctx.IsSet(utils.Eip4844Flag.Name):
log.Info("Starting Geth on EIP4844 testnet...")

case ctx.IsSet(utils.DeveloperFlag.Name):
log.Info("Starting Geth in ephemeral dev mode...")
log.Warn(`You are running Geth in --dev mode. Please note the following:
Expand Down Expand Up @@ -313,6 +316,7 @@ func prepare(ctx *cli.Context) {
!ctx.IsSet(utils.SepoliaFlag.Name) &&
!ctx.IsSet(utils.RinkebyFlag.Name) &&
!ctx.IsSet(utils.GoerliFlag.Name) &&
!ctx.IsSet(utils.Eip4844Flag.Name) &&
!ctx.IsSet(utils.DeveloperFlag.Name) {
// Nope, we're really on mainnet. Bump that cache up!
log.Info("Bumping default cache on mainnet", "provided", ctx.Int(utils.CacheFlag.Name), "updated", 4096)
Expand Down
Loading