Skip to content

Commit 2e7b3ed

Browse files
FletcherManMarvelFisherThegarammaxwolffNazariiDenha
authored
[FEATURE]Morphism geth implementation (#3)
* L2 consensus api auth api * scroll new version adjustment * Introduce L1Message type transaction test fix * add BLS Data add optional rlp tag * add docker-compose and modify entrypoint for dockerfile * Improve oversized block handling (#315) * improve oversized block handling * bump version * Archimedes hard fork: Disable sha2, ripemd, blake2f precompiles (#280) * add placeholder block * add test, more changes * revert aleth changes * typo * typo * precompile switch * change precomiles * rename placeholder to archimedes * fix comment * ScrollAlphaChainConfig * add nil for archimedes block for now * fix test typo * add isShanghai rule based on block number (#319) * add isShanghai rule based on block number * fix lint * nit --------- Co-authored-by: Péter Garamvölgyi <[email protected]> * core: implement EIP-3651, warm coinbase (#317) * core: implement EIP-3651, warm coinbase (#25819) Implements EIP-3651, "Warm Coinbase", for Shanghai hardfork. Specification: https://eips.ethereum.org/EIPS/eip-3651. * improve test * update to shanghai * trigger ci * fix comments --------- Co-authored-by: Marius van der Wijden <[email protected]> * chore(github): Add PR template to ask for rationale and version update (#327) Create pull_request_template.md * cherry-pick commits from ethereum for the further snapshot sync using beacon sync. including commits: c10a0a6 pr: ethereum/go-ethereum#23576 c893488 pr: ethereum/go-ethereum#24032 58d1988 pr: ethereum/go-ethereum#24047 6ce4670 pr: ethereum/go-ethereum#24276 8f66ea3 pr: ethereum/go-ethereum#23982 ...... * writeBlockWithState with head insertion directly * core/vm: implement EIP-3860: Limit and meter initcode (#23847) (#318) * core/vm: implement EIP-3860: Limit and meter initcode (#23847) Implementation of https://eips.ethereum.org/EIPS/eip-3860, limit and meter initcode. This PR enables EIP-3860 as part of the Shanghai fork. Co-authored-by: [email protected] <[email protected]> Co-authored-by: Martin Holst Swende <[email protected]> Co-authored-by: Marius van der Wijden <[email protected]> * add ishanghai * fix test * fix --------- Co-authored-by: Andrei Maiboroda <[email protected]> Co-authored-by: [email protected] <[email protected]> Co-authored-by: Martin Holst Swende <[email protected]> Co-authored-by: Marius van der Wijden <[email protected]> Co-authored-by: Péter Garamvölgyi <[email protected]> * Add Archimedes hard fork block number for Scroll Alpha (#331) * add Archimedes hard fork block number for Scroll Alpha * bump version * feat(trace): add storage proof about l1fee (baseFee, overhead, scalar) and withdraw root into trace (#314) * add proof for predeployed storages * reverse inneeded code * update for mainbranch merging * add coinbase storage as trace * comment for clarify * Update version.go --------- Co-authored-by: Péter Garamvölgyi <[email protected]> Co-authored-by: HAOYUatHZ <[email protected]> * feat: enable eip and update check (#335) * enable eip and update check * Update version.go --------- Co-authored-by: Péter Garamvölgyi <[email protected]> Co-authored-by: HAOYUatHZ <[email protected]> * fix(trace): deletion proof missed path terminated by empty node (#330) * fix deletion proof issue on empty node * refine for better implement and fix unittest * Update version.go --------- Co-authored-by: HAOYUatHZ <[email protected]> * fix(API): use `hexutil.Big` for `l1Fee` in `GetTransactionReceipt` (#336) * It's not a bug, but if just translate to hexutil.Big can be better. * Revert editor's auto change. * Update version. * Update version. * refactor(config): moved fee vault addr to rollup config (#341) * moved fee vault addr to rollup config * fixed linter issue * added back FeeVaultAddress --------- Co-authored-by: Péter Garamvölgyi <[email protected]> * feat(abigen): add `--contract` flag to specify a given contract (#334) * add contract flag * Use GlobalXX * Update cmd/abigen/main.go Co-authored-by: Péter Garamvölgyi <[email protected]> * Update cmd/abigen/main.go Co-authored-by: Péter Garamvölgyi <[email protected]> --------- Co-authored-by: Péter Garamvölgyi <[email protected]> Co-authored-by: HAOYUatHZ <[email protected]> * fix txs p2p && testnet scripts * Merge scroll tag v3.2.4 into morphism (#9) * feat(trace): add storage proof about l1fee (baseFee, overhead, scalar) and withdraw root into trace (#314) * add proof for predeployed storages * reverse inneeded code * update for mainbranch merging * add coinbase storage as trace * comment for clarify * Update version.go --------- Co-authored-by: Péter Garamvölgyi <[email protected]> Co-authored-by: HAOYUatHZ <[email protected]> * feat: enable eip and update check (#335) * enable eip and update check * Update version.go --------- Co-authored-by: Péter Garamvölgyi <[email protected]> Co-authored-by: HAOYUatHZ <[email protected]> * fix(trace): deletion proof missed path terminated by empty node (#330) * fix deletion proof issue on empty node * refine for better implement and fix unittest * Update version.go --------- Co-authored-by: HAOYUatHZ <[email protected]> * fix(API): use `hexutil.Big` for `l1Fee` in `GetTransactionReceipt` (#336) * It's not a bug, but if just translate to hexutil.Big can be better. * Revert editor's auto change. * Update version. * Update version. --------- Co-authored-by: Ho <[email protected]> Co-authored-by: Péter Garamvölgyi <[email protected]> Co-authored-by: HAOYUatHZ <[email protected]> Co-authored-by: Nazarii Denha <[email protected]> Co-authored-by: maskpp <[email protected]> * build(github): update github action yaml (#347) * build(github): update github action yaml * fix * optimize block validation * ci(github): update pull request template (#349) * chore(github): update pull request template * Update pull_request_template.md * Return error for disabled precompile calls (#337) return error for disabled precompile calls * feat: delay Archimedes on Alpha by a week (#342) * delay Archimedes on Alpha by a week * bump version --------- Co-authored-by: HAOYUatHZ <[email protected]> * Fix transaction DA cost under-estimation (#332) * fix tx DA cost under-estimation * bump version --------- Co-authored-by: HAOYUatHZ <[email protected]> * feat(block_validator): check payload size during block validation (#322) * added block size check in validate body * added payload method to block * Update core/types/block.go Co-authored-by: Péter Garamvölgyi <[email protected]> * fixed test * fix * bump version * fix test --------- Co-authored-by: Péter Garamvölgyi <[email protected]> Co-authored-by: Péter Garamvölgyi <[email protected]> * test(zkTrie): add deletion test in account update unit test (#344) feat(zkTrie): extend account update unit tests with account deletion * Merge commits under tag of scroll-v3.3.0 from scroll-tech (#10) * feat(trace): add storage proof about l1fee (baseFee, overhead, scalar) and withdraw root into trace (#314) * add proof for predeployed storages * reverse inneeded code * update for mainbranch merging * add coinbase storage as trace * comment for clarify * Update version.go --------- Co-authored-by: Péter Garamvölgyi <[email protected]> Co-authored-by: HAOYUatHZ <[email protected]> * feat: enable eip and update check (#335) * enable eip and update check * Update version.go --------- Co-authored-by: Péter Garamvölgyi <[email protected]> Co-authored-by: HAOYUatHZ <[email protected]> * fix(trace): deletion proof missed path terminated by empty node (#330) * fix deletion proof issue on empty node * refine for better implement and fix unittest * Update version.go --------- Co-authored-by: HAOYUatHZ <[email protected]> * fix(API): use `hexutil.Big` for `l1Fee` in `GetTransactionReceipt` (#336) * It's not a bug, but if just translate to hexutil.Big can be better. * Revert editor's auto change. * Update version. * Update version. * refactor(config): moved fee vault addr to rollup config (#341) * moved fee vault addr to rollup config * fixed linter issue * added back FeeVaultAddress --------- Co-authored-by: Péter Garamvölgyi <[email protected]> * feat(abigen): add `--contract` flag to specify a given contract (#334) * add contract flag * Use GlobalXX * Update cmd/abigen/main.go Co-authored-by: Péter Garamvölgyi <[email protected]> * Update cmd/abigen/main.go Co-authored-by: Péter Garamvölgyi <[email protected]> --------- Co-authored-by: Péter Garamvölgyi <[email protected]> Co-authored-by: HAOYUatHZ <[email protected]> * build(github): update github action yaml (#347) * build(github): update github action yaml * fix * ci(github): update pull request template (#349) * chore(github): update pull request template * Update pull_request_template.md * Return error for disabled precompile calls (#337) return error for disabled precompile calls --------- Co-authored-by: Ho <[email protected]> Co-authored-by: Péter Garamvölgyi <[email protected]> Co-authored-by: HAOYUatHZ <[email protected]> Co-authored-by: Nazarii Denha <[email protected]> Co-authored-by: maskpp <[email protected]> Co-authored-by: Richord <[email protected]> * fix: add missing term when merging two deletion proofs (#353) * fix: merge emptyTermPaths * bump version --------- Co-authored-by: Péter Garamvölgyi <[email protected]> * update docker image name * fix(ethclient): support WithdrawalsHash in Scroll Go SDK (#354) * added withdrawalsHash to header * bump version --------- Co-authored-by: Péter Garamvölgyi <[email protected]> * update docker-compose * fix(tracing): fix ZktrieTracer race condition (#356) * fix race condition of zktrie tracer * Update version.go --------- Co-authored-by: HAOYUatHZ <[email protected]> * feat: Sync and relay L1 messages (#350) * add l1 config in genesis config (#249) * add l1 config in genesis config * fix lint * Update params/config.go Co-authored-by: Péter Garamvölgyi <[email protected]> --------- Co-authored-by: Péter Garamvölgyi <[email protected]> * extend node configuration (#251) * extend node configuration * use block number instead of hash * accept safe, finalized and numbers for L1Confirmations * fix typos --------- Co-authored-by: Péter Garamvölgyi <[email protected]> Co-authored-by: Péter Garamvölgyi <[email protected]> * Fix/improve node config parsing (#260) * raise error on failed parsing * default value * add l1-message-type, transaction methods (#252) * add l1-message-type, transaction methods * goimports * Update core/types/transaction.go Co-authored-by: Péter Garamvölgyi <[email protected]> * txpool l1 check, pointer change, marhsal test * draft: start implementing l1message gas behavior * draft: start implementing l1message gas behavior * change to gas usage * error comment typo Co-authored-by: Haichen Shen <[email protected]> * goimports * update nonce, add hash test (fails), marshal test * goimports * target addr cant be nil * change call msg * comment out test * lint --------- Co-authored-by: Péter Garamvölgyi <[email protected]> Co-authored-by: Haichen Shen <[email protected]> * Add L1 message database (#255) * add l1-message-type, transaction methods * goimports * Update core/types/transaction.go Co-authored-by: Péter Garamvölgyi <[email protected]> * add L1 message store to rawdb * remove comments * rename to l1_message * rename variables and add comments * write l1 msgs in a batch * add more comments * update tests * allow batched and non-batched writes * rename to accessors_l1_message * handle error * add range check * fix tests * update comments * nit * support blocks with 0 l1 messages --------- Co-authored-by: Max Wolff <[email protected]> Co-authored-by: Max Wolff <[email protected]> * Fix L1Message Deep Copy, Complete Bridge Tx Hash test (#269) * deep copy value field, add tx hash test comment * typo * Rename nonce to queueindex, increment sender nonce on L1 message execution (#271) * change nonce to queueindex, increment nonce on L1 message * fix db acccessors * Update core/types/transaction_marshalling.go Co-authored-by: Péter Garamvölgyi <[email protected]> --------- Co-authored-by: Péter Garamvölgyi <[email protected]> * Fix db inspect command (#276) fix db inspect command * Add l1 sync service (#256) * extend node configuration * add l1-message-type, transaction methods * goimports * Update core/types/transaction.go Co-authored-by: Péter Garamvölgyi <[email protected]> * use block number instead of hash * accept safe, finalized and numbers for L1Confirmations * add L1 message store to rawdb * remove comments * fix typos * add L1 message sync service * use l1 contract address and chain ID * use L1DeploymentBlock * add confirmation config * move bridge client to separate file * use uint64 block number * fix bigint comparison * rename constants * add more logs * rename to l1_message * rename variables and add comments * write l1 msgs in a batch * add more comments * update tests * allow batched and non-batched writes * rename to accessors_l1_message * handle error * check if config is provided * improve sync service DB batched writes * add range check * fix tests * update comments * nit * fix flush range and improve comments * solve circular dependency * update stress tests * initialize l1 client for geth * start sync service * add more comments * check nil correctly * address comments * fix merge * fix genesis l1config deserialization * add sync progress logs * initial sync * handle leveldb not found error * use errors.Is * address comments * update DefaultPollInterval --------- Co-authored-by: Nazarii Denha <[email protected]> Co-authored-by: Max Wolff <[email protected]> Co-authored-by: Max Wolff <[email protected]> * Add L1 message validation (#272) * add L1 message validation * add comments and better error handling * handle leveldb not found error * update incorrect condition for genesis block * typo * change inclusion index logic * disable L1 message check for legacy tests * set NumL1MessagesPerBlock to 0 in tests * update default genesis config * Add L1 msg validation tests (#303) add L1 msg validation tests * Update miner include l1 messages (#265) * add l1-message-type, transaction methods * goimports * Update core/types/transaction.go Co-authored-by: Péter Garamvölgyi <[email protected]> * add L1 message store to rawdb * add L1 message sync service * remove comments * use l1 contract address and chain ID * extend node configuration * use block number instead of hash * accept safe, finalized and numbers for L1Confirmations * fix typos * use L1DeploymentBlock * add confirmation config * move bridge client to separate file * use uint64 block number * fix bigint comparison * rename constants * add more logs * Fix/improve node config parsing (#260) * raise error on failed parsing * default value * rename to l1_message * rename variables and add comments * write l1 msgs in a batch * add more comments * update tests * allow batched and non-batched writes * rename to accessors_l1_message * handle error * check if config is provided * improve sync service DB batched writes * include l1 messages in blocks: part 1 * add l1-message-type, transaction methods (#252) * add l1-message-type, transaction methods * goimports * Update core/types/transaction.go Co-authored-by: Péter Garamvölgyi <[email protected]> * txpool l1 check, pointer change, marhsal test * draft: start implementing l1message gas behavior * draft: start implementing l1message gas behavior * change to gas usage * error comment typo Co-authored-by: Haichen Shen <[email protected]> * goimports * update nonce, add hash test (fails), marshal test * goimports * target addr cant be nil * change call msg * comment out test * lint --------- Co-authored-by: Péter Garamvölgyi <[email protected]> Co-authored-by: Haichen Shen <[email protected]> * Add L1 message database (#255) * add l1-message-type, transaction methods * goimports * Update core/types/transaction.go Co-authored-by: Péter Garamvölgyi <[email protected]> * add L1 message store to rawdb * remove comments * rename to l1_message * rename variables and add comments * write l1 msgs in a batch * add more comments * update tests * allow batched and non-batched writes * rename to accessors_l1_message * handle error * add range check * fix tests * update comments * nit * support blocks with 0 l1 messages --------- Co-authored-by: Max Wolff <[email protected]> Co-authored-by: Max Wolff <[email protected]> * build(docker): auto docker push when pushing git tags (#258) * build(docker): update docker trigger tag prefix (#259) * Fix L1Message Deep Copy, Complete Bridge Tx Hash test (#269) * deep copy value field, add tx hash test comment * typo * commitl1messages * lint * Revert "add L1 message sync service" This reverts commit 5305e8a5de14766ed249e1a7d64042c7a72cf5c2. * Revert "move bridge client to separate file" This reverts commit 0b220bee37de93c3250545e23430db2c401a2f90. * update branch * use commitMessages for l1Txs * little fix * fix config * fix test * comment fixes * fix * fix config check --------- Co-authored-by: Max Wolff <[email protected]> Co-authored-by: Max Wolff <[email protected]> Co-authored-by: Péter Garamvölgyi <[email protected]> Co-authored-by: Péter Garamvölgyi <[email protected]> Co-authored-by: Haichen Shen <[email protected]> Co-authored-by: HAOYUatHZ <[email protected]> * Add ErrUnknownAncestor tests (#305) add ErrUnknownAncestor tests * worker test include l1 msgs (#306) * worker test include l1 msgs * move L1 message index update next to block insertion --------- Co-authored-by: Péter Garamvölgyi <[email protected]> * exclude l1 messages from transaction count limit in block (#307) * exclude l1 messages from transaction count limit in block * fix comments * trigger ci * nit --------- Co-authored-by: Péter Garamvölgyi <[email protected]> Co-authored-by: Péter Garamvölgyi <[email protected]> * Expose queueIndex on Transaction (#316) expose queueIndex on Transaction * test that l1msg doesn't count in maxTxPerBlock limit (#312) * test that l1msg doesn't count in maxTxPerBlock limit * fix, comment * retrigger ci * change order inside test --------- Co-authored-by: HAOYUatHZ <[email protected]> Co-authored-by: Péter Garamvölgyi <[email protected]> * reuse trace nonce field for queueIndex * expose scroll APIs on the geth console * add L1 message query APIs * Trigger new block on new l1 messages (#343) * trigger new block on new l1 messages * typo * initialize l1MsgCh * fix worker l1msg tests (#345) --------- Co-authored-by: Nazarii Denha <[email protected]> * test(worker): ensure that l1 messages are included in the correct order (#346) test that l1msgs added in correct order * rename enqueueIndex --> queueIndex * move QueueIndex into transaction * improve l1 db interface * formatting * bump version * print l1config * add API to query latest included message queue index * clean up tx limit logic * add clarifying comments and todos to ValidateL1Messages * improve db comments and logs * clean up L1MessageTx type handling * format * format * improve L1 message block check * fix missing L1 event handling * fix TestL1MessageValidationFailure * simplify sync height resume logic * make l1Config.l1MessageQueueAddress non-pointer * improve command line flags * remove todo * use abigen tools for log filtering * cache block L1 message count * nit: fix variable name case * improve logs * flush pending writes to DB before shutdown --------- Co-authored-by: Nazarii Denha <[email protected]> Co-authored-by: Max Wolff <[email protected]> Co-authored-by: Haichen Shen <[email protected]> Co-authored-by: Max Wolff <[email protected]> Co-authored-by: HAOYUatHZ <[email protected]> Co-authored-by: HAOYUatHZ <[email protected]> * enable empty block * add feeVaultAddress into default genesis * update entrypoint and docker-compose conf for devops * update entrypoint and docker-compose conf for devops (#12) * add hash * fix * fix(trace): change l1Fee type from uint64 to *big.Int (#360) * fix: change l1Fee type from uint64 to *big.Int * use hexutil.Big * Integrate with the commits under tag scroll v4.1.0 * feat(trace): add storage proof about l1fee (baseFee, overhead, scalar) and withdraw root into trace (#314) * add proof for predeployed storages * reverse inneeded code * update for mainbranch merging * add coinbase storage as trace * comment for clarify * Update version.go --------- Co-authored-by: Péter Garamvölgyi <[email protected]> Co-authored-by: HAOYUatHZ <[email protected]> * feat: enable eip and update check (#335) * enable eip and update check * Update version.go --------- Co-authored-by: Péter Garamvölgyi <[email protected]> Co-authored-by: HAOYUatHZ <[email protected]> * fix(trace): deletion proof missed path terminated by empty node (#330) * fix deletion proof issue on empty node * refine for better implement and fix unittest * Update version.go --------- Co-authored-by: HAOYUatHZ <[email protected]> * fix(API): use `hexutil.Big` for `l1Fee` in `GetTransactionReceipt` (#336) * It's not a bug, but if just translate to hexutil.Big can be better. * Revert editor's auto change. * Update version. * Update version. * refactor(config): moved fee vault addr to rollup config (#341) * moved fee vault addr to rollup config * fixed linter issue * added back FeeVaultAddress --------- Co-authored-by: Péter Garamvölgyi <[email protected]> * feat(abigen): add `--contract` flag to specify a given contract (#334) * add contract flag * Use GlobalXX * Update cmd/abigen/main.go Co-authored-by: Péter Garamvölgyi <[email protected]> * Update cmd/abigen/main.go Co-authored-by: Péter Garamvölgyi <[email protected]> --------- Co-authored-by: Péter Garamvölgyi <[email protected]> Co-authored-by: HAOYUatHZ <[email protected]> * build(github): update github action yaml (#347) * build(github): update github action yaml * fix * ci(github): update pull request template (#349) * chore(github): update pull request template * Update pull_request_template.md * Return error for disabled precompile calls (#337) return error for disabled precompile calls * feat: delay Archimedes on Alpha by a week (#342) * delay Archimedes on Alpha by a week * bump version --------- Co-authored-by: HAOYUatHZ <[email protected]> * Fix transaction DA cost under-estimation (#332) * fix tx DA cost under-estimation * bump version --------- Co-authored-by: HAOYUatHZ <[email protected]> * feat(block_validator): check payload size during block validation (#322) * added block size check in validate body * added payload method to block * Update core/types/block.go Co-authored-by: Péter Garamvölgyi <[email protected]> * fixed test * fix * bump version * fix test --------- Co-authored-by: Péter Garamvölgyi <[email protected]> Co-authored-by: Péter Garamvölgyi <[email protected]> * test(zkTrie): add deletion test in account update unit test (#344) feat(zkTrie): extend account update unit tests with account deletion * fix: add missing term when merging two deletion proofs (#353) * fix: merge emptyTermPaths * bump version --------- Co-authored-by: Péter Garamvölgyi <[email protected]> * fix(ethclient): support WithdrawalsHash in Scroll Go SDK (#354) * added withdrawalsHash to header * bump version --------- Co-authored-by: Péter Garamvölgyi <[email protected]> * fix(tracing): fix ZktrieTracer race condition (#356) * fix race condition of zktrie tracer * Update version.go --------- Co-authored-by: HAOYUatHZ <[email protected]> * feat: Sync and relay L1 messages (#350) * add l1 config in genesis config (#249) * add l1 config in genesis config * fix lint * Update params/config.go Co-authored-by: Péter Garamvölgyi <[email protected]> --------- Co-authored-by: Péter Garamvölgyi <[email protected]> * extend node configuration (#251) * extend node configuration * use block number instead of hash * accept safe, finalized and numbers for L1Confirmations * fix typos --------- Co-authored-by: Péter Garamvölgyi <[email protected]> Co-authored-by: Péter Garamvölgyi <[email protected]> * Fix/improve node config parsing (#260) * raise error on failed parsing * default value * add l1-message-type, transaction methods (#252) * add l1-message-type, transaction methods * goimports * Update core/types/transaction.go Co-authored-by: Péter Garamvölgyi <[email protected]> * txpool l1 check, pointer change, marhsal test * draft: start implementing l1message gas behavior * draft: start implementing l1message gas behavior * change to gas usage * error comment typo Co-authored-by: Haichen Shen <[email protected]> * goimports * update nonce, add hash test (fails), marshal test * goimports * target addr cant be nil * change call msg * comment out test * lint --------- Co-authored-by: Péter Garamvölgyi <[email protected]> Co-authored-by: Haichen Shen <[email protected]> * Add L1 message database (#255) * add l1-message-type, transaction methods * goimports * Update core/types/transaction.go Co-authored-by: Péter Garamvölgyi <[email protected]> * add L1 message store to rawdb * remove comments * rename to l1_message * rename variables and add comments * write l1 msgs in a batch * add more comments * update tests * allow batched and non-batched writes * rename to accessors_l1_message * handle error * add range check * fix tests * update comments * nit * support blocks with 0 l1 messages --------- Co-authored-by: Max Wolff <[email protected]> Co-authored-by: Max Wolff <[email protected]> * Fix L1Message Deep Copy, Complete Bridge Tx Hash test (#269) * deep copy value field, add tx hash test comment * typo * Rename nonce to queueindex, increment sender nonce on L1 message execution (#271) * change nonce to queueindex, increment nonce on L1 message * fix db acccessors * Update core/types/transaction_marshalling.go Co-authored-by: Péter Garamvölgyi <[email protected]> --------- Co-authored-by: Péter Garamvölgyi <[email protected]> * Fix db inspect command (#276) fix db inspect command * Add l1 sync service (#256) * extend node configuration * add l1-message-type, transaction methods * goimports * Update core/types/transaction.go Co-authored-by: Péter Garamvölgyi <[email protected]> * use block number instead of hash * accept safe, finalized and numbers for L1Confirmations * add L1 message store to rawdb * remove comments * fix typos * add L1 message sync service * use l1 contract address and chain ID * use L1DeploymentBlock * add confirmation config * move bridge client to separate file * use uint64 block number * fix bigint comparison * rename constants * add more logs * rename to l1_message * rename variables and add comments * write l1 msgs in a batch * add more comments * update tests * allow batched and non-batched writes * rename to accessors_l1_message * handle error * check if config is provided * improve sync service DB batched writes * add range check * fix tests * update comments * nit * fix flush range and improve comments * solve circular dependency * update stress tests * initialize l1 client for geth * start sync service * add more comments * check nil correctly * address comments * fix merge * fix genesis l1config deserialization * add sync progress logs * initial sync * handle leveldb not found error * use errors.Is * address comments * update DefaultPollInterval --------- Co-authored-by: Nazarii Denha <[email protected]> Co-authored-by: Max Wolff <[email protected]> Co-authored-by: Max Wolff <[email protected]> * Add L1 message validation (#272) * add L1 message validation * add comments and better error handling * handle leveldb not found error * update incorrect condition for genesis block * typo * change inclusion index logic * disable L1 message check for legacy tests * set NumL1MessagesPerBlock to 0 in tests * update default genesis config * Add L1 msg validation tests (#303) add L1 msg validation tests * Update miner include l1 messages (#265) * add l1-message-type, transaction methods * goimports * Update core/types/transaction.go Co-authored-by: Péter Garamvölgyi <[email protected]> * add L1 message store to rawdb * add L1 message sync service * remove comments * use l1 contract address and chain ID * extend node configuration * use block number instead of hash * accept safe, finalized and numbers for L1Confirmations * fix typos * use L1DeploymentBlock * add confirmation config * move bridge client to separate file * use uint64 block number * fix bigint comparison * rename constants * add more logs * Fix/improve node config parsing (#260) * raise error on failed parsing * default value * rename to l1_message * rename variables and add comments * write l1 msgs in a batch * add more comments * update tests * allow batched and non-batched writes * rename to accessors_l1_message * handle error * check if config is provided * improve sync service DB batched writes * include l1 messages in blocks: part 1 * add l1-message-type, transaction methods (#252) * add l1-message-type, transaction methods * goimports * Update core/types/transaction.go Co-authored-by: Péter Garamvölgyi <[email protected]> * txpool l1 check, pointer change, marhsal test * draft: start implementing l1message gas behavior * draft: start implementing l1message gas behavior * change to gas usage * error comment typo Co-authored-by: Haichen Shen <[email protected]> * goimports * update nonce, add hash test (fails), marshal test * goimports * target addr cant be nil * change call msg * comment out test * lint --------- Co-authored-by: Péter Garamvölgyi <[email protected]> Co-authored-by: Haichen Shen <[email protected]> * Add L1 message database (#255) * add l1-message-type, transaction methods * goimports * Update core/types/transaction.go Co-authored-by: Péter Garamvölgyi <[email protected]> * add L1 message store to rawdb * remove comments * rename to l1_message * rename variables and add comments * write l1 msgs in a batch * add more comments * update tests * allow batched and non-batched writes * rename to accessors_l1_message * handle error * add range check * fix tests * update comments * nit * support blocks with 0 l1 messages --------- Co-authored-by: Max Wolff <[email protected]> Co-authored-by: Max Wolff <[email protected]> * build(docker): auto docker push when pushing git tags (#258) * build(docker): update docker trigger tag prefix (#259) * Fix L1Message Deep Copy, Complete Bridge Tx Hash test (#269) * deep copy value field, add tx hash test comment * typo * commitl1messages * lint * Revert "add L1 message sync service" This reverts commit 5305e8a5de14766ed249e1a7d64042c7a72cf5c2. * Revert "move bridge client to separate file" This reverts commit 0b220bee37de93c3250545e23430db2c401a2f90. * update branch * use commitMessages for l1Txs * little fix * fix config * fix test * comment fixes * fix * fix config check --------- Co-authored-by: Max Wolff <[email protected]> Co-authored-by: Max Wolff <[email protected]> Co-authored-by: Péter Garamvölgyi <[email protected]> Co-authored-by: Péter Garamvölgyi <[email protected]> Co-authored-by: Haichen Shen <[email protected]> Co-authored-by: HAOYUatHZ <[email protected]> * Add ErrUnknownAncestor tests (#305) add ErrUnknownAncestor tests * worker test include l1 msgs (#306) * worker test include l1 msgs * move L1 message index update next to block insertion --------- Co-authored-by: Péter Garamvölgyi <[email protected]> * exclude l1 messages from transaction count limit in block (#307) * exclude l1 messages from transaction count limit in block * fix comments * trigger ci * nit --------- Co-authored-by: Péter Garamvölgyi <[email protected]> Co-authored-by: Péter Garamvölgyi <[email protected]> * Expose queueIndex on Transaction (#316) expose queueIndex on Transaction * test that l1msg doesn't count in maxTxPerBlock limit (#312) * test that l1msg doesn't count in maxTxPerBlock limit * fix, comment * retrigger ci * change order inside test --------- Co-authored-by: HAOYUatHZ <[email protected]> Co-authored-by: Péter Garamvölgyi <[email protected]> * reuse trace nonce field for queueIndex * expose scroll APIs on the geth console * add L1 message query APIs * Trigger new block on new l1 messages (#343) * trigger new block on new l1 messages * typo * initialize l1MsgCh * fix worker l1msg tests (#345) --------- Co-authored-by: Nazarii Denha <[email protected]> * test(worker): ensure that l1 messages are included in the correct order (#346) test that l1msgs added in correct order * rename enqueueIndex --> queueIndex * move QueueIndex into transaction * improve l1 db interface * formatting * bump version * print l1config * add API to query latest included message queue index * clean up tx limit logic * add clarifying comments and todos to ValidateL1Messages * improve db comments and logs * clean up L1MessageTx type handling * format * format * improve L1 message block check * fix missing L1 event handling * fix TestL1MessageValidationFailure * simplify sync height resume logic * make l1Config.l1MessageQueueAddress non-pointer * improve command line flags * remove todo * use abigen tools for log filtering * cache block L1 message count * nit: fix variable name case * improve logs * flush pending writes to DB before shutdown --------- Co-authored-by: Nazarii Denha <[email protected]> Co-authored-by: Max Wolff <[email protected]> Co-authored-by: Haichen Shen <[email protected]> Co-authored-by: Max Wolff <[email protected]> Co-authored-by: HAOYUatHZ <[email protected]> Co-authored-by: HAOYUatHZ <[email protected]> * remove syncing L1 messages related, it is migrated to node service --------- Co-authored-by: Ho <[email protected]> Co-authored-by: Péter Garamvölgyi <[email protected]> Co-authored-by: HAOYUatHZ <[email protected]> Co-authored-by: Nazarii Denha <[email protected]> Co-authored-by: maskpp <[email protected]> Co-authored-by: Richord <[email protected]> Co-authored-by: Péter Garamvölgyi <[email protected]> Co-authored-by: colin <[email protected]> Co-authored-by: Max Wolff <[email protected]> Co-authored-by: Haichen Shen <[email protected]> Co-authored-by: Max Wolff <[email protected]> Co-authored-by: HAOYUatHZ <[email protected]> * feat: update l1fee calculation (#351) * update env for docker compose * update docker compose * feat: return keccak(chainId || height) for BLOCKHASH opcode (#359) * changed blockhash behavior * added patch version * Update core/vm/runtime/runtime_test.go Co-authored-by: Péter Garamvölgyi <[email protected]> * Update core/vm/runtime/runtime_test.go Co-authored-by: Péter Garamvölgyi <[email protected]> * lint fix * changed wording * used interpreter.hasher and padded chainId to uint64 * used interpreter.hasher and padded chainId to uint64 * undo changes * bump version --------- Co-authored-by: Péter Garamvölgyi <[email protected]> Co-authored-by: Péter Garamvölgyi <[email protected]> * execute safe block * add newSafeL2Block to api client * feat(abigen): Add flag let be able to add user tmpl file. (#362) * Add user tmpl file. * Update accounts/abi/bind/template.go Co-authored-by: HAOYUatHZ <[email protected]> * Update cmd/abigen/main.go Co-authored-by: HAOYUatHZ <[email protected]> * Update cmd/abigen/main.go Co-authored-by: HAOYUatHZ <[email protected]> * Update cmd/abigen/main.go Co-authored-by: HAOYUatHZ <[email protected]> * fix bug --------- Co-authored-by: HAOYUatHZ <[email protected]> * fix: improve L1Message RPC encoding (#368) correctly encode L1 messages in RPC response * make baseFee unnecessary * fix block rlp encode issue * add testnet geth config file (#17) Co-authored-by: Yu Marvel <[email protected]> * Morph testnet deploy v0.0.1 (#18) * add testnet geth config file * add nohub to geth cmd --------- Co-authored-by: Yu Marvel <[email protected]> * count fix * feat: update contract ABI QueueIndex type to uint64 (#371) * update contract ABI QueueIndex type to uint64 * Update bindings.go * feat(core/vm): revert modexp precompiled contract if input is not u256 (#361) * Revert modexp precompiled contract if input is not u256 * bump version * use specific error * bump version * tests * bump version * fix lint * Update version.go --------- Co-authored-by: Péter Garamvölgyi <[email protected]> * feat(evm): limit ecPairing precompile to use up to 4 inputs (#373) * feat(evm): limit ecPairing precompile to use up to 4 inputs * update test cases * reorder test functions * change the predeploy contract address * fix: include L1MessageTx fields in transaction RPC result (#375) * fix: include L1MessageTx fields in tx RPC result * bump version * Update entrypoint.sh (#19) * fix test compile error * feat(trace): add per_tx_storage_trace (#372) * add proof for predeployed storages * reverse inneeded code * update for mainbranch merging * add pertx storage trace * dummy tx proof * add txstorage trace * add coinbase storage as trace * Update version.go * address comments --------- Co-authored-by: Ho Vei <[email protected]> * add new func * fix(trace): fix `statesAffected` in `traceLastNAddressAccount` (#367) * fix(trace): fix * Update version.go * fix(trace): fix storage proof of l1gas price oracle (#376) * fix storage proof of l1gas price oracle * Update version.go * fix(trace): fix --------- Co-authored-by: HAOYUatHZ <[email protected]> * add withdrawTrieRoot * feat(core/vm): modexp precompiled support also less than 32-bytes inputs (#393) * modexp support 32-bytes or less inputs * change revert string * bump version --------- Co-authored-by: Péter Garamvölgyi <[email protected]> * feat(rawdb&rpc): add block row consumption rpc (#388) * add db api for rowconsumption * add rpc api for block row consumption * return nil if rc is is not known * add method to sdk * bump version * small fix * update version --------- Co-authored-by: Péter Garamvölgyi <[email protected]> * change withdrawTrieRootSlot to 45 * add logs for debuging * more logs * more logs * separat entrypoint for testnet (#20) * fix estimateGas issue. similar to ethereum PR:24363 * fix the KnownBlock issue * fix(ethapi): change scroll_getBlockByHash ethapi behaviour (#398) * fix api behaviour * update version * not retrun error in ethclient * add comment * modify rowconsumption struct * fix lint * change naming * fix newL2SafeBlock * make baseFeePerGas not Must * remove parentHash from safeL2Data * update run testnet shell (#22) Co-authored-by: Yu Marvel <[email protected]> * fix compile error testcase * update run testnet shell (#23) Co-authored-by: Yu Marvel <[email protected]> * improve * Feature/testnet runner (#24) * update run testnet shell * refine run testnet sh --------- Co-authored-by: Yu Marvel <[email protected]> * Feature/testnet runner (#25) * update run testnet shell * refine run testnet sh * refine testnet runner --------- Co-authored-by: Yu Marvel <[email protected]> * blockSize gets length of txHash involved * add script to run testnet sentry geth * update l2node geth command with --nodiscover (#26) Co-authored-by: Yu Marvel <[email protected]> * fix incompatible block hash (#27) fix * Feature/run testnet update (#28) * update l2node geth command with --nodiscover * add run testnet in validator role * add comment for each script --------- Co-authored-by: Yu Marvel <[email protected]> * Feature/run testnet update (#29) * update l2node geth command with --nodiscover * add run testnet in validator role * add comment for each script * remove set -u for script --------- Co-authored-by: Yu Marvel <[email protected]> --------- Co-authored-by: marvelfisher <[email protected]> Co-authored-by: Péter Garamvölgyi <[email protected]> Co-authored-by: Max Wolff <[email protected]> Co-authored-by: Nazarii Denha <[email protected]> Co-authored-by: Péter Garamvölgyi <[email protected]> Co-authored-by: Marius van der Wijden <[email protected]> Co-authored-by: Orest Tarasiuk <[email protected]> Co-authored-by: Péter Szilágyi <[email protected]> Co-authored-by: Andrei Maiboroda <[email protected]> Co-authored-by: [email protected] <[email protected]> Co-authored-by: Martin Holst Swende <[email protected]> Co-authored-by: Ho <[email protected]> Co-authored-by: HAOYUatHZ <[email protected]> Co-authored-by: maskpp <[email protected]> Co-authored-by: Richord <[email protected]> Co-authored-by: colin <[email protected]> Co-authored-by: Ubuntu <[email protected]> Co-authored-by: Haichen Shen <[email protected]> Co-authored-by: Max Wolff <[email protected]> Co-authored-by: HAOYUatHZ <[email protected]> Co-authored-by: Yu Marvel <[email protected]>
1 parent 419c354 commit 2e7b3ed

File tree

231 files changed

+28365
-4813
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

231 files changed

+28365
-4813
lines changed

.env

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
GETH_DATA_DIR=/db
2+
GENESIS_FILE_PATH=/genesis.json
3+
JWT_SECRET_PATH=/jwt-secret.txt

.github/pull_request_template.md

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
## 1. Purpose or design rationale of this PR
2+
3+
...
4+
5+
6+
## 2. PR title
7+
8+
Your PR title must follow [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/#summary) (as we are doing squash merge for each PR), so it must start with one of the following [types](https://github.com/angular/angular/blob/22b96b9/CONTRIBUTING.md#type):
9+
10+
- [ ] build: Changes that affect the build system or external dependencies (example scopes: yarn, eslint, typescript)
11+
- [ ] ci: Changes to our CI configuration files and scripts (example scopes: vercel, github, cypress)
12+
- [ ] docs: Documentation-only changes
13+
- [ ] feat: A new feature
14+
- [ ] fix: A bug fix
15+
- [ ] perf: A code change that improves performance
16+
- [ ] refactor: A code change that doesn't fix a bug, or add a feature, or improves performance
17+
- [ ] style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
18+
- [ ] test: Adding missing tests or correcting existing tests
19+
20+
21+
## 3. Deployment tag versioning
22+
23+
Has the version in `params/version.go` been updated?
24+
25+
- [ ] This PR doesn't involve a new deployment, git tag, docker image tag, and it doesn't affect traces
26+
- [ ] Yes
27+
28+
29+
## 4. Breaking change label
30+
31+
Does this PR have the `breaking-change` label?
32+
33+
- [ ] This PR is not a breaking change
34+
- [ ] Yes

.github/workflows/docker.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Docker
33
on:
44
push:
55
tags:
6-
- scroll-v**
6+
- '*'
77

88
jobs:
99
build-and-push:

.github/workflows/l2geth_ci.yml

+9
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,15 @@ on:
66
- develop
77
- alpha
88
pull_request:
9+
types:
10+
- opened
11+
- reopened
12+
- synchronize
13+
- ready_for_review
914
name: CI
1015
jobs:
1116
build:
17+
if: github.event.pull_request.draft == false
1218
runs-on: ubuntu-latest
1319
steps:
1420
- name: Install Go
@@ -21,6 +27,7 @@ jobs:
2127
run: |
2228
make geth
2329
check:
30+
if: github.event.pull_request.draft == false
2431
runs-on: ubuntu-latest
2532
steps:
2633
- name: Install Go
@@ -34,6 +41,7 @@ jobs:
3441
rm -rf $HOME/.cache/golangci-lint
3542
make lint
3643
goimports-lint:
44+
if: github.event.pull_request.draft == false
3745
runs-on: ubuntu-latest
3846
steps:
3947
- name: Install Go
@@ -53,6 +61,7 @@ jobs:
5361
exit 1
5462
fi
5563
test:
64+
if: github.event.pull_request.draft == false
5665
runs-on: ubuntu-latest
5766
steps:
5867
- name: Install Go

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -47,3 +47,4 @@ profile.cov
4747
/dashboard/assets/package-lock.json
4848

4949
**/yarn-error.log
50+
/build/db*/

Dockerfile

+5-12
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
# Support setting various labels on the final image
2-
ARG COMMIT=""
3-
ARG VERSION=""
4-
ARG BUILDNUM=""
5-
61
# Build Geth in a stock Go builder container
72
FROM golang:1.18-alpine as builder
83

@@ -16,13 +11,11 @@ FROM alpine:latest
1611

1712
RUN apk add --no-cache ca-certificates
1813
COPY --from=builder /go-ethereum/build/bin/geth /usr/local/bin/
14+
COPY entrypoint.sh /entrypoint.sh
15+
16+
VOLUME ["/db"]
1917

20-
EXPOSE 8545 8546 30303 30303/udp
21-
ENTRYPOINT ["geth"]
18+
ENTRYPOINT ["/bin/sh", "/entrypoint.sh"]
2219

23-
# Add some metadata labels to help programatic image consumption
24-
ARG COMMIT=""
25-
ARG VERSION=""
26-
ARG BUILDNUM=""
20+
EXPOSE 8545 8546 8551 30303 30303/udp
2721

28-
LABEL commit="$COMMIT" version="$VERSION" buildnum="$BUILDNUM"

Makefile

+18
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,21 @@ devtools:
5252
env GOBIN= go install ./cmd/abigen
5353
@type "solc" 2> /dev/null || echo 'Please install solc'
5454
@type "protoc" 2> /dev/null || echo 'Please install protoc'
55+
56+
57+
testnet-up:
58+
docker-compose -f testnet/docker-compose.yml up -d
59+
.PHONY: testnet-up
60+
61+
testnet-down:
62+
docker-compose -f testnet/docker-compose.yml down
63+
.PHONY: testnet-down
64+
65+
testnet-clean:
66+
docker-compose -f testnet/docker-compose.yml down
67+
docker images -q morphism_geth:latest | xargs -r docker rmi
68+
docker volume ls --filter "name=morph_data*" -q | xargs -r docker volume rm
69+
.PHONY: testnet-clean
70+
71+
image:
72+
docker build -f Dockerfile -t morphism-geth:latest .

accounts/abi/bind/backends/simulated.go

+92-1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ import (
3030
"github.com/scroll-tech/go-ethereum/common"
3131
"github.com/scroll-tech/go-ethereum/common/hexutil"
3232
"github.com/scroll-tech/go-ethereum/common/math"
33+
"github.com/scroll-tech/go-ethereum/consensus"
3334
"github.com/scroll-tech/go-ethereum/consensus/ethash"
3435
"github.com/scroll-tech/go-ethereum/core"
3536
"github.com/scroll-tech/go-ethereum/core/bloombits"
@@ -42,6 +43,7 @@ import (
4243
"github.com/scroll-tech/go-ethereum/event"
4344
"github.com/scroll-tech/go-ethereum/log"
4445
"github.com/scroll-tech/go-ethereum/params"
46+
"github.com/scroll-tech/go-ethereum/rollup/fees"
4547
"github.com/scroll-tech/go-ethereum/rpc"
4648
)
4749

@@ -63,6 +65,8 @@ type SimulatedBackend struct {
6365
database ethdb.Database // In memory database to store our testing data
6466
blockchain *core.BlockChain // Ethereum blockchain to handle the consensus
6567

68+
consensus consensus.Engine
69+
6670
mu sync.Mutex
6771
pendingBlock *types.Block // Currently pending block that will be imported on request
6872
pendingState *state.StateDB // Currently pending state that will be the active on request
@@ -97,6 +101,87 @@ func NewSimulatedBackend(alloc core.GenesisAlloc, gasLimit uint64) *SimulatedBac
97101
return NewSimulatedBackendWithDatabase(rawdb.NewMemoryDatabase(), alloc, gasLimit)
98102
}
99103

104+
type simulatedBackendConfig struct {
105+
genesis core.Genesis
106+
cacheConfig *core.CacheConfig
107+
database ethdb.Database
108+
vmConfig vm.Config
109+
consensus consensus.Engine
110+
}
111+
112+
type SimulatedBackendOpt func(s *simulatedBackendConfig)
113+
114+
func WithDatabase(database ethdb.Database) SimulatedBackendOpt {
115+
return func(s *simulatedBackendConfig) {
116+
s.database = database
117+
}
118+
}
119+
120+
func WithGasLimit(gasLimit uint64) SimulatedBackendOpt {
121+
return func(s *simulatedBackendConfig) {
122+
s.genesis.GasLimit = gasLimit
123+
}
124+
}
125+
126+
func WithAlloc(alloc core.GenesisAlloc) SimulatedBackendOpt {
127+
return func(s *simulatedBackendConfig) {
128+
s.genesis.Alloc = alloc
129+
}
130+
}
131+
132+
func WithCacheConfig(cacheConfig *core.CacheConfig) SimulatedBackendOpt {
133+
return func(s *simulatedBackendConfig) {
134+
s.cacheConfig = cacheConfig
135+
}
136+
}
137+
138+
func WithGenesis(genesis core.Genesis) SimulatedBackendOpt {
139+
return func(s *simulatedBackendConfig) {
140+
s.genesis = genesis
141+
}
142+
}
143+
144+
func WithVMConfig(vmConfig vm.Config) SimulatedBackendOpt {
145+
return func(s *simulatedBackendConfig) {
146+
s.vmConfig = vmConfig
147+
}
148+
}
149+
150+
func WithConsensus(consensus consensus.Engine) SimulatedBackendOpt {
151+
return func(s *simulatedBackendConfig) {
152+
s.consensus = consensus
153+
}
154+
}
155+
156+
// NewSimulatedBackendWithOpts creates a new binding backend based on the given database
157+
// and uses a simulated blockchain for testing purposes. It exposes additional configuration
158+
// options that are useful to
159+
func NewSimulatedBackendWithOpts(opts ...SimulatedBackendOpt) *SimulatedBackend {
160+
config := &simulatedBackendConfig{
161+
genesis: core.Genesis{Config: params.AllEthashProtocolChanges, GasLimit: 100000000, Alloc: make(core.GenesisAlloc)},
162+
database: rawdb.NewMemoryDatabase(),
163+
consensus: ethash.NewFaker(),
164+
}
165+
166+
for _, opt := range opts {
167+
opt(config)
168+
}
169+
170+
config.genesis.MustCommit(config.database)
171+
blockchain, _ := core.NewBlockChain(config.database, config.cacheConfig, config.genesis.Config, config.consensus, config.vmConfig, nil, nil)
172+
173+
backend := &SimulatedBackend{
174+
database: config.database,
175+
blockchain: blockchain,
176+
config: config.genesis.Config,
177+
consensus: config.consensus,
178+
events: filters.NewEventSystem(&filterBackend{config.database, blockchain}, false),
179+
}
180+
181+
backend.rollback(blockchain.CurrentBlock())
182+
return backend
183+
}
184+
100185
// Close terminates the underlying blockchain's update loop.
101186
func (b *SimulatedBackend) Close() error {
102187
b.blockchain.Stop()
@@ -638,8 +723,13 @@ func (b *SimulatedBackend) callContract(ctx context.Context, call ethereum.CallM
638723
// about the transaction and calling mechanisms.
639724
vmEnv := vm.NewEVM(evmContext, txContext, stateDB, b.config, vm.Config{NoBaseFee: true})
640725
gasPool := new(core.GasPool).AddGas(math.MaxUint64)
726+
signer := types.MakeSigner(b.blockchain.Config(), head.Number)
727+
l1DataFee, err := fees.EstimateL1DataFeeForMessage(msg, head.BaseFee, b.blockchain.Config().ChainID, signer, stateDB)
728+
if err != nil {
729+
return nil, err
730+
}
641731

642-
return core.NewStateTransition(vmEnv, msg, gasPool).TransitionDb()
732+
return core.NewStateTransition(vmEnv, msg, gasPool, l1DataFee).TransitionDb()
643733
}
644734

645735
// SendTransaction updates the pending block to include the given transaction.
@@ -814,6 +904,7 @@ func (m callMsg) Gas() uint64 { return m.CallMsg.Gas }
814904
func (m callMsg) Value() *big.Int { return m.CallMsg.Value }
815905
func (m callMsg) Data() []byte { return m.CallMsg.Data }
816906
func (m callMsg) AccessList() types.AccessList { return m.CallMsg.AccessList }
907+
func (m callMsg) IsL1MessageTx() bool { return false }
817908

818909
// filterBackend implements filters.Backend to support filtering for logs without
819910
// taking bloom-bits acceleration structures into account.

accounts/abi/bind/template.go

+7
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,13 @@ var tmplSource = map[Lang]string{
7979
LangJava: tmplSourceJava,
8080
}
8181

82+
// SetTmplSource supports this func in order to set special template file.
83+
func SetTmplSource(lang Lang, source string) {
84+
if _, ok := tmplSource[lang]; ok {
85+
tmplSource[lang] = source
86+
}
87+
}
88+
8289
// tmplSourceGo is the Go source template that the generated Go contract binding
8390
// is based on.
8491
const tmplSourceGo = `

build/jwt-secret.txt

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
688f5d737bad920bdfb2fc2f488d6b6209eebda1dae949a8de91398d932c517a

cmd/abigen/main.go

+28-3
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,14 @@ var (
9999
Name: "alias",
100100
Usage: "Comma separated aliases for function and event renaming, e.g. original1=alias1, original2=alias2",
101101
}
102+
contractFlag = cli.StringFlag{
103+
Name: "contract",
104+
Usage: "Name of the contract to generate the bindings for",
105+
}
106+
tmplFlag = cli.StringFlag{
107+
Name: "tmpl",
108+
Usage: "Template file if a user wants to customize",
109+
}
102110
)
103111

104112
func init() {
@@ -117,6 +125,8 @@ func init() {
117125
outFlag,
118126
langFlag,
119127
aliasFlag,
128+
contractFlag,
129+
tmplFlag,
120130
}
121131
app.Action = utils.MigrateFlags(abigen)
122132
cli.CommandHelpTemplate = flags.OriginCommandHelpTemplate
@@ -225,6 +235,13 @@ func abigen(c *cli.Context) error {
225235
}
226236
// Gather all non-excluded contract for binding
227237
for name, contract := range contracts {
238+
// The fully qualified name is of the form <solFilePath>:<type>
239+
nameParts := strings.Split(name, ":")
240+
typeName := nameParts[len(nameParts)-1]
241+
// If a contract name is provided then ignore all other contracts
242+
if c.GlobalIsSet(contractFlag.Name) && c.GlobalString(contractFlag.Name) != typeName {
243+
continue
244+
}
228245
if exclude[strings.ToLower(name)] {
229246
continue
230247
}
@@ -235,11 +252,10 @@ func abigen(c *cli.Context) error {
235252
abis = append(abis, string(abi))
236253
bins = append(bins, contract.Code)
237254
sigs = append(sigs, contract.Hashes)
238-
nameParts := strings.Split(name, ":")
239-
types = append(types, nameParts[len(nameParts)-1])
255+
types = append(types, typeName)
240256

241257
libPattern := crypto.Keccak256Hash([]byte(name)).String()[2:36]
242-
libs[libPattern] = nameParts[len(nameParts)-1]
258+
libs[libPattern] = typeName
243259
}
244260
}
245261
// Extract all aliases from the flags
@@ -254,6 +270,15 @@ func abigen(c *cli.Context) error {
254270
aliases[match[1]] = match[2]
255271
}
256272
}
273+
// Set customize template file.
274+
if c.GlobalIsSet(tmplFlag.Name) {
275+
tmplFile := c.GlobalString(tmplFlag.Name)
276+
data, err := os.ReadFile(tmplFile)
277+
if err != nil {
278+
utils.Fatalf("Failed to read template file: %v", err)
279+
}
280+
bind.SetTmplSource(lang, string(data))
281+
}
257282
// Generate the contract binding
258283
code, err := bind.Bind(types, abis, bins, sigs, c.GlobalString(pkgFlag.Name), lang, libs, aliases)
259284
if err != nil {

cmd/clef/main.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -662,7 +662,7 @@ func signer(c *cli.Context) error {
662662
if err != nil {
663663
utils.Fatalf("Could not register API: %w", err)
664664
}
665-
handler := node.NewHTTPHandlerStack(srv, cors, vhosts)
665+
handler := node.NewHTTPHandlerStack(srv, cors, vhosts, nil)
666666

667667
// set port
668668
port := c.Int(rpcPortFlag.Name)

cmd/devp2p/internal/ethtest/chain.go

+8
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import (
2626
"os"
2727
"strings"
2828

29+
"github.com/scroll-tech/go-ethereum/common"
2930
"github.com/scroll-tech/go-ethereum/core"
3031
"github.com/scroll-tech/go-ethereum/core/forkid"
3132
"github.com/scroll-tech/go-ethereum/core/types"
@@ -67,6 +68,13 @@ func (c *Chain) TotalDifficultyAt(height int) *big.Int {
6768
return sum
6869
}
6970

71+
func (c *Chain) RootAt(height int) common.Hash {
72+
if height < c.Len() {
73+
return c.blocks[height].Root()
74+
}
75+
return common.Hash{}
76+
}
77+
7078
// ForkID gets the fork id of the chain.
7179
func (c *Chain) ForkID() forkid.ID {
7280
return forkid.NewID(c.chainConfig, c.blocks[0].Hash(), uint64(c.Len()))

0 commit comments

Comments
 (0)