Skip to content
This repository has been archived by the owner on May 24, 2022. It is now read-only.

Cannot start a node if EIP-1559 is activated from genesis #438

Open
varasev opened this issue Jun 17, 2021 · 13 comments · May be fixed by #621
Open

Cannot start a node if EIP-1559 is activated from genesis #438

varasev opened this issue Jun 17, 2021 · 13 comments · May be fixed by #621
Assignees
Labels
Projects

Comments

@varasev
Copy link
Collaborator

varasev commented Jun 17, 2021

Hello,

I'm trying to test EIP-1559 in OpenEthereum v3.3.0-rc.1 with AuRa, but cannot start a node when eip1559Transition is activated.

For the try, I'm using posdao-test-setup repo. I'm just starting it with npm run all (see the instruction in readme).

If I don't set eip1559Transition in posdao-contracts/templates/spec.json file, the test setup works fine.

But if I set eip1559Transition to 0 there and start posdao-test-setup from scratch, the first node (node0) contains the following error in logs (data/node0/log):

thread 'main' panicked at 'block header, view rlp is trusted and should be valid: RlpInvalidIndirection', crates/ethcore/types/src/encoded.rs:290:17
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

It blocks other nodes to start.

If I set eip1559Transition to 10 and then restart from scratch, I see the following error at block 10:

2021-06-17 12:32:30  Worker AuRa3 WARN openethereum  Panic occured, see stderr for details


====================

   0: backtrace::backtrace::trace
   1: backtrace::capture::Backtrace::new
   2: panic_hook::set_with::{{closure}}
   3: std::panicking::rust_panic_with_hook
   4: std::panicking::begin_panic::{{closure}}
   5: std::sys_common::backtrace::__rust_end_short_backtrace
   6: std::panicking::begin_panic
   7: ethcore::machine::impls::EthereumMachine::populate_from_parent
   8: <ethcore::client::client::Client as ethcore::client::traits::PrepareOpenBlock>::prepare_open_block
   9: ethcore::miner::miner::Miner::prepare_block
  10: <ethcore::miner::miner::Miner as ethcore::miner::MinerService>::update_sealing
  11: <ethcore::engines::authority_round::TransitionHandler as ethcore_io::IoHandler<()>>::timeout
  12: ethcore_io::worker::Worker::new::{{closure}}::{{closure}}
  13: <futures::future::loop_fn::LoopFn<A,F> as futures::future::Future>::poll
  14: std::sys_common::backtrace::__rust_begin_short_backtrace
  15: core::ops::function::FnOnce::call_once{{vtable.shim}}
  16: std::sys::unix::thread::Thread::new::thread_start
  17: __pthread_body
  18: __pthread_start


Thread 'Worker AuRa3' panicked at 'Gas limit should be > 0', crates/ethcore/src/machine/impls.rs:270

This is a bug. Please report it at:

    https://github.com/openethereum/openethereum/issues/new

I know that OpenEthereum doesn't support EIP-1559 for POSDAO yet, but currently I even cannot run a node from genesis with EIP-1559. Probably, I'm missing some configuration nuances?

The spec is attached: spec.json.zip

@sunce86
Copy link
Contributor

sunce86 commented Jun 17, 2021

Hi,

Yes you are missing additional fields in spec.json. Please see:
https://github.com/openethereum/openethereum/blob/main/crates/ethcore/res/chainspec/ropsten.json#L62

You need to set also:
"eip1559BaseFeeMaxChangeDenominator": "0x8",
"eip1559ElasticityMultiplier": "0x2",
"eip1559BaseFeeInitialValue": "0x3B9ACA00"

Please add this to the spec and let me know what happens.

@sunce86 sunce86 added the london label Jun 17, 2021
@sunce86 sunce86 self-assigned this Jun 17, 2021
@varasev
Copy link
Collaborator Author

varasev commented Jun 17, 2021

Hi @sunce86, thank you. I tried to add those but still see the same error. Spec is attached: spec.json.zip

@sunce86
Copy link
Contributor

sunce86 commented Jun 17, 2021

@varasev Does the error "panicked at 'Gas limit should be > 0', crates/ethcore/src/machine/impls.rs:270" still appears? It should be solved now and possibly show a different error now.

Regarding the first error: "thread 'main' panicked at 'block header, view rlp is trusted and should be valid: RlpInvalidIndirection', crates/ethcore/types/src/encoded.rs:290:17" my first guess is that it happens because your block headers don't contain base fee field? After 1559 activation, it is required from block header to contain additional value in RLP (base fee).

@sunce86
Copy link
Contributor

sunce86 commented Jun 19, 2021

@varasev Please check #440 (comment)

@varasev
Copy link
Collaborator Author

varasev commented Jun 20, 2021

@sunce86 I will try that, thanks

@varasev
Copy link
Collaborator Author

varasev commented Jun 21, 2021

@sunce86 I tried to add the baseFee field to genesis as follows:

  "genesis": {
    "seal": {
      "authorityRound": {
        "step": "0x0",
        "signature": "0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
      }
    },
    "difficulty": "0x20000",
    "gasLimit": "0x989680",
    "baseFee": "0x3B9ACA00"
  },

Now, if I set eip1559Transition to 0, the following error occurs (RlpExpectedToBeList):

Loading config file from ./config/node1.openethereum.toml
2021-06-21 11:20:06  main INFO openethereum::run  Starting OpenEthereum/v3.3.0-rc.1-stable-193b25a22-20210615/x86_64-macos/rustc1.48.0
2021-06-21 11:20:06  main INFO openethereum::run  Keys path data/node1/keys/DPoSChain
2021-06-21 11:20:06  main INFO openethereum::run  DB path data/node1/chains/DPoSChain/db/a11db89e017a2922
2021-06-21 11:20:06  main INFO openethereum::run  State DB configuration: archive +Fat +Trace
2021-06-21 11:20:06  main INFO openethereum::run  Operating mode: active
2021-06-21 11:20:06  main WARN openethereum::run  Warning: Warp Sync is disabled because Fat DB is turned on.
2021-06-21 11:20:07  main WARN engine  Not preparing block; cannot sign.
2021-06-21 11:20:07  main INFO ethcore_service::service  Configured for DPoSChain using AuthorityRound engine
2021-06-21 11:20:07  main TRACE engine  Multi ValidatorSet retrieved for block 0.
2021-06-21 11:20:07  main WARN client  Error generating genesis epoch data: Invalid name `please ensure the contract and method you're calling exist! failed to decode empty bytes. if you're using jsonrpc this is likely due to jsonrpc returning `0x` in case contract or method don't exist`. Snapshots generated may not be complete.
2021-06-21 11:20:07  main TRACE engine  Setting up contract caller.
2021-06-21 11:20:07  main TRACE miner  minimal_gas_price: recalibrating...
2021-06-21 11:20:07  main DEBUG miner  minimal_gas_price: Got gas price! 1000000000
2021-06-21 11:20:07  Worker devp2p2 INFO network  Public node URL: enode://f720cfa5399caa451b9ec770f277f1d1180aca89526d56d1bec38dde6fad6c2ee581c40406ba673d23723a98981b4f24134975a547ead00fc089149dc019c2d9@192.168.31.233:30301
2021-06-21 11:20:07  main INFO parity_ws  Listening for new connections on 0.0.0.0:9541.
2021-06-21 11:20:09   INFO parity_ws::io  Accepted a new tcp connection from 127.0.0.1:55997.
2021-06-21 11:20:10  Worker AuRa1 TRACE miner  update_sealing
2021-06-21 11:20:10  Worker AuRa1 TRACE miner  requires_reseal: sealing enabled
2021-06-21 11:20:10  Worker AuRa1 DEBUG engine  Zooming to epoch after block 0xbbc0…2a89
2021-06-21 11:20:10  Worker AuRa1 WARN openethereum  Panic occured, see stderr for details


====================

   0: backtrace::backtrace::trace
   1: backtrace::capture::Backtrace::new
   2: panic_hook::set_with::{{closure}}
   3: std::panicking::rust_panic_with_hook
   4: std::panicking::begin_panic_handler::{{closure}}
   5: std::sys_common::backtrace::__rust_end_short_backtrace
   6: _rust_begin_unwind
   7: core::panicking::panic_fmt
   8: core::option::expect_none_failed
   9: ethcore::engines::authority_round::EpochManager::zoom_to_after
  10: <ethcore::engines::authority_round::AuthorityRound as ethcore::engines::Engine<ethcore::machine::impls::EthereumMachine>>::sealing_state
  11: ethcore::miner::miner::Miner::requires_reseal
  12: <ethcore::miner::miner::Miner as ethcore::miner::MinerService>::update_sealing
  13: <ethcore::engines::authority_round::TransitionHandler as ethcore_io::IoHandler<()>>::timeout
  14: ethcore_io::worker::Worker::new::{{closure}}::{{closure}}
  15: std::sys_common::backtrace::__rust_begin_short_backtrace
  16: core::ops::function::FnOnce::call_once{{vtable.shim}}
  17: std::sys::unix::thread::Thread::new::thread_start
  18: __pthread_body
  19: __pthread_start


