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

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>
bgelb added a commit to bgelb/go-ethereum that referenced this pull request Jun 16, 2022
* core/types: improve error for too short transaction / receipt encoding (ethereum#24256)


Co-authored-by: Felix Lange <fjl@twurst.com>

* rlp, trie: faster trie node encoding (ethereum#24126)

This change speeds up trie hashing and all other activities that require
RLP encoding of trie nodes by approximately 20%. The speedup is achieved by
avoiding reflection overhead during node encoding.

The interface type trie.node now contains a method 'encode' that works with
rlp.EncoderBuffer. Management of EncoderBuffers is left to calling code.
trie.hasher, which is pooled to avoid allocations, now maintains an
EncoderBuffer. This means memory resources related to trie node encoding
are tied to the hasher pool.

Co-authored-by: Felix Lange <fjl@twurst.com>

* cmd/geth: make authrpc listening address settable from command line (ethereum#24522)

The default listening address "localhost" is not sufficient when running
geth in Docker.

* core, ethdb, tests, trie: introduce database snapshot (ethereum#24486)

* core/rawdb, cmd, ethdb, eth: implement freezer tail deletion (ethereum#23954)

* core/rawdb, cmd, ethdb, eth: implement freezer tail deletion

* core/rawdb: address comments from martin and sina

* core/rawdb: fixes cornercase in tail deletion

* core/rawdb: separate metadata into a standalone file

* core/rawdb: remove unused code

* core/rawdb: add random test

* core/rawdb: polish code

* core/rawdb: fsync meta file before manipulating the index

* core/rawdb: fix typo

* core/rawdb: address comments

* eth/protocols/snap: avoid estimating infinite percentage

* graphql: fee history fields (ethereum#24452)

This PR adds the `NextBaseFeePerGas` to `Block` and `EffectiveTip` to `Transaction` to make it easier for clients to compute fee history themselves via graphql queries.

* eth/protocols/snap: a little typo Merkel -> Merkle (ethereum#24530)

* eth/downloader: implement beacon sync (ethereum#23982)

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

* rpc: fix defer in test (ethereum#24490)


Co-authored-by: Felix Lange <fjl@twurst.com>

* go.mod: upgrade upnp dependency (ethereum#24536)

* core/rawdb: add specified key length iterator (ethereum#24535)

* trie: fix two issues in trie iterator (ethereum#24539)

* trie: fix memory leak in trie iterator

In the trie iterator, live nodes are tracked in a stack while iterating.
Popped node states should be explictly set to nil in order to get
garbage-collected.

* trie: fix empty trie iterator

* build: fix linter install on windows (ethereum#24523)

* eth/tracers: use hex encoding for debug_traceBlock argument (ethereum#24517)

* cmd/geth: set EnableBashCompletion = true (ethereum#24313)

prepare ethereum#24145

* cmd/geth: rename --whitelist to --eth.requiredblocks (ethereum#24505)

* cmd, eth: Rename whitelist argument to peer.requiredblocks

* eth/ethconfig: document PeerRequiredBlocks better

* cmd/utils: rename new flag to --eth.requiredblocks

Co-authored-by: Felix Lange <fjl@twurst.com>

* build, Dockerfile: bump Go to 1.18

* eth/downloader: fix off-by-one error in test causing 50% fails

* les, tests: fix vflux fuzzer by removing unnecessary panic (ethereum#24537)

* crypto: use btcec/v2 for no-cgo (ethereum#24533)

This updates the no-cgo implementations in the crypto package to use
the github.com/btcsuite/btcd/btcec/v2 module instead of the older btcec
package that was part of the main github.com/btcsuite/btcd module.

name                   old time/op  new time/op  delta
EcrecoverSignature-32   198µs ± 0%   144µs ± 0%  -27.11%
VerifySignature-32      177µs ± 0%   128µs ± 0%  -27.44%
DecompressPubkey-32    20.9µs ± 0%  10.1µs ± 0%  -51.51%

Use (*ModNScalar).IsOverHalfOrder instead of math/big.Int when checking
for malleable signatures.

* core: eth: implement Kiln-v2 spec (ethereum#24506)

* core/beacon: eth/catalyst: updated engine api to new version

* core: implement exchangeTransitionConfig

* core/beacon: prevRandao instead of Random

* eth/catalyst: Fix ExchangeTransitionConfig, add test

* eth/catalyst: stop external miners on TTD reached

* node: implement --authrpc.vhosts flag

* core: allow for config override on non-mainnet networks

* eth/catalyst: fix peters comments

* eth/catalyst: make stop remote sealer more explicit

* eth/catalyst: add log output

* cmd/utils: rename authrpc.host to authrpc.addr

* eth/catalyst: disable the disabling of the miner

* eth: core: remove notion of terminal pow block

* eth: les: more of peters nitpicks

* core, params: add kiln flag (ethereum#24548)

* docs/postmortems: fix spelling (ethereum#24558)

* eth/downloader: terminate beacon sync early when linked to local chain (ethereum#24550)

* eth/downloader: terminate beacon sync early when linked to local chain

* eth/downloader: fix backfiller resume on early beacon termination

* core/rawdb: fix db commands (ethereum#24540)

* crypto/bls12381: go format

* core: store genesis allocation and recommit them if necessary (ethereum#24460)

* core: store genesis allocation and recommit them if necessary

* core: recover predefined genesis allocation if possible

* eth/downloader: ignore zero size header batch for importing (ethereum#24569)

* eth/downloader: ignore zero size header batch for importing

* core, light: reject empty header batch for importing

* core/rawdb: simple legacy receipt converter (ethereum#24028)

* cmd,core: add simple legacy receipt converter

core/rawdb: use forEach in migrate

core/rawdb: batch reads in forEach

core/rawdb: make forEach anonymous fn

cmd/geth: check for legacy receipts on node startup

fix err msg

Co-authored-by: rjl493456442 <garyrong0905@gmail.com>

fix log

Co-authored-by: rjl493456442 <garyrong0905@gmail.com>

fix some review comments

add warning to cmd

drop isLegacy fn from migrateTable params

add test for windows rename

test replacing in windows case

* minor fix

* sanity check for tail-deletion

* add log before moving files around

* speed-up hack for mainnet

* fix mainnet check, use networkid instead

* check mainnet genesis

* review fixes

* resume previous migration attempt

* core/rawdb: lint fix

Co-authored-by: Martin Holst Swende <martin@swende.se>

* eth/downloader: fix flakey test (ethereum#24576)

* eth/catalyst: fix log message (ethereum#24574)

* node: allow JWT pass by file only (ethereum#24579)

* build: upgrade to golangci-lint v1.45.2 (ethereum#24586)

* internal/build: show ppa upload process stdout on stdout (ethereum#24588)

* internal/build: prevent travis timeout during ppa upload (ethereum#24589)

* internal/build: exit sftp upload (ethereum#24590)

* build: close sftp connection when done (ethereum#24593)

* core: set ttd override on all chain variations

* core/vm: fix sstore gas comment type (ethereum#24583)

* cmd/geth: change to non-fatal error message when legacy receipt storage is not implemented (ethereum#24603)

* cmd/geth: only check for presence of legacy receipts if developer mode is not enabled

* cmd/geth: degrade log level

* cmd/geth: fix format

Co-authored-by: Gary Rong <garyrong0905@gmail.com>

* eth/catalyst: only apply block if we actually have the state (ethereum#24598)

* eth/catalyst: only apply block if we actually have the state

* add header to payload queue

* Update cmd/geth/dbcmd.go

Co-authored-by: Martin Holst Swende <martin@swende.se>

Co-authored-by: Martin Holst Swende <martin@swende.se>

* params: go-ethereum v1.10.17 stable

* params: begin v1.10.18 release cycle

* rlp: fix typo in comment (ethereum#24595)

Co-authored-by: Yong Yang <yangyong775654@163.com>

* core/state/snapshot: clean up the generation code (ethereum#24479)

* go.mod : upnp 1.0.3 stable version (ethereum#24573)

* internal/ethapi: add refund to StructLogRes (ethereum#24567)

* internal/ethapi: add refund to StructLogRes

* Update internal/ethapi/api.go

Co-authored-by: rjl493456442 <garyrong0905@gmail.com>

Co-authored-by: rjl493456442 <garyrong0905@gmail.com>

* eth/tracers/logger: use omitempty to reduce log bloat  (ethereum#24547)

Makes the evm json output less verbose: omitting output of `memory` and `returndata` in case they are empty.

* common/compiler: add extra include paths to solidity compiler (ethereum#24541)

This PR adds a ExtraAllowedPath field to Solidity and exposes two APIs: CompileSource and CompileFiles, which were hidden inside CompileSolidityString and CompileSolidity before.

* core: verify genesis extradata for clique (ethereum#24470)

* Add extra-data checks for clique genesis

* Update genesis.go

* Update genesis.go

* core: simplify clique genesis check

Co-authored-by: Felix Lange <fjl@twurst.com>
Co-authored-by: Martin Holst Swende <martin@swende.se>

* eth: change snapshot extension registration failure to warning instead of error (ethereum#24475)

* core: Change Snapshot extension registration failed to Debug

* Update eth/handler.go

Co-authored-by: Martin Holst Swende <martin@swende.se>

* trie, les, tests, core: implement trie tracer (ethereum#24403)

Trie tracer is an auxiliary tool to capture all deleted nodes
which can't be captured by trie.Committer. The deleted nodes
can be removed from the disk later.

* core,eth: implement tx-level hooks for tracers (ethereum#24510)

* core,eth: add empty tx logger hooks

* core,eth: add initial and remaining gas to tx hooks

* store tx gasLimit in js tracer

* use gasLimit to compute intrinsic cost for js tracer

* re-use rules in transitiondb

* rm logs

* rm logs

* Mv some fields from Start to TxStart

* simplify sender lookup in prestate tracer

* mv env to TxStart

* Revert "mv env to TxStart"

This reverts commit 6569396.

* Revert "simplify sender lookup in prestate tracer"

This reverts commit ab65bce.

* Revert "Mv some fields from Start to TxStart"

This reverts commit aa50d3d.

* fix intrinsic gas for prestate tracer

* add comments

* refactor

* fix test case

* simplify consumedGas calc in prestate tracer

* eth: clarify the error string on getlogs failure (ethereum#24617)

This PR makes the errors we spit out a bit more clear about what block is problematic.

* eth/downloader: retrieve pivot header from local chain if necessary (ethereum#24610)

* eth/downloader: retrieve pivot header from local chain if necessary

* eth/downloader: improve readability

* eth/downloader: update fix

* eth/downloader: add beacon sync tests

* eth/downloader: remove duplicated code

* README: update free space required (ethereum#24636)

* rpc: fixed a typo (ethereum#24642)

* eth/fetcher: if peers never respond, drop them

* eth/tracers: refactor traceTx to separate out struct logging (ethereum#24326)

* eth/tracers: refactor traceTx to separate out struct logging

review fix

Update eth/tracers/api.go

Co-authored-by: Martin Holst Swende <martin@swende.se>

Mv ExecutionResult type to logger package

review fix

impl GetResult for StructLogger

make formatLogs private

confused exit and end..

account for intrinsicGas in structlogger, fix TraceCall test

Add Stop method to logger

Simplify traceTx

Fix test

rm logger from blockchain test

account for refund in structLogger

* use tx hooks in struct logger

* minor

* avoid executionResult in struct logger

* revert blockchain test changes

* README: remove mentions of fast sync (ethereum#24656)

Co-authored-by: Marius van der Wijden <m.vanderwijden@live.de>

* core/state/snapshot: remove noop map item assignment

* cmd/geth: inspect snapshot dangling storage (ethereum#24643)

* cmd/geth: inspect snapshot dangling storage

* cmd/geth: make verify-state invoke verify-dangling

* accounts/abi: handle tuple arrays in ParseSelector (ethereum#24587)

Closes ethereum#24571

* all: use T.TempDir to create temporary test directories (ethereum#24633)

This commit replaces ioutil.TempDir with t.TempDir in tests. The
directory created by t.TempDir is automatically removed when the test
and all its subtests complete.

Prior to this commit, temporary directory created using ioutil.TempDir
had to be removed manually by calling os.RemoveAll, which is omitted in
some tests. The error handling boilerplate e.g.

	defer func() {
		if err := os.RemoveAll(dir); err != nil {
			t.Fatal(err)
		}
	}

is also tedious, but t.TempDir handles this for us nicely.

Reference: https://pkg.go.dev/testing#T.TempDir
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>

* les: fix panic in ultralight client sync (ethereum#24641)

* log: modify lock defer unlock order in sync handler (ethereum#24667)

This modifies the order of Lock() defer Unlock() to follow the more
typically used pattern.

* build/deb: update Debian control file to remove unencrypted git protocol (ethereum#24676)

* core/types: make "miner" optional in Header JSON (ethereum#24666)

"miner" is not set for pending block responses in some cases.

Fixes ethereum#24632

* cmd: set DefaultGasLimit to 30M (ethereum#24680)

* cmd: set DefaultGasLimit to 30M, rem deprec. Flag

* cmd: revert flag deprecation

* core: fix benchmark panic (ethereum#24657)

This PR fixes a few panics in the chain marker benchmarks. The root
cause for panic is in chain marker the genesis header/block is not
accessible, while it's expected to be obtained in tests. So this PR
avoids touching genesis header at all to avoid panic.

* abi/base: return error for pending call error (ethereum#24649)

If a pending contract call errors, return that error right away rather
than ignoring it to allow an error somewhere else. This is helpful for
callers to know if perhaps a call failed because of the context deadline
being expired. This change mirrors the behavior of non-pending contract
calls.

* build: add imports for go generate tools (ethereum#24682)

This adds a tools.go file to import all command packages used for
go:generate. Doing so makes it possible to execute go-based code
generators using 'go run', locking in the tool version using go.mod.

Co-authored-by: Felix Lange <fjl@twurst.com>

* eth/tracers: make txhash blockhash accessible to native tracers (ethereum#24679)

* cmd/geth: support bigints for --override.terminaltotaldifficulty (ethereum#24646)


Co-authored-by: Felix Lange <fjl@twurst.com>

* eth/downloader: remove stale beacon headers as backfilling progresses (ethereum#24670)

* eth/downloader: remove stale beacon headers as backfilling progresses

* eth/downloader: remove leftover from a previous design

* eth/downloader: do partial beacon cleanups if chain is large

* eth/downloader: linter != heart

* build: upgrade -dlgo version to Go 1.18.1 (ethereum#24689)

* build: upgrade -dlgo version to Go 1.18.1

* build: upgrade -dlgo version for macOS to Go 1.18.1

* eth/downloader: resolve local header by hash for beacon sync (ethereum#24691)

* eth/downlaoder: resolve local header by hash for beacon sync

* eth/downloader: fix error message

* eth/downloader: cap the reverse header resolving

* eth/downloader: re-enable tests

* eth/downloader: add warning logs

* go.mod: upgrade btcec and add 'chainhash' module requirement (ethereum#24700)

See ethereum#24554 and btcsuite/btcd#1839

This is an attempt to resolve a Go module dependency issue that arises
when both 'github.com/btcsuite/btcd/btcec/v2' and the older, non-v2
btcd module are required as dependencies.

* trie: remove unused makeHashNode (ethereum#24702)

* core/vm: fix typo (ethereum#24714)

Was just browsing the code and found this.

* eth/downloader: fix typo in downloader.go (ethereum#24704)

synchornization -> synchronization

* eth/tracers/logger: remove unnecessary comparisons in accessList.equal (ethereum#24663)

This change removes extraneous/unnecessary checks for equality
when comparing 2 accessList values A and B. Given that we validate that
their lengths of A and B are equal, if so and if every element in A is
in B, reflexively every element in B is already in A. If that weren't
the case and an element g existed in A but not in B, that would mean
that there is an extra element and hence a mathematical contradiction.

Fixes ethereum#24658

* README.md: update Go min required version to 1.16 (ethereum#24713)

* .github: update CODEOWNERS (ethereum#24743)

* internal/flags: fix godoc (ethereum#24734)

* cmd/faucet: fix genesis flag and improve documentation (ethereum#24735)

* cmd/evm: ensure input length is even (ethereum#24721)

* cmd/evm: ensure input length is even

* cmd/evm: minor nit + lintfix

Co-authored-by: Martin Holst Swende <martin@swende.se>

* fix typo (ethereum#24731)

* mobile: fix receipt encoding to json (ethereum#24701)

* p2p: fix type of DiscSubprotocolError (ethereum#24747)

It was 'int' accidentally, should be DiscReason instead.

* all: use 'embed' instead of go-bindata (ethereum#24744)

* cmd/geth, core/state/snapshot: fix flaw in dangling-storage check + inspect difflayers (ethereum#24677)

This PR fixes the flaw that @rjl493456442 found in https://github.com/ethereum/go-ethereum/pull/#issuecomment-1093817551 , namely, that the snapshot iterator uses the combined (disk + difflayers) 'view', wheres the raw iterator uses only the disk 'view'.

This PR instead splits up the work: one phase is iterating the disk layer data, another phase is loading the journalled difflayers and performing the same check there.

* cmd/*: refactor get flag value (ethereum#24761)

* consensus/ethash: fix typos in var names (ethereum#24745)

* internal/ethapi: add db operations to api (ethereum#24739)

Adds `debug_dbGet` method to rpc api

* core/types: fix unhandled errors in TestTransactionCoding (ethereum#24692)

* cmd/utils: utilize beacon wrapper in makechain (ethereum#24620)

* cmd/utils: utilize beacon wrapper in makechain

* cmd/utils: fix fake-pow to also be wrapped in beacon

* consensus/misc: correct error message

* all: use common.FileExist for checking file existence (ethereum#24748)

* ethclient/gethclient: return storage proofs in GetProof (ethereum#24697)

Storage proofs were being unmarshalled from the RPC form to the go struct, but were not being included in the final returned struct.

* eth/filters: remove unused struct fields (ethereum#24782)

* cmd/clef: fixups to the python clef poc (ethereum#24440)

This PR fixes up the example python clef wrapper. The poc is intended to demonstrate how to wite a UI for clef, and had severely bitrotted.
With these changes, it "works" in the sense that all the built-in tests triggers the intended python callbacks (no errors about method not found). It does not "work" in the sense that the wrapper can be used as an actual UI. It will auto-reject any signing requests, for example.

* cmd/evm: make evm t8n handle post-merge transitions (ethereum#24546)

This adds the ability to run --state.fork=Merged, and have post-merge rules apply. When doing so, it also requires the input env to contain currentRandom, and enforces the currentDifficulty to be omitted or zero.

* cmd: group network and db path flags together (ethereum#24698)

This PR groups all built-in network flags together and list them in the command as a whole.

And all database path flags(datadir, ancient) are also grouped, since usually these two are
used together.

* accounts: fix typo in comments (ethereum#24805)

* docker: speed up docker image build (ethereum#24796)

This PR improves the docker build speed for repeated builds where go.mod and go.sum do no change, by placing the downloaded dependencies in a lower layer

* cmd/utils: double limit on free-disk monitor (ethereum#24781)

This PR doubles the limit on which to trigger automatic shutdown, and also changes the timer to run once every 30s instead of 60s.

* build: fix formatted logs (ethereum#24807)

Changed `log.Fatal` to `log.Fatalf()` as it has a parameter...

* build: ppa build for jammy (ubuntu 22.04)

* graphql: add rawReceipt field to transaction type (ethereum#24738)

* graphql: add tx receiptsRLP field

* use MarshalBinary

Co-authored-by: Ryan Schneider <ryanleeschneider@gmail.com>

* update schema

Co-authored-by: Ryan Schneider <ryanleeschneider@gmail.com>

* rename to rawReceipt

* indent fix

Co-authored-by: Ryan Schneider <ryanleeschneider@gmail.com>

* eth/filters: fix code comment (ethereum#24799)

* cmd/geth: fix init genesis for dev (ethereum#24693)

* cmd/geth: fix init genesis for dev

* use ancient flag for init genesis cmd

* cmd, eth: fix required blocks regression

* core: fix WriteBlockAndSetHead documentation (ethereum#24818)

* core: recover state when beacon sets canonical head if it's missing (ethereum#24613)

* core: recover the state in SetChainHead if the head state is missing

* core: disable test logging

* core: address comment from martin

* core: improve log level in case state is recovered

* core, eth, les, light: rename SetChainHead to SetCanonical

* eth/protocols/eth: fix godoc comments (ethereum#24810)


Co-authored-by: Martin Holst Swende <martin@swende.se>

* eth/filters: remove explicit continue label in filterLogs (ethereum#24795)

The loop label can be removed because this 'continue' statement
is not in a nested loop.

* p2p/simulations: escape mockerType value from request (ethereum#24822)


Co-authored-by: Felix Lange <fjl@twurst.com>

* p2p/simulations: fix typo in network_test.go (ethereum#24824)

* miner: discard interrupted blocks (ethereum#24638)

During mining, when a new head arrives and interrupts the block building, the block being built should not be commited (but discarded). Committing the interrupted block introduces unnecessary delay, and possibly causes miner to mine on the previous head, which could result in higher uncle rate.

* core/rawdb: untie freezer and ancient chain data (ethereum#24684)

Previously freezer has only been used for storing ancient chain data, while obviously it can be used more. This PR unties the chain data and freezer, keep the minimal freezer structure and move all other logic (like incrementally freezing block data) into a separate structure called ChainFreezer.

This PR also extends the database interface by adding a new ancient store function AncientDatadir which can return the root directory of ancient store. The ancient root directory can be used when we want to open some other ancient-stores (e.g. reverse diff freezer).

* core/vm: implement EIP-3855: PUSH0 instruction (ethereum#24039)

* core/vm: Implement PUSH0

* Move PUSH0 to enable3855

* Add method doc

* eth/fetcher: avoid hang in tests (partial fix for ethereum#23331) (ethereum#23351)

* eth/fetcher: fix test to avoid hanging. Partial fix for ethereum#23331

* eth/filters: avoid dangling goroutines

* eth/fetcher: revert closing of proceed

* signer/fourbyte: import new signatures (ethereum#22865)

* abi: fix checks when all fields are indexed (ethereum#24792)

This PR fixes abi checks in the edge case where all arguments are indexed

* core/state/snapshot: fix race condition (ethereum#24685)

Fixes three race conditions found through fuzzing by David Theodore

* all: replace strings.Replace with string.ReplaceAll (ethereum#24835)

* internal: drop TestSignCliqueBlock (ethereum#24837)

* signer/fourbyte: remove offending signatures (ethereum#24842)

* core/vm: update benchmark to use Errorf instead of Sprintf (ethereum#24845)

* eth/protocols/snap: sort trienode heal requests by path (ethereum#24779)

* sort snap trienode heal requests

* eth/protocols/snap: remove debug code

* eth/protocols/snap: simplify sort, generate pathsets later

* eth/protocols/snap: review concern

* eth/protocols/snap: renamings

* eth/protocols/snap: add comments in Merge

* eth/protocols/snap: remove variable 'last' in Merge

* eth/protocols/snap: fix lint flaws in test

Co-authored-by: Felix Lange <fjl@twurst.com>

* cmd/geth: print info banner for --dev mode (ethereum#24759)


Co-authored-by: nedifi <nedifi@users.noreply.github.com>
Co-authored-by: Felix Lange <fjl@twurst.com>

* core/vm: clean up some dead functions (ethereum#24851)

* core/vm: separate opcode group for 0x20 range (ethereum#24850)

* ethclient: add PeerCount method (ethereum#24849)

* adding peer count function

* Update ethclient.go

Co-authored-by: Felix Lange <fjl@twurst.com>

* core/vm: optimize Memory.Set32 (ethereum#24847)

* core/vm: remove unnecessary memset for Memory.Set32

* core/vm: optimize Memory.Set32

* graphql: fix long literal passed in a variable (ethereum#24864)

* core/vm: for tracing, do not report post-op memory

* internal/ethapi: add debug_getRawReceipts RPC method (ethereum#24773)

Adds a method to retrieve all the binary encoded receipts from a block

* params: set ropsten TTD for TheMerge (ethereum#24876)

* cmd/utils: add deprecation warning for Rinkeby

* core/asm: use strings.Builder and fix godoc issues (ethereum#24861)

* all: replace uses of ioutil with io and os (ethereum#24869)

* cmd/geth: update vulnerabilities.json testdata (ethereum#24856)

* core/vm: reduce overhead in instructions-benchmark (ethereum#24860)

* core/vm: reduce footprint of OP benchmark

* core/vm: for opBenchmark, add code to detect inputs mutation

* Update core/vm/instructions_test.go

Co-authored-by: Martin Holst Swende <martin@swende.se>

* core/vm: opBenchmark, stop timer before sanity-test code

Co-authored-by: Martin Holst Swende <martin@swende.se>

* eth: fix flaky test, don't attach empty slots/proofs (ethereum#24885)

* eth/protocols/snap: don't include empty snapshot slot slice

This PR fixes the snapshot storage serving handler. In snap protocol
the response is capped by the response size. Server can cutdown the
response if the accumulated byte size exceeds the local hard limit.

It means we can meet a special scenario that there is no storage slot
included for a requested account, but we attach the proof for this
account by mistake.

So in the prover side, when it meets a empty storage response but with
a valid proof proves there are some more slots left in the trie, then
requestor will reject this response and disconnect with server.

In this PR, if there is no storage slot served for the requested account,
then no proof should be attached as well.

* eth/protocols/snap: loosen restrictions for flaky tests

* eth/catalyst: fix flaky test in catalyst

* graphql: add raw fields to block and tx (ethereum#24816)

* eth/catalyst: set the correct LatestValidHash (ethereum#24855)

* eth/catalyst: set the correct LatestValidHash

* eth/catalyst: core: return LVH during reorg, rework invalid teminal block

* eth/catalyst: nitpicks

* cmd/geth: add `db check-state-content` to verify integrity of trie nodes (ethereum#24840)

This PR adds db tooling (geth db check-state-content)  to verify the integrity of trie nodes. It iterates through the 32-byte key space in the database, which is expected to contain RLP-encoded trie nodes, addressed by hash.

* all: use strings.EqualFold for string comparison (ethereum#24890)

* all: replace non-trivial uses of package ioutil with os (ethereum#24886)


Co-authored-by: Martin Holst Swende <martin@swende.se>

* ethdb/remotedb, cmd: add support for remote (readonly) databases (ethereum#24836)

* ethdb/remotedb, cmd: add support for remote (readonly) databases

* ethdb/remotedb: minor changes

* ethdb/remotedb: close the conn

* cmd, ethdb: add rpc accessor for ancient data

* internal/ethapi: license

* ethdb/remotedb: linter fixes

* core, eth, internal, rpc: implement final block (ethereum#24282)

* eth: core: implement finalized block

* eth/catalyst: fix final block

* eth/catalyst: update finalized head gauge

* internal/jsre/deps: updated web3.js to allow for finalized block

* eth/catalyst: make sure only one thread can call fcu

* eth/catalyst: nitpicks

* eth/catalyst: use plain mutex

* eth: nitpicks

* eth/catalyst, miner: build the execution payload async (ethereum#24866)

* eth/catalyst: build the execution payload async

* miner: added comment, added test case

* eth/catalyst: miner: move async block production to miner

* eth/catalyst, miner: support generate seal block async

* miner: rework GetSealingBlockAsync to use a passed channel

* miner: apply rjl's diff

* eth/catalyst: nitpicks

Co-authored-by: Gary Rong <garyrong0905@gmail.com>

* eth/tracers/js: goja tracer (ethereum#23773)

This adds a JS tracer runtime environment based on the Goja VM. The new
runtime replaces the duktape runtime, which will be removed soon.

Goja is implemented in Go and is faster for cases where the Go <-> JS
transition overhead dominates overall performance. It is faster because
duktape is written in C, and the transition cost includes the cost of using
cgo. Another reason for using Goja is that go-duktape is not maintained
anymore.

We expect the performace of JS tracing to be at least as good or better with
this change.

* params: update goerli bootnodes (ethereum#24900)

* params: update goerli bootnodes

* params: use ip for enodes

* params: fix broken linter

* ethdb/remotedb: fix flawed check in Has/HasAncient

* core: fix the order of address in queue (ethereum#24907)

reverse the order of address in queue

* tests: update reference tests (ethereum#24899)

* tests: update reference tests

* tests: fix flaw in state test execution

* f

* eth/tracers/js: add memory.length method (ethereum#24887)

* eth/catalyst: update implementation to spec (ethereum#24802)

* eth/catalyst: return invalid payload attributes error

* eth/catalyst: implement LVH as specified, add tests

* eth/catalyst: return current block hash not header hash

* eth/catalyst: fix test

* eth/catalyst: bring error codes in line with spec

* core, eth, les, rpc: polish catalyst errors, add context

* build/bot: add mac build script (ethereum#24917)

* build/bot: remove xctool invocation in macos build script (ethereum#24918)

* build/bot: add ppa-build.sh (ethereum#24919)

* build/bot: avoid install of python-bzrlib, python-paramiko in PPA build (ethereum#24921)

* build/bot: create .ssh directory in ppa-build.sh (ethereum#24922)

* core/state/snapshot: detect and clean up dangling storage snapshot in generation (ethereum#24811)

* core/state/snapshot: check dangling storages when generating snapshot

* core/state/snapshot: polish

* core/state/snapshot: wipe the last part of the dangling storages

* core/state/snapshot: fix and add tests

* core/state/snapshot: fix comment

* README: remove mentions of fast sync (ethereum#24656)

Co-authored-by: Marius van der Wijden <m.vanderwijden@live.de>

* core, cmd: expose dangling storage detector for wider usage

* core/state/snapshot: rename variable

* core, ethdb: use global iterators for snapshot generation

* core/state/snapshot: polish

* cmd, core/state/snapshot: polish

* core/state/snapshot: polish

* Update core/state/snapshot/generate.go

Co-authored-by: Martin Holst Swende <martin@swende.se>

* ethdb: extend db test suite and fix memorydb iterator

* ethdb/dbtest: rollback changes

* ethdb/memorydb: simplify iteration

* core/state/snapshot: update dangling counter

* core/state/snapshot: release iterators

* core/state/snapshot: update metrics

* core/state/snapshot: update time metrics

* metrics/influxdb: temp solution to present counter meaningfully, remove it

* add debug log, revert later

* core/state/snapshot: fix iterator panic

* all: customized snapshot iterator for backward iteration

* core, ethdb: polish

* core/state/snapshot: remove debug log

* core/state/snapshot: address comments from peter

* core/state/snapshot: reopen the iterator at the next position

* ethdb, core/state/snapshot: address comment from peter

* core/state/snapshot: reopen exhausted iterators

Co-authored-by: Tbnoapi <63448616+nuoomnoy02@users.noreply.github.com>
Co-authored-by: Marius van der Wijden <m.vanderwijden@live.de>
Co-authored-by: Martin Holst Swende <martin@swende.se>

* accounts/abi: validate fieldnames, fixes ethereum#24930 (ethereum#24932)

* common/compiler, cmd/abigen: remove solc/vyper compiler integration

* eth/tracers/js: drop duktape engine (ethereum#24934)

ethereum#23773 added a JS tracer which uses Goja as its engine. In this PR I remove the previous tracer which used duktape as well as remove the dependencies.

This PR also comes with 2 fixes in the Goja tracer and one small behavioural change:

    I had handled errors in the native Go functions by panicing. My oversight was that Goja only handles panics with a Goja.Value as argument. The difference is panic(goja.Value) allows JS to catch the exception whereas Interrupt(error) doesn't.
    There was a race in how I handled Stop.
    Because of 1. some of the methods that simply return nil on error (like memory.slice) now throw an exception.

* signer/core: always pad clique header extra data with space for sealer's signature (ethereum#24941)

* signer/core: always pad clique header extra data with space for sealer's signature

* capitalize comment

* go.mod: upgrade to btcsuite/btcd/btcec v2.2.0 (ethereum#24939)

This should fully resolve dependency conflict issues in modules
that also depend on btcsuite/btcd v0.22.0.

* params: update CHTs for Geth 1.10.18

* all: update license headers and AUTHORS from git history (ethereum#24947)

* AUTHORS: remove one more duplicate entry (ethereum#24950)

* go.mod: upgrade to docker v1.6.2 (ethereum#24956)

This upgrade is necessary to silence a Dependabot warning.

* params: go-ethereum v1.10.18 stable

* params: begin v1.10.19 release cycle

* cmd/geth: exit when freezer has legacy receipts (ethereum#24943)

In ethereum#24028 we flagged a warning when finding legacy receipts in the freezer. This PR nudges users a bit more strongly by preventing geth from starting in this case until receipts have been migrated.

It also adds a flag --ignore-legacy-receipts which when present allows geth to start normally.

* cmd/abigen: accept combined-json via stdin (ethereum#24960)

* params: set emergency ropsten TTD to 100_000_000_000_000_000_000_000 (ethereum#24975)

* core: use less memory during reorgs (ethereum#24616)

This PR significantly reduces the memory consumption of a long reorg

* cmd/geth: extend traverseRawState command (ethereum#24954)

This PR adds node verification into traverseRawState command, so corrupted trie nodes can also be detected.

* consensus/clique: fix race condition (ethereum#24957)

* consensus/clique: remove race condition

* consensus/clique: fix one more signer data race

Co-authored-by: Gary Rong <garyrong0905@gmail.com>

* eth/catalyst: fix edge case in NewPayload (ethereum#24955)

Fixes an issue where we would accept a NewPayload where the grandparent is already post ttd, and the parent still has a Difficulty

* contracs/checkpointoracle: fix directives (ethereum#24944)

contracts/checkpointoracle: redefine go-generate logic

* eth/filters: use buffered channel to avoid goroutine leak (ethereum#24928)

* core/beacon: prevent invalid logsBloom length panic (ethereum#24946)

* core/beacon: prevent invalid logsBloom length panic

* core/beacon: prevent negative baseFeePerGas

* Update core/beacon/types.go

Co-authored-by: Martin Holst Swende <martin@swende.se>

* eth/catalys: go format

Co-authored-by: Martin Holst Swende <martin@swende.se>

* core: fix canonical hash marker update (ethereum#24996)

* core: fix reorg

* core: revert change for memory efficiency

* core: revert changes

* eth/tracers: add support for block overrides in debug_traceCall (ethereum#24871)

This PR adds support for block overrides when doing debug_traceCall.

- Previously, debug_traceCall against pending erroneously used a common.Hash{} stateroot when looking up the state, meaning that a totally empty state was used -- so it always failed,
- With this change, we reject executing debug_traceCall against pending.
- And we add ability to override all evm-visible header fields.

* tests/fuzzers/bls12381: Add BLST to fuzzing support (ethereum#24249)

* tests/fuzzers/bls12381: added blst library

* go.mod: added blst dependency

* tests/fuzzers/bls12381: stuff

* tests/fuzzers/bls12381: added blst to pairing fuzzer

* eth/catalyst: return 0x0 on Invalid block on top of pow block (ethereum#25006)

* node: make jwt test less dependent on time (ethereum#25016)

* consensus/misc: reduce allocations and improve comments in CalcBaseFee (ethereum#24958)

* consensus/misc: reduce allocations in CalcBaseFee

* consensus/misc: add formulas of CalcBaseFee

* go.mod: set go version to 1.17 (ethereum#24926)

set go version to 1.17

* go.mod: clean up (ethereum#25017)

* core/vm: optimize jumpdest analysis (ethereum#23500)

core/vm: optimize PUSH opcode discrimination

* tests/fuzzers/bls12381: fix blst deserializing (ethereum#25036)

* tests/fuzzers/bls12381: fix blst deserializing

* tests/fuzzers/bls12381: fix blst deserializing

* cmd/geth, core/state/snapshot: rework journal loading, implement account-check (ethereum#24765)

* cmd/geth, core/state/snapshot: rework journal loading, implement account-check

* core/state/snapshot, cmd/geth: polish code (ethereum#37)

* core/state/snapshot: minor nits

* core/state/snapshot: simplify error logic

* cmd/geth: go format

Co-authored-by: rjl493456442 <garyrong0905@gmail.com>

* all: introduce trie owner notion (ethereum#24750)

* cmd, core/state, light, trie, eth: add trie owner notion

* all: refactor

* tests: fix goimports

* core/state/snapshot: fix ineffasigns

Co-authored-by: Martin Holst Swende <martin@swende.se>

* eth/api: use `hexutil.Bytes` for account range method (ethereum#25024)

eth/api: use hexutil.Bytes for range at methods

* eth/tracers: fix typo in 4byte_tracer_legacy.js (ethereum#25020)

indentifier -> identifier

* trie: move locking into trieDB insert method (ethereum#25030)

Move locking into trieDB insert function

* params: update ropsten terminal total difficulty block (ethereum#25018)

* eth/filters: fix getLogs for pending block (ethereum#24949)

* eth/filters: fix pending for getLogs

* add pending method to test backend

* fix block range validation

* accounts/abi/bind: fix duplicate field names in the generated go struct (ethereum#24924)

* accounts/abi/bind: fix duplicate field names in the generated go struct ethereum#24627

* accounts, cmd/abigen: resolve name conflicts

* ci lint, accounts/abi: remove unused function overloadedArgName

Co-authored-by: Gary Rong <garyrong0905@gmail.com>

* tests/fuzzers/bls12381: fix blst pairing (ethereum#25037)

* tests/fuzzers/bls12381: fix blst pairing

* tests/fuzzers/bls12381: only build on gofuzz

* tests/fuzzers/bls12381: remove unused code

* tests/fuzzers/bls12381: remove unused code

* p2p/discover: fix panicky test (ethereum#25038)

* accounts: increase parseURL test coverage (ethereum#25033)

accounts/url: add test logic what check null string to parseURL()

* eth, les, params: log chain config a bit saner (ethereum#24904)

Previously on Geth startup we just logged the chain config is a semi-json-y format. Whilst that worked while we had a handful of hard-forks defined, currently it's kind of unwieldy. 

This PR converts that original data dump and converts it into a user friendly - alas multiline - log output.

* p2p: use errors.Is for error comparison (ethereum#24882)


Co-authored-by: Felix Lange <fjl@twurst.com>

* rpc: swap out timer metrics to histograms

* eth/catalyst: remove unauthenticated 'engine' api (ethereum#24997)

Removes engine from any unauthenticated RPC service.

* core/types: remove unused field 'td' in Block (ethereum#25010)

* core/types: improve LogForStorage and ReceiptForStorage comments (ethereum#25032)


Co-authored-by: Felix Lange <fjl@twurst.com>

* core/evm: fix error in comment (ethereum#25040)


Co-authored-by: Martin Holst Swende <martin@swende.se>

* internal/ethapi: fix typo in comment (ethereum#25056)

typo error: keccack256 -> keccak256

* Chore:  Minimal gramatical errors (signleton -> singleton) (ethereum#25057)

core: fix typos

* all: more linters (ethereum#24783)

This enables the following linters

- typecheck
- unused
- staticcheck
- bidichk
- durationcheck
- exportloopref
- gosec

WIth a few exceptions.

- We use a deprecated protobuf in trezor. I didn't want to mess with that, since I cannot meaningfully test any changes there.
- The deprecated TypeMux is used in a few places still, so the warning for it is silenced for now.
- Using string type in context.WithValue is apparently wrong, one should use a custom type, to prevent collisions between different places in the hierarchy of callers. That should be fixed at some point, but may require some attention.
- The warnings for using weak random generator are squashed, since we use a lot of random without need for cryptographic guarantees.

* cmd/utils: update --ropsten description (ethereum#25078)

* readme,eth: remove references to eth.wiki (ethereum#25086)

* cmd/ethkey: use accounts.TextHash (ethereum#25069)

* common: improve pretty duration regex (ethereum#25073)

* common: improve pretty duration regex

* common: improve pretty duration regex

* all: prefer `new(big.Int)` over `big.NewInt(0)` (ethereum#25087)

minor performance improvement: `big.NewInt(0).Xxx` -> `new(big.Int).Xxx`

* eth: add missing period at end of sentences (ethereum#25058)

eth: add missing periods on end of comments

* eth: introduce eth67 protocol (ethereum#24093)

The new protocol version removes support for GetNodeData.
See https://eips.ethereum.org/EIPS/eip-4938 for more information.

Co-authored-by: Felix Lange <fjl@twurst.com>
Co-authored-by: Martin Holst Swende <martin@swende.se>

* cmd, params: implement Gray Glacier hard-fork (EIP-5133) (ethereum#25088)

* cmd/geth, params: implement Gray Glacier (EIP-5133)

* cmd/evm: add gray glacier tests

* params: nitpicks

* params: fixes

* node: add info message when JWT secret is loaded (ethereum#25095)


Co-authored-by: Felix Lange <fjl@twurst.com>

* params: release Geth v1.10.19

Co-authored-by: Justus <jus@gtsbr.org>
Co-authored-by: Felix Lange <fjl@twurst.com>
Co-authored-by: Qian Bin <cola.tin.com@gmail.com>
Co-authored-by: rjl493456442 <garyrong0905@gmail.com>
Co-authored-by: Martin Holst Swende <martin@swende.se>
Co-authored-by: Sina Mahmoodi <1591639+s1na@users.noreply.github.com>
Co-authored-by: 沉风 <myself659@users.noreply.github.com>
Co-authored-by: Péter Szilágyi <peterke@gmail.com>
Co-authored-by: Marius van der Wijden <m.vanderwijden@live.de>
Co-authored-by: s7v7nislands <s7v7nislands@gmail.com>
Co-authored-by: ucwong <ucwong@126.com>
Co-authored-by: aaronbuchwald <aaron.buchwald56@gmail.com>
Co-authored-by: ligi <ligi@ligi.de>
Co-authored-by: Guifel <toowik@gmail.com>
Co-authored-by: Ryan Schneider <ryanleeschneider@gmail.com>
Co-authored-by: Jonathan Chappelow <chappjc@users.noreply.github.com>
Co-authored-by: alvaroahp11 <64142599+alvaroahp11@users.noreply.github.com>
Co-authored-by: Zhang Zhuo <mycinbrin@gmail.com>
Co-authored-by: jwasinger <j-wasinger@hotmail.com>
Co-authored-by: flowerofdream <775654398@qq.com>
Co-authored-by: Yong Yang <yangyong775654@163.com>
Co-authored-by: zhiqiangxu <652732310@qq.com>
Co-authored-by: Guruprasad Kamath <48196632+gurukamath@users.noreply.github.com>
Co-authored-by: Nic Jansma <nic@nicj.net>
Co-authored-by: John Adler <adlerjohn@users.noreply.github.com>
Co-authored-by: Tatsuya Shimoda <tacoo@users.noreply.github.com>
Co-authored-by: Tbnoapi <63448616+nuoomnoy02@users.noreply.github.com>
Co-authored-by: Tangui Clairet <tangui.clairet@gmail.com>
Co-authored-by: Eng Zer Jun <engzerjun@gmail.com>
Co-authored-by: Vaibhaw <kvaibhaw99@gmail.com>
Co-authored-by: JoeGruffins <34998433+JoeGruffins@users.noreply.github.com>
Co-authored-by: Marius Kjærstad <sandakersmann@users.noreply.github.com>
Co-authored-by: Darioush Jalali <darioush.jalali@avalabs.org>
Co-authored-by: Enrique Ortiz <hi@enriqueortiz.dev>
Co-authored-by: Ikko Ashimine <eltociear@gmail.com>
Co-authored-by: Emmanuel T Odeke <odeke@ualberta.ca>
Co-authored-by: Koosha K <koosha--@users.noreply.github.com>
Co-authored-by: Nikita Kozhemyakin <enginegl.ec@gmail.com>
Co-authored-by: henopied <13500516+henopied@users.noreply.github.com>
Co-authored-by: John Difool <johndifoolpi@gmail.com>
Co-authored-by: tia-99 <67107070+tia-99@users.noreply.github.com>
Co-authored-by: Joshua Gutow <jbgutow@gmail.com>
Co-authored-by: hero5512 <lvshuaino@gmail.com>
Co-authored-by: nujabes403 <nujabes403@gmail.com>
Co-authored-by: EXEC <execvy@gmail.com>
Co-authored-by: Evgeny Kolyakov <freaker2k7@users.noreply.github.com>
Co-authored-by: milesvant <milesvant@gmail.com>
Co-authored-by: ImanSharaf <78227895+ImanSharaf@users.noreply.github.com>
Co-authored-by: Mateusz Morusiewicz <11313015+Ruteri@users.noreply.github.com>
Co-authored-by: Alex Beregszaszi <alex@rtfs.hu>
Co-authored-by: Rachel Franks <nfranks@protonmail.com>
Co-authored-by: ||= nil <103940716+nedifi@users.noreply.github.com>
Co-authored-by: nedifi <nedifi@users.noreply.github.com>
Co-authored-by: Felipe Strozberg <48066928+FelStroz@users.noreply.github.com>
Co-authored-by: Håvard Anda Estensen <haavard.ae@gmail.com>
Co-authored-by: Afr Schoe <58883403+q9f@users.noreply.github.com>
Co-authored-by: zhaochonghe <41711151+zhaochonghe@users.noreply.github.com>
Co-authored-by: Eduard S <eduardsanou@posteo.net>
Co-authored-by: Harry Kalodner <harry.kalodner@gmail.com>
Co-authored-by: Boqin Qin(秦 伯钦) <Bobbqqin@gmail.com>
Co-authored-by: Ivan Kuznetsov <me@jeiwan.ru>
Co-authored-by: Jonathan Le Brun <42697488+icyfry@users.noreply.github.com>
Co-authored-by: Paweł Bylica <chfast@gmail.com>
Co-authored-by: lightclient <14004106+lightclient@users.noreply.github.com>
Co-authored-by: lwh <lwhile521@gmail.com>
Co-authored-by: Seungbae.yu <72970043+dbadoy@users.noreply.github.com>
Co-authored-by: Rajaram Gaunker <zimbabao@gmail.com>
Co-authored-by: henridf <henri@dubfer.com>
Co-authored-by: int88 <106391185+int88@users.noreply.github.com>
Co-authored-by: Luozhu <70309026+LuozhuZhang@users.noreply.github.com>
Co-authored-by: Gustavo Silva <GustavoRSSilva@users.noreply.github.com>
Co-authored-by: Ivan Aracki <aracki.ivan@gmail.com>
Co-authored-by: lmittmann <lmittmann@users.noreply.github.com>
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.

None yet

5 participants