Commit graph

13181 commits

Author SHA1 Message Date
Péter Garamvölgyi
4e0daeb300
fix(trace): change l1Fee type from uint64 to *big.Int (#360)
* fix: change l1Fee type from uint64 to *big.Int

* use hexutil.Big
2023-06-09 22:28:40 +08:00
Péter Garamvölgyi
983d630244
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 <th307q@gmail.com>

---------

Co-authored-by: Péter Garamvölgyi <th307q@gmail.com>

* 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 <th307q@gmail.com>
Co-authored-by: Péter Garamvölgyi <peter@scroll.io>

* 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 <th307q@gmail.com>

* 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 <shenhaichen@gmail.com>

* 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 <th307q@gmail.com>
Co-authored-by: Haichen Shen <shenhaichen@gmail.com>

* Add L1 message database (#255)

* add l1-message-type, transaction methods

* goimports

* Update core/types/transaction.go

Co-authored-by: Péter Garamvölgyi <th307q@gmail.com>

* 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 <maxcwolff@gmail.com>
Co-authored-by: Max Wolff <max@scroll.io>

* 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 <th307q@gmail.com>

---------

Co-authored-by: Péter Garamvölgyi <th307q@gmail.com>

* 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 <th307q@gmail.com>

* 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 <dengaaa2002@gmail.com>
Co-authored-by: Max Wolff <maxcwolff@gmail.com>
Co-authored-by: Max Wolff <max@scroll.io>

* 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 <th307q@gmail.com>

* 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 <th307q@gmail.com>

* 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 <shenhaichen@gmail.com>

* 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 <th307q@gmail.com>
Co-authored-by: Haichen Shen <shenhaichen@gmail.com>

* Add L1 message database (#255)

* add l1-message-type, transaction methods

* goimports

* Update core/types/transaction.go

Co-authored-by: Péter Garamvölgyi <th307q@gmail.com>

* 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 <maxcwolff@gmail.com>
Co-authored-by: Max Wolff <max@scroll.io>

* 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 <maxcwolff@gmail.com>
Co-authored-by: Max Wolff <max@scroll.io>
Co-authored-by: Péter Garamvölgyi <th307q@gmail.com>
Co-authored-by: Péter Garamvölgyi <peter@scroll.io>
Co-authored-by: Haichen Shen <shenhaichen@gmail.com>
Co-authored-by: HAOYUatHZ <37070449+HAOYUatHZ@users.noreply.github.com>

* 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 <peter@scroll.io>

* 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 <th307q@gmail.com>
Co-authored-by: Péter Garamvölgyi <peter@scroll.io>

* 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 <37070449+HAOYUatHZ@users.noreply.github.com>
Co-authored-by: Péter Garamvölgyi <th307q@gmail.com>

* 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 <dengaaa2002@gmail.com>

* 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 <dengaaa2002@gmail.com>
Co-authored-by: Max Wolff <max@scroll.io>
Co-authored-by: Haichen Shen <shenhaichen@gmail.com>
Co-authored-by: Max Wolff <maxcwolff@gmail.com>
Co-authored-by: HAOYUatHZ <37070449+HAOYUatHZ@users.noreply.github.com>
Co-authored-by: HAOYUatHZ <haoyu@protonmail.com>
2023-06-07 07:24:19 -07:00
Ho
4867699afa
fix(tracing): fix ZktrieTracer race condition (#356)
* fix race condition of zktrie tracer

* Update version.go

---------

Co-authored-by: HAOYUatHZ <37070449+HAOYUatHZ@users.noreply.github.com>
2023-06-07 09:16:45 +08:00
Richord
1f167bd730
fix(ethclient): support WithdrawalsHash in Scroll Go SDK (#354)
* added withdrawalsHash to header

* bump version

---------

Co-authored-by: Péter Garamvölgyi <peter@scroll.io>
2023-06-05 09:52:46 -07:00
Ho
9b943f3e0b
fix: add missing term when merging two deletion proofs (#353)
* fix: merge emptyTermPaths

* bump version

---------

Co-authored-by: Péter Garamvölgyi <peter@scroll.io>
2023-06-01 11:00:37 +02:00
colin
74725fbe2c
test(zkTrie): add deletion test in account update unit test (#344)
feat(zkTrie): extend account update unit tests with account deletion
2023-05-25 16:30:50 +08:00
Richord
ad43d0ea3f
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 <th307q@gmail.com>

* fixed test

* fix

* bump version

* fix test

---------

Co-authored-by: Péter Garamvölgyi <th307q@gmail.com>
Co-authored-by: Péter Garamvölgyi <peter@scroll.io>
2023-05-24 15:23:57 +02:00
Péter Garamvölgyi
31b754e14b
Fix transaction DA cost under-estimation (#332)
* fix tx DA cost under-estimation

* bump version

---------

Co-authored-by: HAOYUatHZ <37070449+HAOYUatHZ@users.noreply.github.com>
2023-05-24 14:22:54 +02:00
Péter Garamvölgyi
060815e901
feat: delay Archimedes on Alpha by a week (#342)
* delay Archimedes on Alpha by a week

* bump version

---------

Co-authored-by: HAOYUatHZ <37070449+HAOYUatHZ@users.noreply.github.com>
2023-05-24 14:10:42 +02:00
Péter Garamvölgyi
334892ae07
Return error for disabled precompile calls (#337)
return error for disabled precompile calls
2023-05-24 11:41:33 +02:00
HAOYUatHZ
fb570dc8c7
ci(github): update pull request template (#349)
* chore(github): update pull request template

* Update pull_request_template.md
2023-05-24 14:50:37 +08:00
HAOYUatHZ
9f981c5713
build(github): update github action yaml (#347)
* build(github): update github action yaml

* fix
2023-05-24 08:15:06 +08:00
maskpp
0c182f13bd
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 <th307q@gmail.com>

* Update cmd/abigen/main.go

Co-authored-by: Péter Garamvölgyi <th307q@gmail.com>

---------

Co-authored-by: Péter Garamvölgyi <th307q@gmail.com>
Co-authored-by: HAOYUatHZ <37070449+HAOYUatHZ@users.noreply.github.com>
2023-05-22 22:44:05 +08:00
Richord
2f7085715b
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 <th307q@gmail.com>
2023-05-22 22:37:27 +08:00
maskpp
a89ab83089
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.
2023-05-22 16:52:13 +08:00
Ho
149419cf09
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 <37070449+HAOYUatHZ@users.noreply.github.com>
2023-05-22 15:24:49 +08:00
Nazarii Denha
1094569b5b
feat: enable eip and update check (#335)
* enable eip and update check

* Update version.go

---------

Co-authored-by: Péter Garamvölgyi <th307q@gmail.com>
Co-authored-by: HAOYUatHZ <37070449+HAOYUatHZ@users.noreply.github.com>
2023-05-19 21:41:58 +08:00
Ho
910d4f1a70
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 <th307q@gmail.com>
Co-authored-by: HAOYUatHZ <37070449+HAOYUatHZ@users.noreply.github.com>
2023-05-18 21:49:09 +08:00
Péter Garamvölgyi
b8d22a104d
Add Archimedes hard fork block number for Scroll Alpha (#331)
* add Archimedes hard fork block number for Scroll Alpha

* bump version
2023-05-18 12:38:53 +02:00
Nazarii Denha
c5da652c29
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: lightclient@protonmail.com <lightclient@protonmail.com>
Co-authored-by: Martin Holst Swende <martin@swende.se>
Co-authored-by: Marius van der Wijden <m.vanderwijden@live.de>

* add ishanghai

* fix test

* fix

---------

Co-authored-by: Andrei Maiboroda <andrei@ethereum.org>
Co-authored-by: lightclient@protonmail.com <lightclient@protonmail.com>
Co-authored-by: Martin Holst Swende <martin@swende.se>
Co-authored-by: Marius van der Wijden <m.vanderwijden@live.de>
Co-authored-by: Péter Garamvölgyi <peter@scroll.io>
2023-05-18 12:11:53 +02:00
Orest Tarasiuk
e1fb1955a0
chore(github): Add PR template to ask for rationale and version update (#327)
Create pull_request_template.md
2023-05-15 17:59:13 +08:00
Nazarii Denha
29b23f4f5b
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 <m.vanderwijden@live.de>
2023-05-12 08:46:37 +02:00
Nazarii Denha
b1e5eea84d
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 <peter@scroll.io>
2023-05-10 15:09:55 +02:00
Max Wolff
b0b0bf1133
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
2023-05-09 09:04:46 -07:00
Péter Garamvölgyi
27a3830afa
Improve oversized block handling (#315)
* improve oversized block handling

* bump version
2023-05-08 18:58:58 +02:00
Ho
c913b3e2f1
fix(zktrie): fix deletion proofs and collect them in commiting phase (#263)
* new deletion proof

* complete tracer and test

* extend proof for parallel tracing

* integrating into blocktrace

* lint

* deduplication of deletion proofs

* fix an issue on marking deletion

* fixs since last review

* Update version.go

---------

Co-authored-by: HAOYUatHZ <37070449+HAOYUatHZ@users.noreply.github.com>
Co-authored-by: Ubuntu <ubuntu@ip-10-2-9-63.us-west-2.compute.internal>
2023-05-08 15:40:54 +08:00
HAOYUatHZ
49192260a1
build: update github CI trigger conditions (#313) 2023-05-04 21:51:10 +08:00
Péter Garamvölgyi
1263e6349d
Bump version (#310)
bump version to 3.1.10
2023-05-03 17:55:34 +02:00
Péter Garamvölgyi
5017dcb92a
Add block payload size limit (#309)
add block payload size limit
2023-05-03 17:45:17 +02:00
Ho
ba4feee9ff
feat(zktrie): upgrade zktrie to 0.5.3 (#278)
* upgrade zktrie to 0.5.3

* Update version.go

---------

Co-authored-by: HAOYUatHZ <37070449+HAOYUatHZ@users.noreply.github.com>
2023-04-24 21:32:50 +08:00
HAOYUatHZ
61d15e9d56
feat: print ScrollConfig when starting node (#291)
* feat: print ScrollConfig when starting node

* Update version.go
2023-04-24 20:49:50 +08:00
HAOYUatHZ
ddaab71dbb
Bump version v3.1.7 (#299) 2023-04-20 20:11:49 +08:00
HAOYUatHZ
dfdd0160e7
chore: remove outdated genesis.json (#297) 2023-04-20 19:58:25 +08:00
HAOYUatHZ
1abf51a719
style: revert Dockerfile format (#296) 2023-04-20 18:21:46 +08:00
HAOYUatHZ
60ced6cf4d
build: remove jenkins scripts (#295)
* update github workflow

* update github workflow

* update github workflow
2023-04-20 18:12:46 +08:00
HAOYUatHZ
32aacc3fd6
style: revert some formatting (#294)
Revert "style: remove blank line & white space formatting"

This reverts commit 349def8d5d78f83c19e899d5d80b1d9f6a5d18c6.
2023-04-20 17:49:35 +08:00
Nazarii Denha
09c69b6076
implement PUSH0 (#273)
Co-authored-by: Péter Garamvölgyi <th307q@gmail.com>
2023-04-20 11:39:19 +02:00
HAOYUatHZ
11ff7a0648
refactor: rename L1FeeEnabled to FeeVaultEnabled (#281)
rename `L1FeeEnabled` to `FeeVaultEnabled`
2023-04-19 22:41:38 +08:00
georgehao
f71fc6794a
fix(api): fix debug_ API oom bug (#284)
* feat: fix oom bug

* feat: format import

* feat: remove unused code

* Update version.go

---------

Co-authored-by: colin <102356659+colinlyguo@users.noreply.github.com>
Co-authored-by: HAOYUatHZ <37070449+HAOYUatHZ@users.noreply.github.com>
2023-04-19 21:26:29 +08:00
HAOYUatHZ
b22944a621
Revert "Substitute secp256k1 library for the L1 version (#22)" (#290)
* Revert "Substitute secp256k1 library for the L1 version (#22)"

This reverts commit 59df2d7ebb.

* goimports -local github.com/scroll-tech/go-ethereum -w .

* go mod tidy
2023-04-19 15:54:20 +08:00
Péter Garamvölgyi
d274ef1f93
Bump version v3.1.5 (#289)
bump version v3.1.5
2023-04-19 06:14:28 +02:00
Max Wolff
028acecb02
fix return type in tx receipt for l1fee type (#254)
* edit marshalling override

* goimports

* not required

* encode l1fee

---------

Co-authored-by: Péter Garamvölgyi <th307q@gmail.com>
2023-04-19 05:12:57 +02:00
Péter Garamvölgyi
49e755e334
Add Scroll bootnode config (#261)
* add Scroll bootnode config

* expose scroll networks on node CLI

* add alpha genesis config

* fix scroll genesis config

* update default sync mode

* address todos

* remove scroll staging network

* bump version

* update genesis config

* bump version
2023-04-19 04:40:52 +02:00
HAOYUatHZ
df1d37e097
refactor(config): consolidate scroll flags (#262) 2023-04-17 18:56:26 +08:00
HAOYUatHZ
909fe1d3ec
build(docker): update docker trigger tag prefix (#259) 2023-04-03 17:22:45 +08:00
HAOYUatHZ
c5ad2abe64
build(docker): auto docker push when pushing git tags (#258) 2023-04-03 15:45:55 +08:00
Péter Garamvölgyi
b986f1ea7b
feat(API): consider L1 fee in eth_call and eth_estimateGas (#248)
* consider L1 fee in eth_call and eth_estimateGas

* address comments

* consider l1fee in trace call

* nit

* fix bugs and add tests

* address comments

* bump version
2023-03-30 23:10:51 +08:00
Max Wolff
a74b35e86f
feat(api): add L1 fee to eth_getTransactionReceipt (#244)
* Update api.go

* fmt

* revert changes

* add l1fee to receipt in transaction processor

* decoder

* fmt

* fmt

* add encoding, test

* fmt

* removed duplicate l1 fee calc, added gen receipt

* remove dup l1feecalc

* lint

* add omitempty

* bump version

---------

Co-authored-by: Péter Garamvölgyi <th307q@gmail.com>
Co-authored-by: HAOYUatHZ <37070449+HAOYUatHZ@users.noreply.github.com>
Co-authored-by: Péter Garamvölgyi <peter@scroll.io>
2023-03-28 09:08:57 +08:00
Péter Garamvölgyi
4da184ea60
feat(vm): disable EIP-3198 (#250)
* disable EIP 3198

* bump version

* trigger ci
2023-03-27 17:49:32 +08:00
HAOYUatHZ
127af384ed
build: update version (#246) 2023-03-21 10:04:20 +08:00