Skip to content

Commit

Permalink
Merge pull request #49 from ironbeer/feat/merge-l2geth
Browse files Browse the repository at this point in the history
Fix issue with replication stopping in l2geth
  • Loading branch information
ironbeer authored Jul 12, 2024
2 parents 4d667a1 + 4df636a commit 7d7db4a
Show file tree
Hide file tree
Showing 39 changed files with 841 additions and 1,178 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
target: message-relayer
args: NODE_OPTIONS=--max-old-space-size=6144
- name: l2geth
file: ./ops/docker/Dockerfile.geth
file: ./l2geth/Dockerfile
target: ''
args: ''
- name: batch-submitter
Expand Down
117 changes: 117 additions & 0 deletions l2geth/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,122 @@
# Changelog

## 0.5.33

### Patch Changes

- 33acb7c6a: Has l2geth return a NonceToHigh response if the txn nonce is greater than the expected nonce.

## 0.5.32

### Patch Changes

- ea817097b: Use default cas gap of 25 million

## 0.5.31

### Patch Changes

- ccbca22c3: Patch release for additional instrumentation for the Bedrock upgrade.

## 0.5.30

### Patch Changes

- 0e8652c29: Close down the syncservice more cleanly

## 0.5.29

### Patch Changes

- 4e65ceb9d: Dedupe dumper addresses in memory

## 0.5.28

### Patch Changes

- ac0f14f5: Fix state dumper
- 5005da9a: Fixes a small l2geth bug when trying to dump state

## 0.5.27

### Patch Changes

- 596c974e: Kick the build

## 0.5.26

### Patch Changes

- 397b27ee: Add data exporter

## 0.5.25

### Patch Changes

- 89f1abfa: add --rpc.evmtimeout flag to configure timeout for eth_call

## 0.5.24

### Patch Changes

- c3e66e57: Add the gas estimation block tag to `eth_estimateGas` to be RPC compliant

## 0.5.23

### Patch Changes

- c3363225: fix NPE in debug_standardTraceBlockToFile

## 0.5.22

### Patch Changes

- ff0723aa: Have L2Geth Verifier sync in parallel with the DTL.

## 0.5.21

### Patch Changes

- 248f73c5: Rerelease the previous version

## 0.5.20

### Patch Changes

- 359bc604: Patch for L1 syncing nodes that got stuck after DTL batch sync errors

## 0.5.19

### Patch Changes

- 1bcee8f1: Fix `eth_getBlockRange`
- c799535d: Add system addresses for nightly goerli

## 0.5.18

### Patch Changes

- 935a98e6: rollup: fix log.Crit usage
- 81f09f16: l2geth: Record rollup transaction metrics

## 0.5.17

### Patch Changes

- 13524da4: Style fix in the sync service
- 160f4c3d: Update docker image to use golang 1.18.0
- 1a28ba5f: Skip account cmd tests
- 45582fcc: Skip unused tests in l2geth
- 0c4d4e08: l2geth: Revert transaction pubsub feature

## 0.5.16

### Patch Changes

- a01a2eb1: Skip TestWSAttachWelcome
- 23ad6068: Skip some geth console tests that flake in CI
- 6926b293: Adds a flag for changing the genesis fetch timeout

## 0.5.15

### Patch Changes
Expand Down
20 changes: 20 additions & 0 deletions l2geth/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Build Geth in a stock Go builder container
FROM golang:1.18.0-alpine3.15 as builder

RUN apk add --no-cache make gcc musl-dev linux-headers git

COPY ./l2geth /app/l2geth

WORKDIR /app/l2geth
RUN make geth

# Pull Geth into a second stage deploy alpine container
FROM alpine:3.15

RUN apk add --no-cache ca-certificates jq curl
COPY --from=builder /app/l2geth/build/bin/geth /usr/local/bin/

WORKDIR /usr/local/bin/
EXPOSE 8545 8546 8547
COPY ./ops/scripts/geth.sh .
ENTRYPOINT ["geth"]
13 changes: 13 additions & 0 deletions l2geth/cmd/geth/accountcmd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ func TestAccountListEmpty(t *testing.T) {
}

func TestAccountList(t *testing.T) {
t.Skip()
datadir := tmpDatadirWithKeystore(t)
geth := runGeth(t, "account", "list", "--datadir", datadir)
defer geth.ExpectExit()
Expand All @@ -67,6 +68,7 @@ Account #2: {289d485d9771714cce91d3393d764e1311907acc} keystore://{{.Datadir}}/k
}

