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

Batch submitter sometimes reverts with block number is from the future #455

Closed
karlfloersch opened this issue Apr 13, 2021 · 8 comments
Closed
Labels
A-op-batcher Area: op-batcher C-bug Category: bugs

Comments

@karlfloersch
Copy link
Contributor

karlfloersch commented Apr 13, 2021

Describe the bug
The batch submitter is reverting when calling getNextPendingQueueElement

To Reproduce
Steps to reproduce the behavior:

  1. yarn hardhat node --no-deploy --fork <mainnet>
  2. Impersonate account for mainnet batch submitter address 0xfd7D4de366850C08EE2CBa32d851385A3071Ec8D
  3. Run transaction batch submitter with supplied config

Expected behavior
The batch should be submitted.

Logs

"id\":75,\"jsonrpc\":\"2.0\"}","requestMethod":"POST","url":"http://localhost:8545","stack":"Error: processing response error (body=\"{\\\"jsonrpc\\\":\\\"2.0\\\",\\\"id\\\":75,\
\\"error\\\":{\\\"code\\\":-32603,\\\"message\\\":\\\"VM Exception while processing transaction: revert Context block number is from the future.\\\"}}\", error={\"code\":-32603}, requestBody=\"{\\\"method\\\":\\\"eth_estimateGas\\\",\\\"params\\\":[{\\\"
gasPrice\\\":\\\"0x1dcd65000\\\",\\\"from\\\":\\\"0xfd7d4de366850c08ee2cba32d851385a3071ec8d\\\",\\\"to\\\":\\\"0x405b4008da75c48f4e54aa39607378967ae62338\\\",\\\"data\\\":

Config

# L1_NODE_WEB3_URL=
# L1_NODE_WEB3_URL=
# MNEMONIC=

ADDRESS_MANAGER_ADDRESS=0x1De8CFD4C1A486200286073aE91DE6e8099519f1
MIN_L1_TX_SIZE=20000
MAX_L1_TX_SIZE=120000
MAX_TX_BATCH_COUNT=250
MAX_STATE_BATCH_COUNT=1000
MAX_BATCH_SUBMISSION_TIME=900
POLL_INTERVAL=15000
NUM_CONFIRMATIONS=15
FINALITY_CONFIRMATIONS=60
RUN_TX_BATCH_SUBMITTER=true
RUN_STATE_BATCH_SUBMITTER=false
CLEAR_PENDING_TXS=false
SAFE_MINIMUM_ETHER_BALANCE=1
GAS_THRESHOLD_IN_GWEI=250
RESUBMISSION_TIMEOUT=900
MAX_GAS_PRICE_IN_GWEI=250
GAS_RETRY_INCREMENT=10
@gakonst
Copy link
Contributor

gakonst commented Apr 13, 2021

I'm not able to repro with the steps given in https://github.com/ethereum-optimism/optimism/compare/fix/mainnet-submitter

node exec/run-batch-submitter.js
{"level":30,"time":1618335136351,"msg":"Starting batch submitter..."}
{"level":30,"time":1618335136370,"batchSubmitterAddress":"0xfd7D4de366850C08EE2CBa32d851385A3071Ec8D","addressManagerAddress":"0x1De8CFD4C1A486200286073aE91DE6e8099519f1","msg":"Configured batch submitter addresses"}
{"level":30,"time":1618335141371,"address":"0xed2701f7135eab0D7ca02e6Ab634AD6CbE159Ffb","msg":"Initialized new CTC"}
{"level":30,"time":1618335141378,"address":"0xfd7D4de366850C08EE2CBa32d851385A3071Ec8D","ether":"2.569769098380553566","msg":"Checked balance"}
{"level":30,"time":1618335141378,"l2ChainId":"0xa","batchSubmitterAddress":"0xfd7D4de366850C08EE2CBa32d851385A3071Ec8D","msg":"Readying to submit next batch..."}
{"level":30,"time":1618335141378,"msg":"Getting batch start and end for transaction batch submitter..."}
{"level":30,"time":1618335144818,"startBlock":126004,"msg":"Retrieved start block number from CTC"}
{"level":30,"time":1618335145281,"endBlock":2056,"msg":"Retrieved end block number from L2 sequencer"}
{"level":50,"time":1618335145281,"msg":"More chain elements in L1 (126004) than in the L2 node (2056).\n                   This shouldn't happen because we don't submit batches if the sequencer is syncing."}
{"level":30,"time":1618335145281,"msg":"No txs to submit. Skipping batch submission...

@snario snario added C-bug Category: bugs A-op-batcher Area: op-batcher labels Apr 13, 2021
@karlfloersch
Copy link
Contributor Author

karlfloersch commented Apr 13, 2021

Sorry @gakonst that's because the AddressManagerAddress that I supplied is incorrect -- my bad!

The correct address is 0xd3EeD86464Ff13B4BFD81a3bB1e753b7ceBA3A39. I'll repro in your branch though

Update: @gakonst just pushed to your branch to repo the bug. It's a different error than I originally got because I had the wrong config originally--whoops!

@karlfloersch
Copy link
Contributor Author

karlfloersch commented Apr 13, 2021

I updated the error message. You can reproduce with @gakonst 's awesome branch - https://github.com/ethereum-optimism/optimism/compare/fix/mainnet-submitter

The commands to run:

yarn hardhat node --fork https://mainnet.infura.io/v3/<your api key>
yarn build
source ./batchEnv
node exec/run-batch-submitter.js

@karlfloersch karlfloersch changed the title Batch submitter is reverting when calling getNextPendingQueueElement Batch submitter is reverting with block number is from the future Apr 13, 2021
@snario
Copy link
Contributor

snario commented Apr 13, 2021

logs2.txt

I ran this locally and produced the above logs.

@snario snario changed the title Batch submitter is reverting with block number is from the future Batch submitter sometimes reverts with block number is from the future Apr 13, 2021
@snario
Copy link
Contributor

snario commented Apr 13, 2021

The batch submitter is also functioning after a restart. You can see that it is submitting batches now; https://etherscan.io/address/0xfd7d4de366850c08ee2cba32d851385a3071ec8d

@snario
Copy link
Contributor

snario commented Apr 15, 2021

We think that the flaky integration test #430 may be caused by issues related to this bug.

@smartcontracts
Copy link
Contributor

Does this still happen? cc @karlfloersch

@smartcontracts
Copy link
Contributor

Out of date since TypeScript batch submitter is gone

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-op-batcher Area: op-batcher C-bug Category: bugs
Projects
None yet
Development

No branches or pull requests

4 participants