Thread 'Worker AuRa1' panicked at 'proof produced by this engine; therefore it is valid; qed: Error(Decoder(RlpExpectedToBeList), State { next_error: None, backtrace: InternalBacktrace { backtrace: None } })', crates/ethcore/src/engines/authority_round/mod.rs:459

This is a bug. Please report it at:

    https://github.com/openethereum/openethereum/issues/new


2021-06-21 11:20:10  main INFO openethereum::run  Finishing work, please wait...
Error: 1

Also, there is an Error generating genesis epoch data ... in the log above. It is not observed when I try to set eip1559Transition to 10.

When I try setting eip1559Transition to 10, I don't see the error Gas limit should be > 0 anymore, but I see Failed to prepare engine transactions for new block: Error(Engine(Custom("Randomness error in load(): LoadFailed(CallFailed(\"Execution(GasPriceLowerThanBaseFee { gas_price: 0, base_fee: 1000000000 })\"))")), State { next_error: None, backtrace: InternalBacktrace { backtrace: None } })

This is expected in the current implementation because it doesn't support zero gas price transactions with EIP-1559 which we expect to be fixed with #437

Attached the spec: spec.json.zip

@varasev
Copy link
Collaborator Author

varasev commented Jun 28, 2021

Hi @sunce86, Are there any updates on this?

@sunce86
Copy link
Contributor

sunce86 commented Jun 28, 2021

Hi, 1559 changes for the xDai are in progress, it will be included in the next release which is expected sometime next week. Lets check this bug again with the 1559 changes done.

@varasev
Copy link
Collaborator Author

varasev commented Jun 28, 2021

@sunce86 Thanks, looking forward to this.

@varasev
Copy link
Collaborator Author

varasev commented Jul 13, 2021

@sunce86 Hi, any news on 1559 changes for xDai?

@sunce86
Copy link
Contributor

sunce86 commented Jul 13, 2021

@varasev hi, there is a plan to finish xDai changes this week hopefully (had some additional non-planned features to implement for London in the meantime).

@varasev
Copy link
Collaborator Author

varasev commented Jul 13, 2021

@sunce86 great, thanks 👍

@varasev
Copy link
Collaborator Author

varasev commented Aug 3, 2021

Hi @sunce86, I tried the latest https://github.com/openethereum/openethereum/tree/sunce86/eip1559-for-xDai and still see the same error when starting from genesis.

When I try to set eip1559Transition to 10, I don't see GasPriceLowerThanBaseFee error anymore, but I see that the randomness transactions are not mined.

To reproduce this, you can uncomment these lines gnosischain/posdao-test-setup@0eae1df in posdao-test-setup/scripts/copy-spec.js and then run the setup with npm run all. In a separate console window run npm run watcher - you will see that there are no randomness transactions after block 19. Randomness transactions use zero gas price (see

// Random number generation
let contract = util::BoundContract::new(&*client, BlockId::Latest, contract_addr);
let phase = randomness::RandomnessPhase::load(&contract, our_addr)
.map_err(|err| EngineError::Custom(format!("Randomness error in load(): {:?}", err)))?;
let data = match phase
.advance(&contract, &mut OsRng, signer.as_ref())
.map_err(|err| {
EngineError::Custom(format!("Randomness error in advance(): {:?}", err))
})? {
Some(data) => data,
None => return Ok(Vec::new()), // Nothing to commit or reveal at the moment.
};
let nonce = block.state.nonce(&our_addr)?;
let tx_request = TransactionRequest::call(contract_addr, data)
.gas_price(U256::zero())
.nonce(nonce);
Ok(vec![full_client.create_transaction(tx_request)?])
) - they should appear after block 19 in this case (you can check it if you comment out eip1559Transition and try to run the setup from scratch).

@varasev varasev assigned rimrakhimov and unassigned sunce86 Nov 12, 2021
@varasev varasev changed the title Cannot start a node when EIP-1559 is activated Cannot start a node if EIP-1559 is activated from genesis Nov 12, 2021
@ulyanas ulyanas added this to To do in Support via automation Dec 1, 2021
@rimrakhimov rimrakhimov moved this from To do to In progress in Support Mar 3, 2022
@rimrakhimov rimrakhimov linked a pull request Mar 3, 2022 that will close this issue
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
Status: In Progress
Support
In progress
Development

Successfully merging a pull request may close this issue.

3 participants