Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

eth/downloader: implement beacon sync #23982

Merged
merged 22 commits into from
Mar 11, 2022

Conversation

karalabe
Copy link
Member

No description provided.

@MariusVanDerWijden
Copy link
Member

@karalabe Could you add this commit on top? MariusVanDerWijden@63a8982

Copy link
Member

@MariusVanDerWijden MariusVanDerWijden left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've also added this diff to enable the sync (don't know if we want to do it in this pr or a follow-up)

diff --git a/eth/catalyst/api.go b/eth/catalyst/api.go
index 1c3d65a1c..cd1d98a01 100644
--- a/eth/catalyst/api.go
+++ b/eth/catalyst/api.go
@@ -260,13 +260,14 @@ func (api *ConsensusAPI) ExecutePayloadV1(params ExecutableDataV1) (ExecutePaylo
                }
                return ExecutePayloadResponse{Status: VALID.Status, LatestValidHash: block.Hash()}, nil
        }
+       if b := api.eth.BlockChain().GetBlockByHash(params.BlockHash); b != nil && b.NumberU64() == block.NumberU64() {
+               log.Info("Ignoring already processed block", "number", params.Number, "hash", params.BlockHash)
+               return ExecutePayloadResponse{Status: VALID.Status, LatestValidHash: block.Hash()}, nil
+       }
        if !api.eth.BlockChain().HasBlock(block.ParentHash(), block.NumberU64()-1) {
-               /*
-                       TODO (MariusVanDerWijden) reenable once sync is merged
-                       if err := api.eth.Downloader().BeaconSync(api.eth.SyncMode(), block.Header()); err != nil {
-                               return SYNCING, err
-                       }
-               */
+               if err := api.eth.Downloader().BeaconSync(api.eth.SyncMode(), block.Header()); err != nil {
+                       return ExecutePayloadResponse{Status: SYNCING.Status, LatestValidHash: common.Hash{}}, err
+               }
                // TODO (MariusVanDerWijden) we should return nil here not empty hash
                return ExecutePayloadResponse{Status: SYNCING.Status, LatestValidHash: common.Hash{}}, nil
        }
        ```

eth/sync.go Outdated Show resolved Hide resolved
eth/downloader/beaconsync.go Outdated Show resolved Hide resolved
eth/catalyst/api.go Show resolved Hide resolved
eth/downloader/beaconsync.go Outdated Show resolved Hide resolved
eth/downloader/skeleton.go Show resolved Hide resolved
@MariusVanDerWijden
Copy link
Member

MariusVanDerWijden commented Mar 2, 2022

make the linter happy:

diff --git a/eth/catalyst/api.go b/eth/catalyst/api.go
index 8f966229e..5e79e9a88 100644
--- a/eth/catalyst/api.go
+++ b/eth/catalyst/api.go
@@ -147,7 +147,7 @@ func (api *ConsensusAPI) ForkchoiceUpdatedV1(update beacon.ForkchoiceStateV1, pa
        }
        // If payload generation was requested, create a new block to be potentially
        // sealed by the beacon client. The payload will be requested later, and we
-       // might replace it arbitrarilly many times in between.
+       // might replace it arbitrarily many times in between.
        if payloadAttributes != nil {
                log.Info("Creating new payload for sealing")
                start := time.Now()
@@ -183,7 +183,7 @@ func (api *ConsensusAPI) ExecutePayloadV1(params beacon.ExecutableDataV1) (beaco
        if err != nil {
                return api.invalid(), err
        }
-       // If we alreayd have the block locally, ignore the entire execution and just
+       // If we already have the block locally, ignore the entire execution and just
        // return a fake success.
        if block := api.eth.BlockChain().GetBlockByHash(params.BlockHash); block != nil {
                log.Warn("Ignoring already known beacon payload", "number", params.Number, "hash", params.BlockHash, "age", common.PrettyAge(time.Unix(int64(block.Time()), 0)))
@@ -191,7 +191,7 @@ func (api *ConsensusAPI) ExecutePayloadV1(params beacon.ExecutableDataV1) (beaco
        }
        // If the parent is missing, we - in theory - could trigger a sync, but that
        // would also entail a reorg. That is problematic if multiple sibling blocks
-       // are being fed to us, and even moreso, if some semi-distant uncle shortens
+       // are being fed to us, and even more so, if some semi-distant uncle shortens
        // our live chain. As such, payload execution will not permit reorgs and thus
        // will not trigger a sync cycle. That is fine though, if we get a fork choice
        // update after legit payload executions.
diff --git a/eth/downloader/beaconsync.go b/eth/downloader/beaconsync.go
index 5afd7292b..2a2e0d6b0 100644
--- a/eth/downloader/beaconsync.go
+++ b/eth/downloader/beaconsync.go
@@ -275,7 +275,7 @@ func (d *Downloader) fetchBeaconHeaders(from uint64) error {
                        }
                }
                // State sync still going, wait a bit for new headers and retry
-               log.Trace("Pivot not yet comitted, waiting...")
+               log.Trace("Pivot not yet committed, waiting...")
                select {
                case <-time.After(fsHeaderContCheck):
                case <-d.cancelCh:
diff --git a/eth/downloader/skeleton.go b/eth/downloader/skeleton.go
index 67fe39d05..376bca898 100644
--- a/eth/downloader/skeleton.go
+++ b/eth/downloader/skeleton.go
@@ -238,7 +238,7 @@ func (s *skeleton) startup() {
 
        // Wait for startup or teardown. This wait might loop a few times if a beacon
        // client requests sync head extensions, but not forced reorgs (i.e. they are
-       // giving us new payloads without setting a starting head intially).
+       // giving us new payloads without setting a starting head initially).
        for {
                select {
                case errc := <-s.terminate:
diff --git a/eth/downloader/skeleton_test.go b/eth/downloader/skeleton_test.go
index 0aeabd87b..2d802c27d 100644
--- a/eth/downloader/skeleton_test.go
+++ b/eth/downloader/skeleton_test.go
@@ -71,7 +71,7 @@ func (hf *hookedBackfiller) resume() {
 }
 
 // skeletonTestPeer is a mock peer that can only serve header requests from a
-// pre-perated header chain (which may be arbitrarilly wrong for testing).
+// pre-perated header chain (which may be arbitrarily wrong for testing).
 //
 // Requesting anything else from these peers will hard panic. Note, do *not*
 // implement any other methods. We actually want to make sure that the skeleton
@@ -511,7 +511,7 @@ func TestSkeletonSyncRetrievals(t *testing.T) {
 
                head     *types.Header       // New head header to announce to reorg to
                peers    []*skeletonTestPeer // Initial peer set to start the sync with
-               midstate []*subchain         // Expected sync state after inital cycle
+               midstate []*subchain         // Expected sync state after initial cycle
                midserve uint64              // Expected number of header retrievals after initial cycle
                middrop  uint64              // Expectd number of peers dropped after initial cycle

@karalabe karalabe force-pushed the beacon-sync-final branch from a78f7c3 to 71861e7 Compare March 7, 2022 18:52
eth/downloader/downloader.go Outdated Show resolved Hide resolved
return fmt.Errorf("%w: parent TD missing", errInvalidChain)
}
for i, result := range results {
td = new(big.Int).Add(td, result.Header.Difficulty)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
td = new(big.Int).Add(td, result.Header.Difficulty)
td.Add(td, result.Header.Difficulty)

?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not a fan of that form as it's easy to misuse. This code isn't particularly critical, so I'm happier with a slightly more cleanlyness.

results, rejected = results[:i+1], results[i+1:]
if len(rejected) > 0 {
// Make a nicer user log as to the first TD truly rejected
td = new(big.Int).Add(td, rejected[0].Header.Difficulty)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
td = new(big.Int).Add(td, rejected[0].Header.Difficulty)
td.Add(td, rejected[0].Header.Difficulty)

?

@@ -92,6 +95,7 @@ var (
SnapshotAccountPrefix = []byte("a") // SnapshotAccountPrefix + account hash -> account trie value
SnapshotStoragePrefix = []byte("o") // SnapshotStoragePrefix + account hash + storage hash -> storage trie value
CodePrefix = []byte("c") // CodePrefix + code hash -> account code
skeletonHeaderPrefix = []byte("S") // skeletonHeaderPrefox + num (uint64 big endian) -> header
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe use something that doesn't clash with the meta entries.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Myeah, changing this would cause all merge testnet nodes to blow up since they'd need a database upgrade (i.e. resync). I don't really see it as valuable as how much a PITA it is to change.

eth/downloader/skeleton.go Outdated Show resolved Hide resolved
eth/downloader/skeleton.go Show resolved Hide resolved
eth/downloader/skeleton.go Show resolved Hide resolved
eth/downloader/skeleton.go Show resolved Hide resolved
@@ -1380,6 +1390,13 @@ func (d *Downloader) processHeaders(origin uint64, td, ttd *big.Int, beaconMode
rollback = 1
}
}
if len(rejected) != 0 {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if the last chunkHeader is the final PoW-block, then len(rejected) will be 0, but we still would have wanted to enter here, no?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My gut feeling is that we don't want to, since everything can be successfully imported. The error should be triggered only if you attempt to import something after the merge block. It should get triggered when the next batch of something is attempted to be imported.

// Merge threshold reached, stop importing, but don't roll back
rollback = 0

log.Info("Legacy sync reached merge threshold", "number", rejected[0].Number, "hash", rejected[0].Hash(), "td", td, "ttd", ttd)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The number reported here is the first rejected, so,
block-n, transition-block, invalid-block-1,..., the invalid-block-1 is what it will output. Seems not the right thing to output?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, that's exactly what I wanted to output. The block that's imported is not that relevant since we have import logs too as well as it's part of the chain so can be retrieved. What I'm interested to see is the details of the block that is rejected so I can look it up or investigate.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But -- if all our peers are well-behaving, they won't send us PoS blocks over the network, will they? Just want to avoid the scenario where we wait for the fist non-pow header to abort our cycle and "officially enter beacon mode", but our peers aren't delivering it because it's PoS.

@@ -19,10 +19,25 @@ package beacon
import "github.com/ethereum/go-ethereum/rpc"

var (
VALID = GenericStringResponse{"VALID"}

This comment was marked as spam.

@@ -19,10 +19,25 @@ package beacon
import "github.com/ethereum/go-ethereum/rpc"

var (
VALID = GenericStringResponse{"VALID"}

This comment was marked as spam.

@@ -19,10 +19,25 @@ package beacon
import "github.com/ethereum/go-ethereum/rpc"

var (
VALID = GenericStringResponse{"VALID"}
SUCCESS = GenericStringResponse{"SUCCESS"}
INVALID = ForkChoiceResponse{Status: "INVALID", PayloadID: nil}

This comment was marked as spam.

// VALID is returned by the engine API in the following calls:
// - newPayloadV1: if the payload was already known or was just validated and executed
// - forkchoiceUpdateV1: if the chain accepted the reorg (might ignore if it's stale)
VALID = "VALID"

This comment was marked as spam.

SYNCING = ForkChoiceResponse{Status: "SYNCING", PayloadID: nil}
// VALID is returned by the engine API in the following calls:
// - newPayloadV1: if the payload was already known or was just validated and executed
// - forkchoiceUpdateV1: if the chain accepted the reorg (might ignore if it's stale)

This comment was marked as spam.

// gone stale and monitor them. However, in that case too, we need a way
// to protect against malicious peers never responding, so it would need
// a second, hard-timeout mechanism.
s.drop(peer.id)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As it's implemented here, the timeout is based on ttl := s.peers.rates.TargetTimeout(). So this might feasibly happen:

  • One super-fast peer with good connection obtains a ttl of 5ms.
  • 10 laggy peers obtain ttls of 500ms.
  • The fast peer hits a slow-down, and takes 100ms for a delivery.
  • We drop it the fast peer, and only keep the slow ones.

Haven't checked if the numbers I made up make any sense, but you probably understand the idea.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The message rate tracker tries to track the median RTT across all peers. The timeout is the median RTT multiplied by some confidence number.

In your specific scenario, if you have one super fast peer and many laggy ones, the TTL will be the laggy value since that's the median. Even if your fast peer returns a bit slow once, it should still be fine.

Copy link
Contributor

@holiman holiman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some nits, generally LGTM

eth/api.go Outdated Show resolved Hide resolved
eth/downloader/downloader.go Show resolved Hide resolved
// Merge threshold reached, stop importing, but don't roll back
rollback = 0

log.Info("Legacy sync reached merge threshold", "number", rejected[0].Number, "hash", rejected[0].Hash(), "td", td, "ttd", ttd)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But -- if all our peers are well-behaving, they won't send us PoS blocks over the network, will they? Just want to avoid the scenario where we wait for the fist non-pow header to abort our cycle and "officially enter beacon mode", but our peers aren't delivering it because it's PoS.

eth/sync.go Outdated
// If we've reached the merge transition but no beacon client is available, or
// it has not yet switched us over, keep warning the user that their infra is
// potentially flaky.
if err == downloader.ErrMergeTransition && time.Since(cs.warned) > 10*time.Second {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if err == downloader.ErrMergeTransition && time.Since(cs.warned) > 10*time.Second {
if errors.Is(err,downloader.ErrMergeTransition) && time.Since(cs.warned) > 10*time.Second {

@karalabe
Copy link
Member Author

GitHub doesn't allow me to answer on this, weird:

But -- if all our peers are well-behaving, they won't send us PoS blocks over the network, will they? Just want to avoid the scenario where we wait for the fist non-pow header to abort our cycle and "officially enter beacon mode", but our peers aren't delivering it because it's PoS.

That's not the case. Here we're in the downloader and we're actively requesting data. The peers will deliver what we request. We still need to detect that what we've requested passed the merge threshold (we don't know in advance due to the TTD mechanism).

@karalabe karalabe added this to the 1.10.17 milestone Mar 11, 2022
@karalabe karalabe merged commit 8f66ea3 into ethereum:master Mar 11, 2022
sidhujag pushed a commit to syscoin/go-ethereum that referenced this pull request Mar 11, 2022
JacekGlen pushed a commit to JacekGlen/go-ethereum that referenced this pull request May 26, 2022
* eth/downloader: implement beacon sync

* eth/downloader: fix a crash if the beacon chain is reduced in length

* eth/downloader: fix beacon sync start/stop thrashing data race

* eth/downloader: use a non-nil pivot even in degenerate sync requests

* eth/downloader: don't touch internal state on beacon Head retrieval

* eth/downloader: fix spelling mistakes

* eth/downloader: fix some typos

* eth: integrate legacy/beacon sync switchover and UX

* eth: handle UX wise being stuck on post-merge TTD

* core, eth: integrate the beacon client with the beacon sync

* eth/catalyst: make some warning messages nicer

* eth/downloader: remove Ethereum 1&2 notions in favor of merge

* core/beacon, eth: clean up engine API returns a bit

* eth/downloader: add skeleton extension tests

* eth/catalyst: keep non-kiln spec, handle mining on ttd

* eth/downloader: add beacon header retrieval tests

* eth: fixed spelling, commented failing tests out

* eth/downloader: review fixes

* eth/downloader: drop peers failing to deliver beacon headers

* core/rawdb: track beacon sync data in db inspect

* eth: fix review concerns

* internal/web3ext: nit

Co-authored-by: Marius van der Wijden <m.vanderwijden@live.de>
cp-wjhan pushed a commit to cp-yoonjin/go-wemix that referenced this pull request Nov 16, 2022
* eth/downloader: implement beacon sync

* eth/downloader: fix a crash if the beacon chain is reduced in length

* eth/downloader: fix beacon sync start/stop thrashing data race

* eth/downloader: use a non-nil pivot even in degenerate sync requests

* eth/downloader: don't touch internal state on beacon Head retrieval

* eth/downloader: fix spelling mistakes

* eth/downloader: fix some typos

* eth: integrate legacy/beacon sync switchover and UX

* eth: handle UX wise being stuck on post-merge TTD

* core, eth: integrate the beacon client with the beacon sync

* eth/catalyst: make some warning messages nicer

* eth/downloader: remove Ethereum 1&2 notions in favor of merge

* core/beacon, eth: clean up engine API returns a bit

* eth/downloader: add skeleton extension tests

* eth/catalyst: keep non-kiln spec, handle mining on ttd

* eth/downloader: add beacon header retrieval tests

* eth: fixed spelling, commented failing tests out

* eth/downloader: review fixes

* eth/downloader: drop peers failing to deliver beacon headers

* core/rawdb: track beacon sync data in db inspect

* eth: fix review concerns

* internal/web3ext: nit

Co-authored-by: Marius van der Wijden <m.vanderwijden@live.de>
FletcherMan added a commit to morph-l2/go-ethereum that referenced this pull request Aug 28, 2023
* 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 <peter@scroll.io>

* 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>

* 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: 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>

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

* 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>

* 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>

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

* 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>

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

* 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>

* 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>

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

* 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 <37070449+HAOYUatHZ@users.noreply.github.com>

* 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>

* 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>

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

* 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>

* 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>

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

* 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>

* 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 <noelwei@gmail.com>
Co-authored-by: Péter Garamvölgyi <th307q@gmail.com>
Co-authored-by: HAOYUatHZ <37070449+HAOYUatHZ@users.noreply.github.com>
Co-authored-by: Nazarii Denha <dengaaa2002@gmail.com>
Co-authored-by: maskpp <maskpp266@gmail.com>
Co-authored-by: Richord <rzhang139@gmail.com>

* 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>

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

* update docker-compose

* 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>

* 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>

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

* 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>

* 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>

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

* 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>

* 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 <37070449+HAOYUatHZ@users.noreply.github.com>

* 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>

* 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>

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

* 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>

* 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>

* 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>

* remove syncing L1 messages related, it is migrated to node service

---------

Co-authored-by: Ho <noelwei@gmail.com>
Co-authored-by: Péter Garamvölgyi <th307q@gmail.com>
Co-authored-by: HAOYUatHZ <37070449+HAOYUatHZ@users.noreply.github.com>
Co-authored-by: Nazarii Denha <dengaaa2002@gmail.com>
Co-authored-by: maskpp <maskpp266@gmail.com>
Co-authored-by: Richord <rzhang139@gmail.com>
Co-authored-by: Péter Garamvölgyi <peter@scroll.io>
Co-authored-by: colin <102356659+colinlyguo@users.noreply.github.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 <haoyu@protonmail.com>

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

* Update core/vm/runtime/runtime_test.go

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

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

* 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 <37070449+HAOYUatHZ@users.noreply.github.com>

* Update cmd/abigen/main.go

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

* Update cmd/abigen/main.go

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

* Update cmd/abigen/main.go

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

* fix bug

---------

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

* 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 <marvel.yu@bitget.com>

* Morph testnet deploy v0.0.1 (#18)

* add testnet geth config file

* add nohub to geth cmd

---------

Co-authored-by: Yu Marvel <marvel.yu@bitget.com>

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

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

* 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 <37070449+HAOYUatHZ@users.noreply.github.com>

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

* 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>

* 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 <marvel.yu@bitget.com>

* fix compile error testcase

* update run testnet shell (#23)

Co-authored-by: Yu Marvel <marvel.yu@bitget.com>

* improve

* Feature/testnet runner (#24)

* update run testnet shell

* refine run testnet sh

---------

Co-authored-by: Yu Marvel <marvel.yu@bitget.com>

* Feature/testnet runner (#25)

* update run testnet shell

* refine run testnet sh

* refine testnet runner

---------

Co-authored-by: Yu Marvel <marvel.yu@bitget.com>

* 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 <marvel.yu@bitget.com>

* 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 <marvel.yu@bitget.com>

* 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 <marvel.yu@bitget.com>

---------

Co-authored-by: marvelfisher <marvelfisher@gmail.com>
Co-authored-by: Péter Garamvölgyi <th307q@gmail.com>
Co-authored-by: Max Wolff <max@scroll.io>
Co-authored-by: Nazarii Denha <dengaaa2002@gmail.com>
Co-authored-by: Péter Garamvölgyi <peter@scroll.io>
Co-authored-by: Marius van der Wijden <m.vanderwijden@live.de>
Co-authored-by: Orest Tarasiuk <830847+OrestTa@users.noreply.github.com>
Co-authored-by: Péter Szilágyi <peterke@gmail.com>
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: Ho <noelwei@gmail.com>
Co-authored-by: HAOYUatHZ <37070449+HAOYUatHZ@users.noreply.github.com>
Co-authored-by: maskpp <maskpp266@gmail.com>
Co-authored-by: Richord <rzhang139@gmail.com>
Co-authored-by: colin <102356659+colinlyguo@users.noreply.github.com>
Co-authored-by: Ubuntu <ubuntu@ip-172-31-14-253.us-west-2.compute.internal>
Co-authored-by: Haichen Shen <shenhaichen@gmail.com>
Co-authored-by: Max Wolff <maxcwolff@gmail.com>
Co-authored-by: HAOYUatHZ <haoyu@protonmail.com>
Co-authored-by: Yu Marvel <marvel.yu@bitget.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants