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

op-geth doesn't pass core/rawdb unittests #21

Closed
chokobole opened this issue Mar 9, 2023 · 0 comments · Fixed by #87
Closed

op-geth doesn't pass core/rawdb unittests #21

chokobole opened this issue Mar 9, 2023 · 0 comments · Fixed by #87
Assignees

Comments

@chokobole
Copy link
Collaborator

System information

Geth version: 1.11.2-stable
OP-Geth version: 0.1.0-unstable
OS & Version: Linux

❯ uname -a
Linux ryan-linux 5.19.0-35-generic #36~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Fri Feb 17 15:17:25 UTC 2 x86_64 x86_64 x86_64 GNU/Linux

Commit hash : ethereum-optimism/op-geth@13ee9ab

Expected behaviour

Tests should be run successfully.

Actual behaviour

~/Workspace/mainnet/optimism/op-geth optimism*
❯ go test ./core/rawdb -count 1
--- FAIL: TestSequentialRead (0.00s)
    freezer_table_test.go:899: AppendRaw(0, ...) returned error: the append operation is out-order: have 0 want 30
--- FAIL: TestSequentialReadByteLimit (0.00s)
    freezer_table_test.go:960: AppendRaw(0, ...) returned error: the append operation is out-order: have 0 want 30
--- FAIL: TestFreezerReadonly (0.00s)
    freezer_table_test.go:1032: AppendRaw(0, ...) returned error: the append operation is out-order: have 0 want 8
