Commit graph

1468 commits

Author SHA1 Message Date
HAOYUatHZ
88349c600d
feat: add mux tracer for native call tracer and native prestate tracers (#615)
* hack to use native tracers

* update

* fix

* add prestate

* fix marshal

* format

* draft

* move

* separate `MuxTracer`

* fix

* update miner/worker.go

* update api

* rename

* remove

* bump go version

* bump golangci

* goimports lint

* fix tests

* minor

* clean up

* fix tests

* sync error handling

* bump go version in Dockerfiles

* bump version

* lint: disable `goconst` & `goimports`

* bump version again

* add comments

---------

Co-authored-by: lightsing <light.tsing@gmail.com>
2024-01-18 14:58:27 +08:00
HAOYUatHZ
f4b247da15
feat: add scroll_getTxBlockTraceOnTopOfBlock API (#558)
* init

* more

* fix draft

* refactor

* fix

* clean up

* minor

* fix

* fix

* clean up

* clean up

* improve
2023-11-20 13:59:20 +08:00
colin
1bf26286db
feat(rpc): add scroll_* rollup APIs (#548)
* feat(rpc): add scroll_* rollup APIs

* address comments

* address comments

* address comments

* support finalized tag in eth_feeHistory

* Update internal/web3ext/web3ext.go

Co-authored-by: Péter Garamvölgyi <peter@scroll.io>

* tweak

---------

Co-authored-by: Péter Garamvölgyi <peter@scroll.io>
2023-11-09 09:55:13 +01:00
colin
441212200a
feat(rollup): sync finalized batches from L1 (#515)
* feat(rollup): sync finalized batches from L1

* tweak

* address comments

* address comments

* tweak

* address comments

* Update rollup/eventwatcher/eventwatcher.go

Co-authored-by: Péter Garamvölgyi <peter@scroll.io>

* address comments

* address comments

* address comments

* add s.rollupSyncService.Stop()

* add block chunk batch tests

* fix goimports-lint

* address comments

* address comments

* remove

* add TestUnpackLog test

* add decodeChunkRanges tests

* add commit batch version check

* fix goimport & golint

* tweak

* fixes

* add TestRollupSyncServiceStartAndStop

* add TestGetChunkRanges

* address comments

* add TestValidateBatch

* add TestCalculateFinalizedBatchMeta

* address comments

* address comments

* fix

* address comments

* address comments

* fix

* tweak log

* fix

* tweak logs

* increase wait time

* add --rollup.verify flag

* add flag check in s.rollupSyncService.Stop()

* bump version

* refactor

* tweak configs

* tweak

* refactor getLocalInfoForBatch

* use syscall.Kill(os.Getpid(), syscall.SIGTERM) to shutdown

* refactor decodeChunkBlockRanges

* nit

* address comments

* address comments

* add WithdrawRoot and StateRoot in FinalizedBatchMeta

* address comments

* address comments

* add ctx.Err() check in retry

* add configs in gen_config.go

* bump version

* fix goimport & golint

* try to fix goimport

* revert change

* fix goimport & golint

* tweak

* bump version

* add l2 block -> batch index mapping

* bump version

* add mainnet config

* bump version

* address comments

* rename some vars

* feat: add more detailed logs in crash case (#547)

add more detailed logs in crash case

* trigger ci

* re-add batch finalization progress log

* remove block number -> batch index mapping

---------

Co-authored-by: Péter Garamvölgyi <peter@scroll.io>
Co-authored-by: HAOYUatHZ <37070449+HAOYUatHZ@users.noreply.github.com>
2023-10-28 06:29:31 +08:00
Nazarii Denha
fea7d94ebd
Fix/config fix small bug and set default maxBlockRange to -1 to not use it (#529)
* feat: configure max block range for eth_getLogs (#521)

* configure max block range for eth_getLogs

* bump version

* address comments, add test

* set default value

* address comments

* fix golint

* Update cmd/utils/flags.go

Co-authored-by: colin <102356659+colinlyguo@users.noreply.github.com>

---------

Co-authored-by: colinlyguo <colinlyguo@scroll.io>
Co-authored-by: colin <102356659+colinlyguo@users.noreply.github.com>

* set dafault maxblockrange to -1 and fix nil pointer bug

* update version

* change error logic

* check for range in filter

* Update eth/ethconfig/config.go

Co-authored-by: colin <102356659+colinlyguo@users.noreply.github.com>

* adjust error message

* fix duplicate version

---------

Co-authored-by: colinlyguo <colinlyguo@scroll.io>
Co-authored-by: colin <102356659+colinlyguo@users.noreply.github.com>
Co-authored-by: Péter Garamvölgyi <peter@scroll.io>
2023-10-04 19:18:52 +02:00
Péter Garamvölgyi
736cf7b1fb
Revert "feat: configure max block range for eth_getLogs (#521)" (#528)
This reverts commit de5aebdad5.
2023-10-03 15:07:43 +02:00
Nazarii Denha
de5aebdad5
feat: configure max block range for eth_getLogs (#521)
* configure max block range for eth_getLogs

* bump version

* address comments, add test

* set default value

* address comments

* fix golint

* Update cmd/utils/flags.go

Co-authored-by: colin <102356659+colinlyguo@users.noreply.github.com>

---------

Co-authored-by: colinlyguo <colinlyguo@scroll.io>
Co-authored-by: colin <102356659+colinlyguo@users.noreply.github.com>
2023-10-02 17:11:50 +02:00
HAOYUatHZ
dade96d416
fix(rawdb, api): fix rawdb.writeSkippedTransaction & api.GetSkippedTransaction (#503)
* fix(rawsdb): fix `writeSkippedTransaction`

* Update version.go

* minor

* clean up
2023-09-07 15:35:04 +08:00
HAOYUatHZ
0b6c3be40d
feat(api/rawdb): allow storing traces for skipped txs (#500) 2023-09-05 11:03:15 +08:00
Péter Garamvölgyi
7de261b1be
feat: store skipped transactions in local db (#467)
* feat: store skipped txs in local db

* bump version

* bump version

* fix test

* include L2 txs in skipped index

* goimports

* rename more

* bump version

* fix missed renames

* fix the bug when calculating l2TxCount. (#479)

* fix bug when calculate l2 tx count

* Update version

* fix: exclude L1 message from block payload size validation (#476)

* fix: exclude L1 message from block payload size validation

* fix the bug when calculating l2TxCount. (#479)

* fix bug when calculate l2 tx count

* Update version

* bump version

---------

Co-authored-by: maskpp <maskpp266@gmail.com>

* fix: update row estimation with scroll-prover `v0.7.2` (#475)

* Fix row estimation.

* Update libzkp.

* more

* prepare

* finish

* upgrade

* bump version

* fix tests

* Update to scroll-prover `v0.7.2`.

* fix tests

* Update miner/worker.go

Co-authored-by: Péter Garamvölgyi <peter@scroll.io>

* Update miner/worker.go

Co-authored-by: Péter Garamvölgyi <peter@scroll.io>

* Reset ccc when skips first tx.

* do not unnecessarily skip L1 message

* fix ccc reset and improve code readability

* seal block on circuitcapacitychecker.ErrUnknown

---------

Co-authored-by: HAOYUatHZ <haoyu@protonmail.com>
Co-authored-by: Péter Garamvölgyi <peter@scroll.io>

* refactor: simplify ccc revert to snapshot (#480)

* simplify ccc revert to snapshot

* Update version.go

---------

Co-authored-by: HAOYUatHZ <37070449+HAOYUatHZ@users.noreply.github.com>

* feat: use --gcmode=archive and --cache.noprefetch=true by default (#482)

* feat: use --gcmode=archive and --cache.noprefetch=true by default

* refuse to start with invalid config

* lint

* lint

* feat(sdk): support compressed response (#469)

* enable use compression algorithm

* fix ci

* Just enable decode compressed content at ethclient

* fix comments

---------

Co-authored-by: Haichen Shen <shenhaichen@gmail.com>

* fix: disable pruning and prefetch if not flags are provided (#483)

Co-authored-by: colin <102356659+colinlyguo@users.noreply.github.com>

* fix: update libzkp to use scroll-prover `v0.7.5` (#484)

* Update libzkp to use scroll-prover `v0.7.5`.

* Update version.

* address comments

* bump version

* nit

---------

Co-authored-by: maskpp <maskpp266@gmail.com>
Co-authored-by: Steven <asongala@163.com>
Co-authored-by: HAOYUatHZ <haoyu@protonmail.com>
Co-authored-by: iczc <iczcalan@gmail.com>
Co-authored-by: HAOYUatHZ <37070449+HAOYUatHZ@users.noreply.github.com>
Co-authored-by: Haichen Shen <shenhaichen@gmail.com>
Co-authored-by: colin <102356659+colinlyguo@users.noreply.github.com>
2023-08-25 15:41:05 +02:00
Haichen Shen
e8d9d60cf0
fix: use FeeVault address in the EVM BlockContext (#473)
* fix: use Feevault address in the EVM BlockContext

* bump version

* revert format change

* fix
2023-08-19 14:01:14 +02:00
Péter Garamvölgyi
25fe3ba69a
feat: add startL1QueueIndex field to traces (#463)
* feat: include startL1QueueIndex in traces

* fix

* update example
2023-08-12 11:07:36 +08:00
Nazarii Denha
cb38ec47a5
Fix/test api get block trace by number or hash (#453)
fix test

Co-authored-by: Péter Garamvölgyi <peter@scroll.io>
2023-08-08 16:31:34 +02:00
HAOYUatHZ
b428fa1339
fix(trace): fix commit state when tracing (#451)
* fix(trace): fix commit state when tracing

* bump version
2023-08-07 14:15:21 +08:00
Nazarii Denha
7b75f163b0
feat(rpc): add scroll_getBlockByNumber (#413)
* add scroll_getBlockByNumber rpc api

* bump version

* fix

* bump version

* Update version.go

* Revert "Update version.go"

This reverts commit 1be1d9c4fdbb64254659ac193cffd23dbbacfb5e.

---------

Co-authored-by: Péter Garamvölgyi <peter@scroll.io>
Co-authored-by: HAOYUatHZ <37070449+HAOYUatHZ@users.noreply.github.com>
Co-authored-by: HAOYUatHZ <haoyu@protonmail.com>
2023-08-01 15:32:12 +02:00
HAOYUatHZ
2f9edf73ca
feat(rollup): add circuits capacity checker (#321)
* 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

* enable (sync) tracing by default

* basic

* init cgo framework

* fix break loop

* integrate the right zkevm version (#323)

* finish rust codes

* use dylib (#325)

* flip

* ?

* use cdylib

* revert

* fix

* apply_tx

* rename

* fixing types

fixing types

fixing types

* clean up

* ExecutionResults (#328)

* filling

* filling

* more

* clean up

* filling

* coinbase

* add

* MPTWitness

* ExecutionResults WIP

* L1fee

L1fee

* sender

* to

* Failed & ReturnValue

* createdAcc & after

* remove MPTWitness

* txStorageTrace

* add FeeRecipient

* add StorageTrace

* fix FFI types

* better logger

* cargo fmt

* fix

* add build tags

* update Makefile

* fix library

* improve ld path

* correctly deal with circuit_capacity_checker returned result

* fix return value

* update cargo (#333)

* update cargo

* update

* update go

* refactor

* raname `circuits capacity checker` to `circuit capacity checker`

* some refactorings

* [Fix] storage proof generation in capacity checker (#348)

* make per-tx storage and deletion proof work

* format

* fix misplaced markdeletion

---------

Co-authored-by: HAOYUatHZ <haoyu@protonmail.com>

* docker (#363)

* update Dockerfile

* build: update go version to 1.19

* update

* fix

* fix

* try

* simplify

* revert go version

update l2geth Dockerfiles

* fix

* fix coinbase

* fix (#369)

* format

* Update version.go

* address comments

* Capacity refactor (#374)

* init

* id

* support multiple instances

* fix id

* fix conflicts

* refactor to use same codes (#379)

* re-init

* WIP

* WIP

* refactor

* go

* minor

* fix storage proof of l1gas price oracle

* move 1

* move 2

* move 3

* move 4

* move 5

move 5

* move 6

move 6

* move 7

* move 8

* move 9

* move 10

* clean up

clean up

---------

Co-authored-by: Ho Vei <noelwei@gmail.com>

* finish basic

* minor

* config capacity check in block_validator (#380)

* init

* done

ref

* fix tests

fix tests

fix tests

fix tests

* add more comments

* apply_block

* improve logs

* cargo fmt

* Capacity big refactor (#383)

* CreateTraceEnv

* WIP

* draft

more

fix

* for test

* fortet

* clean up

* add more comments

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

* fix typos

* attempt 1

* attempt 2

* attempt 3

* gogogo

* clean up

* fix

* fix

* rename

* minor

* fix

* minor

* minor

* improve doc

* use dedicated `checkCircuitCapacity` flag (#394)

* refactor

* fix

* add lock

* [feat] capacity checking: upgrade libzkp (#395)

* upgrade

* upgrade libzkp

* write RowConsumption (#396)

* write RowConsumption

* name alignments

* revert some formatting

* add lock to CircuitCapacityChecker in BlockValidator

* remove mutex pointer

* improve github workflow

* improve

* store row consumption in mining (#397)

* prepare

* finish

* add more logs

* mark `ApplyBlock` as ready

* update libzkp (#401)

* fix

* Capacity detail (#402)

* fix(block-validation): consider skipping in ValidateL1Messages (#405)

* fix(block-validation): consider skipping in ValidateL1Messages

* fix(block): consider skipping in L1MessageCount

* fix l1 validation tests

* fix NumL1Messages

* fix impl.go return types

fix

* better error handling (#407)

* add

add

* add

* add

* add

* add

* cargo fmt

* add

* update

* add

* WIP

* minor

* gogogo

* gogogo

* fix

* fix

* fix

* cargo clippy

* improve

* improve

* creation lock (#408)

* creation lock

* update

* Debug log (#409)

* add more logs

* more

* more

* fix

* improve

* Update cmd/utils/flags.go

Co-authored-by: Péter Garamvölgyi <peter@scroll.io>

* refactor worker.commit()

* avoid re-calculate

* txpool ccc err handling (#411)

* more explicit error comments

* add more logs

* fix unnecessary commit

* add more logs

* fix `ineffassign`

* add more comments

* log id for `NewCircuitCapacityChecker` (#414)

add log to `NewCircuitCapacityChecker`

* Persist skip info for block where all L1 msgs are skipped (#415)

persist skip info for block where all L1 msgs are skipped

* Update version.go

---------

Co-authored-by: Ho Vei <noelwei@gmail.com>
Co-authored-by: Zhang Zhuo <mycinbrin@gmail.com>
Co-authored-by: Péter Garamvölgyi <peter@scroll.io>
2023-08-01 13:52:31 +08:00
Nazarii Denha
a677ee3ccf
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
2023-07-20 00:10:34 +08:00
Nazarii Denha
3943547960
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 <peter@scroll.io>
2023-07-11 22:07:09 +08:00
Ho
2dcc60a082
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 <37070449+HAOYUatHZ@users.noreply.github.com>
2023-07-07 10:35:19 +08:00
HAOYUatHZ
3cf5ba882d
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 <noelwei@gmail.com>
2023-07-04 22:21:12 +08:00
Péter Garamvölgyi
b14a4024cd
fix: improve L1Message RPC encoding (#368)
correctly encode L1 messages in RPC response
2023-06-19 16:44:04 +02:00
HAOYUatHZ
f055f50f9d
feat: update l1fee calculation (#351) 2023-06-13 10:57:59 +08:00
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
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
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
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
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
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
HAOYUatHZ
11ff7a0648
refactor: rename L1FeeEnabled to FeeVaultEnabled (#281)
rename `L1FeeEnabled` to `FeeVaultEnabled`
2023-04-19 22:41:38 +08: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
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
Ho
8665d3e011
feat(trace): add deletion proof into storage trace (#245)
* update zktrie, inducde proof with deletion

* Add deletion proof for stateDb

* fill deletionproofs

* lint

* proving more comment for parts prone to be confused

* simplify array appending

Co-authored-by: maskpp <maskpp266@gmail.com>

* bump zktrie version and fix issues

* add delproof into witgen

---------

Co-authored-by: maskpp <maskpp266@gmail.com>
2023-03-20 13:44:09 +08:00
maskpp
03b4de32b7
feat(trace): Add chainID and version fields in trace. (#227)
* Add ChainID and version.

* fix comments.

* Update params/version.go

Co-authored-by: HAOYUatHZ <37070449+HAOYUatHZ@users.noreply.github.com>

* fix comments.

* Update version.go

---------

Co-authored-by: HAOYUatHZ <37070449+HAOYUatHZ@users.noreply.github.com>
2023-03-06 21:19:30 +08:00
maskpp
d1f9523b08
feat(build): Upgrade go version to 1.18 (#241)
* update go version

* update go version

* format code by goimports

* format code by goimports

* go mod tidy

* update go version

* update go version

* upgrade linter

* add exclude rule

* fix golangci exclude

---------

Co-authored-by: vincent <419436363@qq.com>
Co-authored-by: HAOYUatHZ <37070449+HAOYUatHZ@users.noreply.github.com>
2023-03-06 13:32:39 +08:00
maskpp
018c2cca43
feat(snapshot): Close snapshot p2p protocol when using zktrie. (#239)
* Close snapshot p2p protocol when use zktrie.

* trigger ci
2023-03-06 12:26:17 +08:00
HAOYUatHZ
4588569b63
feat: VerifyFee for sendTx and txpool.add (#236)
* init

* rework

* handle `LesApiBackend`

* fix tests

* add L1fee even for 0 gasPrice

* update comments
2023-03-02 16:38:43 +08:00
maskpp
15f94b93ea
fix(trace): Fix l1Fee (#234)
Fix l1Fee
2023-02-24 14:04:25 +08:00
HAOYUatHZ
ec9254b0b1
feat: compute rollup gas price for StateTransition (#209)
* init

* more

* more

* add L1BlockContainerAddress

* finish

* add more comments

* rename `UsingSVM` to `UsingScroll`

* update logic

* refactor(rollup): add UsingScroll into ChainConfig

* update

* update comments

* fee=l2fee+l1fee (#221)

add l1fee into calc

* improve

* format note content.

* feat(l1Fee): Add l1Fee in trace. (#223)

* Add l1fee in trace.

* Delete comment.

---------

Co-authored-by: maskpp <maskpp266@gmail.com>
2023-02-20 16:28:43 +08:00
HAOYUatHZ
8a78c736a5
feat(trace): add withdraw trie root (#217)
* init rollup/rcfg/config.go

minor

* update traces struct

* init withdraw_trie.go

* finish

* fix `L2MessageQueueAddress`

* refactor(rollup): add `UsingScroll` into `ChainConfig` (#218)

* update comments

* update comments
2023-02-16 10:18:47 +08:00
HAOYUatHZ
0854d4bbb1
core, trie, eth, cmd: rework preimage store (#205)
* core, trie, eth, cmd: rework preimage store

* fix ci

* fix ci

* Update zk_trie_database.go

---------

Co-authored-by: rjl493456442 <garyrong0905@gmail.com>
Co-authored-by: maskpp <maskpp266@gmail.com>
2023-02-10 15:26:57 +08:00
Nazarii Denha
aae2ea53df
feat: include fee vault address in trace api result (#208)
* include fee vault address in trace api result

* use fee vault instead of coinbase if exists

* retrigger checks

* Update api_blocktrace_test.go

---------

Co-authored-by: maskpp <maskpp266@gmail.com>
Co-authored-by: HAOYUatHZ <37070449+HAOYUatHZ@users.noreply.github.com>
2023-02-10 15:13:46 +08:00
Péter Garamvölgyi
81e7775aa8
feat: dual code hash (#188)
* add KeccakCodeHash and CodeSize to StateAccount

* update StateAccount marshalling logic

* change emptyCodeHash to poseidon(nil)

* purge StateAccount.hash

* fix/disable failing tests

* change keccak and poseidon hash order in StateAccount

* fix lint

* update l2trace account wrapper

* update eth_getProof response type

* fix eth_getProof response type

* goimports

* update the codehash computation

* update the codehash test cases

* go mod tidy

* fix tests

* use keccak instead of poseidon

* update trace codehash field name

* upgrade zktrie to 4.2

* trigger ci

* update state account marshalling according to spec

* improve generatorStats estimation

* add comment

* upgrade zktrie to 4.3

* go mod tidy

* misc fixes

* fix TestDump

* fix snap sync tests

* handle err in the codehash

* fix tests in snapshot/generate_test.go

* remove prevhash from state journal

* add state_account_marshalling_test.go

* goimports

* add more tests

---------

Co-authored-by: Ho Vei <noelwei@gmail.com>
Co-authored-by: Haichen Shen <shenhaichen@gmail.com>
2023-02-08 16:12:41 -08:00
maskpp
804e7edc23
refactor: rename NewTraceTransaction to NewTransactionData (#190)
rename NewTraceTransaction to NewTransactionData
2022-12-02 14:12:07 +08:00
maskpp
4ea77a7577
feat(tx): revert tx trace struct (#186)
revert tx trace struct
2022-11-25 10:56:12 +08:00
maskpp
22963a115d
feat(trace): Add header and upgrade TransactionTrace (#181)
* Add header and upgrade TransactionTrace

* Add header

* change blockResult struct

* rm chainID from TransactionData

* Rename blockResult to blockTrace in everywhere

* fix comments
2022-11-18 17:11:04 +08:00
maskpp
ca2e576d81
avoid the unexpected situation (#163) 2022-09-26 10:32:47 +08:00
maskpp
15391eeaf7
feat: add replay blockResult API (#139)
* replay trace

* replay trace

* add sdk

* fix trace test case

* fix bug

* Update eth/tracers/api_blockResult.go

Co-authored-by: Haichen Shen <shenhaichen@gmail.com>

* Update eth/tracers/api_blockResult.go

Co-authored-by: Haichen Shen <shenhaichen@gmail.com>

* Update eth/tracers/api_blockResult.go

Co-authored-by: Haichen Shen <shenhaichen@gmail.com>

* Update eth/tracers/api_blockResult.go

Co-authored-by: Haichen Shen <shenhaichen@gmail.com>

* add comments

* fail the rpc call if get error

* adjust channel length

* fix bug

* fix bug

* remove redundant codes in worker

* add test case

* fix bug

* fix goimports

* Update eth/tracers/api_blockResult.go

Co-authored-by: HAOYUatHZ <37070449+HAOYUatHZ@users.noreply.github.com>

* fix comments

* Update ethclient/ethclient.go

Co-authored-by: Haichen Shen <shenhaichen@gmail.com>

* Update ethclient/ethclient.go

Co-authored-by: Haichen Shen <shenhaichen@gmail.com>

* rm coinbase api in miner

* fix comment

* Update eth/tracers/api.go

Co-authored-by: Haichen Shen <shenhaichen@gmail.com>

* fix comment

Co-authored-by: HAOYUatHZ <37070449+HAOYUatHZ@users.noreply.github.com>
Co-authored-by: Haichen Shen <shenhaichen@gmail.com>
2022-09-20 14:30:57 +08:00