func TestAccountNew(t *testing.T) {
t.Skip()
geth := runGeth(t, "account", "new", "--lightkdf")
defer geth.ExpectExit()
geth.Expect(`
Expand All @@ -89,6 +91,7 @@ Path of the secret key file: .*UTC--.+--[0-9a-f]{40}
}

func TestAccountNewBadRepeat(t *testing.T) {
t.Skip()
geth := runGeth(t, "account", "new", "--lightkdf")
defer geth.ExpectExit()
geth.Expect(`
Expand All @@ -101,6 +104,7 @@ Fatal: Passwords do not match
}

func TestAccountUpdate(t *testing.T) {
t.Skip()
datadir := tmpDatadirWithKeystore(t)
geth := runGeth(t, "account", "update",
"--datadir", datadir, "--lightkdf",
Expand All @@ -117,6 +121,7 @@ Repeat password: {{.InputLine "foobar2"}}
}

func TestWalletImport(t *testing.T) {
t.Skip()
geth := runGeth(t, "wallet", "import", "--lightkdf", "testdata/guswallet.json")
defer geth.ExpectExit()
geth.Expect(`
Expand All @@ -132,6 +137,7 @@ Address: {d4584b5f6229b7be90727b0fc8c6b91bb427821f}
}

func TestWalletImportBadPassword(t *testing.T) {
t.Skip()
geth := runGeth(t, "wallet", "import", "--lightkdf", "testdata/guswallet.json")
defer geth.ExpectExit()
geth.Expect(`
Expand All @@ -142,6 +148,7 @@ Fatal: could not decrypt key with given password
}

func TestUnlockFlag(t *testing.T) {
t.Skip()
datadir := tmpDatadirWithKeystore(t)
geth := runGeth(t,
"--datadir", datadir, "--nat", "none", "--nodiscover", "--maxpeers", "0", "--port", "0",
Expand All @@ -166,6 +173,7 @@ Password: {{.InputLine "foobar"}}
}

func TestUnlockFlagWrongPassword(t *testing.T) {
t.Skip()
datadir := tmpDatadirWithKeystore(t)
geth := runGeth(t,
"--datadir", datadir, "--nat", "none", "--nodiscover", "--maxpeers", "0", "--port", "0",
Expand All @@ -185,6 +193,7 @@ Fatal: Failed to unlock account f466859ead1932d743d622cb74fc058882e8648a (could

// https://github.com/ethereum/go-ethereum/issues/1785
func TestUnlockFlagMultiIndex(t *testing.T) {
t.Skip()
datadir := tmpDatadirWithKeystore(t)
geth := runGeth(t,
"--datadir", datadir, "--nat", "none", "--nodiscover", "--maxpeers", "0", "--port", "0",
Expand Down Expand Up @@ -212,6 +221,7 @@ Password: {{.InputLine "foobar"}}
}

func TestUnlockFlagPasswordFile(t *testing.T) {
t.Skip()
datadir := tmpDatadirWithKeystore(t)
geth := runGeth(t,
"--datadir", datadir, "--nat", "none", "--nodiscover", "--maxpeers", "0", "--port", "0",
Expand All @@ -232,6 +242,7 @@ func TestUnlockFlagPasswordFile(t *testing.T) {
}

func TestUnlockFlagPasswordFileWrongPassword(t *testing.T) {
t.Skip()
datadir := tmpDatadirWithKeystore(t)
geth := runGeth(t,
"--datadir", datadir, "--nat", "none", "--nodiscover", "--maxpeers", "0", "--port", "0",
Expand All @@ -243,6 +254,7 @@ Fatal: Failed to unlock account 0 (could not decrypt key with given password)
}

func TestUnlockFlagAmbiguous(t *testing.T) {
t.Skip()
store := filepath.Join("..", "..", "accounts", "keystore", "testdata", "dupes")
geth := runGeth(t,
"--keystore", store, "--nat", "none", "--nodiscover", "--maxpeers", "0", "--port", "0",
Expand Down Expand Up @@ -281,6 +293,7 @@ In order to avoid this warning, you need to remove the following duplicate key f
}

func TestUnlockFlagAmbiguousWrongPassword(t *testing.T) {
t.Skip()
store := filepath.Join("..", "..", "accounts", "keystore", "testdata", "dupes")
geth := runGeth(t,
"--keystore", store, "--nat", "none", "--nodiscover", "--maxpeers", "0", "--port", "0",
Expand Down
9 changes: 5 additions & 4 deletions l2geth/cmd/geth/chaincmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ var (
ArgsUsage: "<genesisPathOrUrl> (<genesisHash>)",
Flags: []cli.Flag{
utils.DataDirFlag,
utils.RollupGenesisTimeoutSecondsFlag,
},
Category: "BLOCKCHAIN COMMANDS",
Description: `
Expand All @@ -65,7 +66,7 @@ participating.
It expects either a path or an HTTP URL to the genesis file as an argument. If an
HTTP URL is specified for the genesis file, then a hex-encoded SHA256 hash of the
genesis file must be included as a second argument. The hash provided on the CLI
genesis file must be included as a second argument. The hash provided on the CLI
will be checked against the hash of the genesis file downloaded from the URL.`,
}
dumpChainCfgCommand = cli.Command{
Expand Down Expand Up @@ -236,7 +237,7 @@ func initGenesis(ctx *cli.Context) error {

log.Info("Fetching genesis file", "url", genesisPathOrURL)

genesisData, err := fetchGenesis(genesisPathOrURL)
genesisData, err := fetchGenesis(genesisPathOrURL, time.Duration(ctx.GlobalInt(utils.RollupGenesisTimeoutSecondsFlag.Name)))
if err != nil {
utils.Fatalf("Failed to fetch genesis file: %v", err)
}
Expand Down Expand Up @@ -640,9 +641,9 @@ func hashish(x string) bool {
return err != nil
}

func fetchGenesis(url string) ([]byte, error) {
func fetchGenesis(url string, timeout time.Duration) ([]byte, error) {
client := &http.Client{
Timeout: 60 * time.Second,
Timeout: timeout,
}
resp, err := client.Get(url)
if err != nil {
Expand Down
4 changes: 4 additions & 0 deletions l2geth/cmd/geth/consolecmd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ const (
// Tests that a node embedded within a console can be started up properly and
// then terminated by closing the input stream.
func TestConsoleWelcome(t *testing.T) {
t.Skip()
coinbase := "0x8605cdbbdb6d264aa742e77020dcbc58fcdce182"

// Start a geth console, make sure it's cleaned up and terminate the console
Expand Down Expand Up @@ -71,6 +72,7 @@ at block: 0 ({{niltime}})

// Tests that a console can be attached to a running node via various means.
func TestIPCAttachWelcome(t *testing.T) {
t.Skip()
// Configure the instance for IPC attachement
coinbase := "0x8605cdbbdb6d264aa742e77020dcbc58fcdce182"
var ipc string
Expand Down Expand Up @@ -98,6 +100,7 @@ func TestIPCAttachWelcome(t *testing.T) {
}

func TestHTTPAttachWelcome(t *testing.T) {
t.Skip()
coinbase := "0x8605cdbbdb6d264aa742e77020dcbc58fcdce182"
port := strconv.Itoa(trulyRandInt(1024, 65536)) // Yeah, sometimes this will fail, sorry :P
geth := runGeth(t,
Expand All @@ -114,6 +117,7 @@ func TestHTTPAttachWelcome(t *testing.T) {
}

func TestWSAttachWelcome(t *testing.T) {
t.Skip()
coinbase := "0x8605cdbbdb6d264aa742e77020dcbc58fcdce182"
port := strconv.Itoa(trulyRandInt(1024, 65536)) // Yeah, sometimes this will fail, sorry :P

Expand Down
11 changes: 2 additions & 9 deletions l2geth/cmd/geth/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,16 +164,8 @@ var (
utils.RollupEnforceFeesFlag,
utils.RollupFeeThresholdDownFlag,
utils.RollupFeeThresholdUpFlag,
utils.RollupGenesisTimeoutSecondsFlag,
utils.SequencerClientHttpFlag,
utils.TxPublisherEnableFlag,
utils.TxPublisherProjectIDFlag,
utils.TxPublisherTopicIDFlag,
utils.TxPublisherTimeoutFlag,
utils.TxQueueEnableFlag,
utils.TxQueueProjectIDFlag,
utils.TxQueueSubscriptionIDFlag,
utils.TxQueueMaxOutstandingBytesFlag,
utils.TxQueueMaxOutstandingMessagesFlag,
}

rpcFlags = []cli.Flag{
Expand All @@ -197,6 +189,7 @@ var (
utils.IPCPathFlag,
utils.InsecureUnlockAllowedFlag,
utils.RPCGlobalGasCap,
utils.RPCGlobalEVMTimeoutFlag,
}

whisperFlags = []cli.Flag{
Expand Down
11 changes: 2 additions & 9 deletions l2geth/cmd/geth/usage.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,16 +77,8 @@ var AppHelpFlagGroups = []flagGroup{
utils.RollupEnforceFeesFlag,
utils.RollupFeeThresholdDownFlag,
utils.RollupFeeThresholdUpFlag,
utils.RollupGenesisTimeoutSecondsFlag,
utils.SequencerClientHttpFlag,
utils.TxPublisherEnableFlag,
utils.TxPublisherProjectIDFlag,
utils.TxPublisherTopicIDFlag,
utils.TxPublisherTimeoutFlag,
utils.TxQueueEnableFlag,
utils.TxQueueProjectIDFlag,
utils.TxQueueSubscriptionIDFlag,
utils.TxQueueMaxOutstandingBytesFlag,
utils.TxQueueMaxOutstandingMessagesFlag,
},
},
{
Expand Down Expand Up @@ -186,6 +178,7 @@ var AppHelpFlagGroups = []flagGroup{
utils.RPCPortFlag,
utils.RPCApiFlag,
utils.RPCGlobalGasCap,
utils.RPCGlobalEVMTimeoutFlag,
utils.RPCCORSDomainFlag,
utils.RPCVirtualHostsFlag,
utils.WSEnabledFlag,
Expand Down
Loading

0 comments on commit 7d7db4a

Please sign in to comment.