--- FAIL: TestRandom (0.00s)
    freezer_table_test.go:1287: random test iteration 1 failed: ([]interface {}) (len=1 cap=1) {
         (rawdb.randTest) (len=50 cap=67) {
          (rawdb.randTestStep) {
           op: (int) 7,
           items: ([]uint64) <nil>,
           blobs: ([][]uint8) <nil>,
           target: (uint64) 0,
           err: (*errors.errorString)(0xc00018af90)(mismatch on retrieved values [[0 0 0 0 0 0 0 1]] [])
          },
          (rawdb.randTestStep) {
           op: (int) 2,
           items: ([]uint64) <nil>,
           blobs: ([][]uint8) <nil>,
           target: (uint64) 0,
           err: (error) <nil>
          },
          (rawdb.randTestStep) {
           op: (int) 3,
           items: ([]uint64) <nil>,
           blobs: ([][]uint8) <nil>,
           target: (uint64) 0,
           err: (error) <nil>
          },
          (rawdb.randTestStep) {
           op: (int) 5,
           items: ([]uint64) <nil>,
           blobs: ([][]uint8) <nil>,
           target: (uint64) 0,
           err: (error) <nil>
          },
          (rawdb.randTestStep) {
           op: (int) 4,
           items: ([]uint64) <nil>,
           blobs: ([][]uint8) <nil>,
           target: (uint64) 0,
           err: (error) <nil>
          },
          (rawdb.randTestStep) {
           op: (int) 6,
           items: ([]uint64) <nil>,
           blobs: ([][]uint8) <nil>,
           target: (uint64) 0,
           err: (error) <nil>
          },
          (rawdb.randTestStep) {
           op: (int) 4,
           items: ([]uint64) <nil>,
           blobs: ([][]uint8) <nil>,
           target: (uint64) 0,
           err: (error) <nil>
          },
          (rawdb.randTestStep) {
           op: (int) 6,
           items: ([]uint64) <nil>,
           blobs: ([][]uint8) <nil>,
           target: (uint64) 0,
           err: (error) <nil>
          },
          (rawdb.randTestStep) {
           op: (int) 7,
           items: ([]uint64) <nil>,
           blobs: ([][]uint8) <nil>,
           target: (uint64) 0,
           err: (error) <nil>
          },
          (rawdb.randTestStep) {
           op: (int) 0,
           items: ([]uint64) <nil>,
           blobs: ([][]uint8) <nil>,
           target: (uint64) 0,
           err: (error) <nil>
          },
          (rawdb.randTestStep) {
           op: (int) 3,
           items: ([]uint64) <nil>,
           blobs: ([][]uint8) <nil>,
           target: (uint64) 0,
           err: (error) <nil>
          },
          (rawdb.randTestStep) {
           op: (int) 0,
           items: ([]uint64) <nil>,
           blobs: ([][]uint8) <nil>,
           target: (uint64) 0,
           err: (error) <nil>
          },
          (rawdb.randTestStep) {
           op: (int) 6,
           items: ([]uint64) <nil>,
           blobs: ([][]uint8) <nil>,
           target: (uint64) 0,
           err: (error) <nil>
          },
          (rawdb.randTestStep) {
           op: (int) 1,
           items: ([]uint64) <nil>,
           blobs: ([][]uint8) <nil>,
           target: (uint64) 0,
           err: (error) <nil>
          },
          (rawdb.randTestStep) {
           op: (int) 1,
           items: ([]uint64) <nil>,
           blobs: ([][]uint8) <nil>,
           target: (uint64) 0,
           err: (error) <nil>
          },
          (rawdb.randTestStep) {
           op: (int) 5,
           items: ([]uint64) <nil>,
           blobs: ([][]uint8) <nil>,
           target: (uint64) 0,
           err: (error) <nil>
          },
          (rawdb.randTestStep) {
           op: (int) 5,
           items: ([]uint64) <nil>,
           blobs: ([][]uint8) <nil>,
           target: (uint64) 0,
           err: (error) <nil>
          },
          (rawdb.randTestStep) {
           op: (int) 1,
           items: ([]uint64) (len=1 cap=1) {
            (uint64) 0
           },
           blobs: ([][]uint8) (len=1 cap=1) {
            ([]uint8) (len=8 cap=8) {
             00000000  00 00 00 00 00 00 00 00                           |........|
            }
           },
           target: (uint64) 0,
           err: (error) <nil>
          },
          (rawdb.randTestStep) {
           op: (int) 2,
           items: ([]uint64) <nil>,
           blobs: ([][]uint8) <nil>,
           target: (uint64) 0,
           err: (error) <nil>
          },
          (rawdb.randTestStep) {
           op: (int) 7,
           items: ([]uint64) <nil>,
           blobs: ([][]uint8) <nil>,
           target: (uint64) 0,
           err: (error) <nil>
          },
          (rawdb.randTestStep) {
           op: (int) 6,
           items: ([]uint64) <nil>,
           blobs: ([][]uint8) <nil>,
           target: (uint64) 1,
           err: (error) <nil>
          },
          (rawdb.randTestStep) {
           op: (int) 5,
           items: ([]uint64) <nil>,
           blobs: ([][]uint8) <nil>,
           target: (uint64) 1,
           err: (error) <nil>
          },
          (rawdb.randTestStep) {
           op: (int) 0,
           items: ([]uint64) <nil>,
           blobs: ([][]uint8) <nil>,
           target: (uint64) 0,
           err: (error) <nil>
          },
          (rawdb.randTestStep) {
           op: (int) 1,
           items: ([]uint64) (len=1 cap=1) {
            (uint64) 1
           },
           blobs: ([][]uint8) (len=1 cap=1) {
            ([]uint8) (len=8 cap=8) {
             00000000  00 00 00 00 00 00 00 01                           |........|
            }
           },
           target: (uint64) 0,
           err: (error) <nil>
          },
          (rawdb.randTestStep) {
           op: (int) 1,
           items: ([]uint64) (len=1 cap=1) {
            (uint64) 2
           },
           blobs: ([][]uint8) (len=1 cap=1) {
            ([]uint8) (len=8 cap=8) {
             00000000  00 00 00 00 00 00 00 02                           |........|
            }
           },
           target: (uint64) 0,
           err: (error) <nil>
          },
          (rawdb.randTestStep) {
           op: (int) 7,
           items: ([]uint64) <nil>,
           blobs: ([][]uint8) <nil>,
           target: (uint64) 0,
           err: (error) <nil>
          },
          (rawdb.randTestStep) {
           op: (int) 5,
           items: ([]uint64) <nil>,
           blobs: ([][]uint8) <nil>,
           target: (uint64) 1,
           err: (error) <nil>
          },
          (rawdb.randTestStep) {
           op: (int) 4,
           items: ([]uint64) <nil>,
           blobs: ([][]uint8) <nil>,
           target: (uint64) 1,
           err: (error) <nil>
          },
          (rawdb.randTestStep) {
           op: (int) 2,
           items: ([]uint64) <nil>,
           blobs: ([][]uint8) <nil>,
           target: (uint64) 0,
           err: (error) <nil>
          },
          (rawdb.randTestStep) {
           op: (int) 2,
           items: ([]uint64) <nil>,
           blobs: ([][]uint8) <nil>,
           target: (uint64) 0,
           err: (error) <nil>
          },
          (rawdb.randTestStep) {
           op: (int) 4,
           items: ([]uint64) <nil>,
           blobs: ([][]uint8) <nil>,
           target: (uint64) 1,
           err: (error) <nil>
          },
          (rawdb.randTestStep) {
           op: (int) 6,
           items: ([]uint64) <nil>,
           blobs: ([][]uint8) <nil>,
           target: (uint64) 1,
           err: (error) <nil>
          },
          (rawdb.randTestStep) {
           op: (int) 2,
           items: ([]uint64) <nil>,
           blobs: ([][]uint8) <nil>,
           target: (uint64) 0,
           err: (error) <nil>
          },
          (rawdb.randTestStep) {
           op: (int) 5,
           items: ([]uint64) <nil>,
           blobs: ([][]uint8) <nil>,
           target: (uint64) 1,
           err: (error) <nil>
          },
          (rawdb.randTestStep) {
           op: (int) 5,
           items: ([]uint64) <nil>,
           blobs: ([][]uint8) <nil>,
           target: (uint64) 1,
           err: (error) <nil>
          },
          (rawdb.randTestStep) {
           op: (int) 2,
           items: ([]uint64) <nil>,
           blobs: ([][]uint8) <nil>,
           target: (uint64) 0,
           err: (error) <nil>
          },
          (rawdb.randTestStep) {
           op: (int) 3,
           items: ([]uint64) <nil>,
           blobs: ([][]uint8) <nil>,
           target: (uint64) 1,
           err: (error) <nil>
          },
          (rawdb.randTestStep) {
           op: (int) 1,
           items: ([]uint64) (len=1 cap=1) {
            (uint64) 1
           },
           blobs: ([][]uint8) (len=1 cap=1) {
            ([]uint8) (len=8 cap=8) {
             00000000  00 00 00 00 00 00 00 01                           |........|
            }
           },
           target: (uint64) 0,
           err: (error) <nil>
          },
          (rawdb.randTestStep) {
           op: (int) 5,
           items: ([]uint64) <nil>,
           blobs: ([][]uint8) <nil>,
           target: (uint64) 1,
           err: (error) <nil>
          },
          (rawdb.randTestStep) {
           op: (int) 0,
           items: ([]uint64) <nil>,
           blobs: ([][]uint8) <nil>,
           target: (uint64) 0,
           err: (error) <nil>
          },
          (rawdb.randTestStep) {
           op: (int) 3,
           items: ([]uint64) <nil>,
           blobs: ([][]uint8) <nil>,
           target: (uint64) 1,
           err: (error) <nil>
          },
          (rawdb.randTestStep) {
           op: (int) 1,
           items: ([]uint64) <nil>,
           blobs: ([][]uint8) <nil>,
           target: (uint64) 0,
           err: (error) <nil>
          },
          (rawdb.randTestStep) {
           op: (int) 1,
           items: ([]uint64) <nil>,
           blobs: ([][]uint8) <nil>,
           target: (uint64) 0,
           err: (error) <nil>
          },
          (rawdb.randTestStep) {
           op: (int) 5,
           items: ([]uint64) <nil>,
           blobs: ([][]uint8) <nil>,
           target: (uint64) 1,
           err: (error) <nil>
          },
          (rawdb.randTestStep) {
           op: (int) 5,
           items: ([]uint64) <nil>,
           blobs: ([][]uint8) <nil>,
           target: (uint64) 1,
           err: (error) <nil>
          },
          (rawdb.randTestStep) {
           op: (int) 7,
           items: ([]uint64) <nil>,
           blobs: ([][]uint8) <nil>,
           target: (uint64) 0,
           err: (error) <nil>
          },
          (rawdb.randTestStep) {
           op: (int) 4,
           items: ([]uint64) <nil>,
           blobs: ([][]uint8) <nil>,
           target: (uint64) 1,
           err: (error) <nil>
          },
          (rawdb.randTestStep) {
           op: (int) 4,
           items: ([]uint64) <nil>,
           blobs: ([][]uint8) <nil>,
           target: (uint64) 1,
           err: (error) <nil>
          },
          (rawdb.randTestStep) {
           op: (int) 0,
           items: ([]uint64) <nil>,
           blobs: ([][]uint8) <nil>,
           target: (uint64) 0,
           err: (error) <nil>
          },
          (rawdb.randTestStep) {
           op: (int) 5,
           items: ([]uint64) <nil>,
           blobs: ([][]uint8) <nil>,
           target: (uint64) 1,
           err: (error) <nil>
          }
         }
        }
