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

devnet: configuration fixes #8592

Merged
merged 12 commits into from
Nov 1, 2023
Merged

devnet: configuration fixes #8592

merged 12 commits into from
Nov 1, 2023

Conversation

battlmonstr
Copy link
Contributor

@battlmonstr battlmonstr commented Oct 26, 2023

  • fix "genesis hash does not match" when dev nodes connect
    The "dev" nodes need to have the same --miner.etherbase in order to generate the same genesis ExtraData by DeveloperGenesisBlock(). Override DevnetEtherbase global var that's used if --miner.etherbase is not passed. (for NonBlockProducer case)

  • fix missing private key for the hardcoded DevnetEtherbase
    Fixes panic if SigKey is not found. Bor non-producers will use a default DevnetEtherbase while Dev nodes modify it. Save hardcoded DevnetEtherbase/DevnetSignPrivateKey into accounts so that SigKey can recover it.

  • refactor devnet.node to contain Node config
    This avoids interface{} type casts and fixes an error with Heimdall.validatorSet == nil

  • add connection retries to rpcCall and Subscribe of requestGenerator
    Fixes "connection refused" errors due to node not ready to handle early RPC requests.

  • fix deadlock in Heimdall.NodeStarted

  • fix GetBlockByNumber
    Fixes "cannot unmarshal string into Go struct field body.transactions of type jsonrpc.RPCTransaction"

  • demote "no of blocks on childchain is less than confirmations required" to Info (devnet test error: L2 header processing - childchain has less confirmations than required #8626)

  • demote "mismatched pending subpool size" to Debug (devnet test failure: mismatched pending subpool size expected=0 got=1 #8615)

  • revert wiggle testing code

@battlmonstr battlmonstr requested a review from mh0lt October 26, 2023 10:36
@battlmonstr battlmonstr changed the title devnet: fix "genesis hash does not match" when dev nodes connect devnet: configuration fixes Oct 26, 2023
@battlmonstr battlmonstr marked this pull request as ready for review October 26, 2023 13:40
@battlmonstr battlmonstr force-pushed the pr/devnet_fix2 branch 7 times, most recently from 9d45a3a to ad3daab Compare October 30, 2023 17:15
The "dev" nodes need to have the same --miner.etherbase in order to
generate the same genesis ExtraData by DeveloperGenesisBlock().

Override DevnetEtherbase global var that's used if --miner.etherbase is not passed.
(for NonBlockProducer case)
* do not panic if SigKey is not found
* save hardcoded DevnetEtherbase/DevnetSignPrivateKey into accounts so that SigKey can recover it
this avoids interface{} type casts and fixes an error with Heimdall.validatorSet == nil
* read the respBody fully using io.ReadAll before trying to decode it
* unify sendHTTP and sendBatchHTTP
Problem:
If withTxs=false, the JSON response contains hash strings in "transactions",
and an attempt to Unmarshal to full jsonrpc.RPCTransaction objects fails with:

    json: cannot unmarshal string into Go struct field body.transactions of type jsonrpc.RPCTransaction

Solution:
Unmarshal to a new struct - BlockWithTxHashes in this case.
@battlmonstr battlmonstr merged commit 3698e7f into devel Nov 1, 2023
@battlmonstr battlmonstr deleted the pr/devnet_fix2 branch November 1, 2023 10:08
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.

1 participant