--- FAIL: TestFreezerReadAndTruncate (0.00s)
    freezer_table_test.go:483: AppendRaw(0, ...) returned error: the append operation is out-order: have 0 want 30
--- FAIL: TestFreezerTruncate (0.02s)
    freezer_table_test.go:374: AppendRaw(0, ...) returned error: the append operation is out-order: have 0 want 10
--- FAIL: TestFreezerOffset (0.02s)
    freezer_table_test.go:533: 
                Error Trace:    /home/ryan/Workspace/mainnet/optimism/op-geth/core/rawdb/freezer_table_test.go:533
                Error:          Received unexpected error:
                                the append operation is out-order: have 0 want 1000003
                Test:           TestFreezerOffset
--- FAIL: TestSnappyDetection (0.05s)
    freezer_table_test.go:262: AppendRaw(0, ...) returned error: the append operation is out-order: have 0 want 255
--- FAIL: TestFreezerBasicsClosing (0.05s)
    freezer_table_test.go:98: 
                Error Trace:    /home/ryan/Workspace/mainnet/optimism/op-geth/core/rawdb/freezer_table_test.go:98
                Error:          Received unexpected error:
                                the append operation is out-order: have 0 want 255
                Test:           TestFreezerBasicsClosing
--- FAIL: TestFreezerBasics (0.05s)
    freezer_table_test.go:50: AppendRaw(0, ...) returned error: the append operation is out-order: have 0 want 255

Version 1 count 7, deleted 0, hidden 0
| number | fileno | offset |
|--------|--------|--------|
|  000   |  000   |  020   | 
|  001   |  000   |  040   | 
|  002   |  001   |  020   | 
|  003   |  001   |  040   | 
|  004   |  002   |  020   | 
|  005   |  002   |  040   | 
|  006   |  003   |  020   | 
|--------------------------|


Version 1 count 7, deleted 0, hidden 1
| number | fileno | offset |
|--------|--------|--------|
|  000   |  000   |  020   | 
|  001   |  000   |  040   | 
|  002   |  001   |  020   | 
|  003   |  001   |  040   | 
|  004   |  002   |  020   | 
|  005   |  002   |  040   | 
|  006   |  003   |  020   | 
|--------------------------|

FAIL
FAIL    github.com/ethereum/go-ethereum/core/rawdb      0.665s
FAIL

Steps to reproduce the behaviour

$ go test 
chokobole added a commit that referenced this issue Mar 9, 2023
chokobole added a commit that referenced this issue Mar 10, 2023
0xHansLee pushed a commit to 0xHansLee/kroma-geth that referenced this issue May 9, 2023
This commit squashes the op-geth fork history into a more maintainable
diff for rebasing upon upstream geth.

reference-optimistic-geth changes (origins of op-geth in early Bedrock
development stage):
- Deposit TX Type
- Enable deposit tx in EVM/tx pool
- Change deposit nonce to not be the max nonce
- Extend PayloadAttributesV1 with a Transactions field
- Force deposits at the start of each L2 block
- Fix height check
- noTxPool flag, reproduce block in verifier mode without tx pool interference
- Fix RPC json marshalling (ref op-geth PR 4)
- Deposit txs block height check in block body validation (ref op-geth PR 5)
- core: do not try to reinject deposit txs into tx-pool (ref-op-geth PR 6)
- deposit source hash field instead of L2 block height and tx index combination
- Include invalid deposits, rewind state, but always persist mint (kroma-network#10)
- Provide gas to Call/Create in deposit transactions (kroma-network#12)
- Add docker builds (ref-op-geth PR 16, 17)
- Don't panic on deposit transaction signature values or chain ID (ref-op-geth PR 18)
- core: Add version to DepositTx (ref-op-geth PR 19)
- Enable Geth build/lint/test in CircleCI (ref-op-geth PR 23)
- core: Include guaranteed gas in the gas pool (ref-op-geth PR 21)
- core: handle base fee, l1 availability fee, tx fee (ref-op-geth PR 27)
- fix: deposit tx hash
- fix l1 fee cache, rpc, tracing and tx pool
- core: remove deposit-tx sub-type (a.k.a. deposit version byte)
- eth/catalyst: allow engine user to reorg own chain
- miner: restore ability to reorg deep as block builder
- params: print Optimism consensus type in banner
- core/types: remove unused protected() method, see upstream PR 23376
- core: do not mutate original balance value in tx pool l1 cost adjustment
- core: subtract deposit gas from pool, so other txs do not use the same gas. And fail tx processing if deposits reach gas limit
- core/types: deposits do not tip, avoid basefee subtraction
- Unmeter the L1 Attributes Transaction
- miner: handle force tx errors as critical, clean up diff
- ci: Switch branch
- eth,miner: return STATUS_INVALID when failing to process forced transactions in request (ref-op-geth PR 40)
- verifier: forward tx to sequencer based on flag
- txpool: add flag to disable tx gossip (ref-op-geth PR 42)
- Add op-geth version in addition to geth version (ref-op-geth PR 43)
- ci: CircleCI improvements (ref-op-geth PR 44)
- Rename to op-geth
- Build latest tag on optimism branch

op-geth changes:
- Expose cache config in simulated backend (kroma-network#2)
- Add EIP-1559 parameters
- eth/catalyst: update payload id computation (kroma-network#1)
- make eip1559 configurable (kroma-network#4)
- post-merge network should not log warnings about missing transition information (kroma-network#5)
- Make the simulator more configurable (kroma-network#6)
- fix OPB-6 - IsDepositTx check instead of artificial nonce value check (kroma-network#7)
- Simulated backend - enable proof of stake consensus type and fix performance issue (kroma-network#8)
- accounts: simulated backend consensus engine option and immediate tx indexing
- consensus/beacon: recognize all blocks as reached TTD with 0 TTD in chain config
- Add --rollup.historicalhttp CLI flag and fix backend iface
- Flags and interfaces for historical RPC requests (kroma-network#12)
- Redirect historical RPC requests (kroma-network#13)
- Use the pre-existing ethereum.NotFound error (kroma-network#18)
- Add historical endpoint to TraceBlockByNumber and TraceBlockByHash (kroma-network#19)
- Add historical endpoint to TraceTransaction (kroma-network#20)
- Add historical endpoint to TraceCall (kroma-network#21)
- optimism: fee params from info txi, update l1 cost func GPO params read (kroma-network#15)
- add hardcoded addresses for fee payouts (kroma-network#23)
- dynamic gas limit via engine API (kroma-network#22)

Co-authored-by: Matthew Slipper <me@matthewslipper.com>
Co-authored-by: Joshua Gutow <jgutow@oplabs.co>
Co-authored-by: protolambda <proto@protolambda.com>
Co-authored-by: Mark Tyneway <mark.tyneway@gmail.com>
Co-authored-by: Maurelian <maurelian@protonmail.ch>
@jyc228 jyc228 linked a pull request Mar 22, 2024 that will close this issue
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 a pull request may close this issue.

2 participants