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

refactor: split config and genesis to client config and chain spec #1332

Merged
merged 1 commit into from
Aug 21, 2023

Conversation

yangby-cryptape
Copy link
Collaborator

@yangby-cryptape yangby-cryptape commented Aug 17, 2023

What this PR does / why we need it?

This PR split current config (config.toml) and genesis (genesis.json) into 2 parts:

  • Axon client configuration file (config.toml).

    All parameters in the client configuration can be modified after chain initialized, and the chain won't be affected by their changes.

    ❓ Is there any other parameters in config.toml can affect the consensus?

  • The chain specification (chain-spec.toml and genesis_transactions.json).

    All parameters in the chain specification are not allowed to be modified after the chain initialized.

    Any changes of the chain specification will make the chain to be a different chain.

    👉 A template of the chain specification:
    #
    # Data of the genesis block.
    #
    [genesis]
    timestamp = 1679656015
    extra_data = []
    base_fee_per_gas = "0x539"
    chain_id = 2022
    # A JSON file which includes all transactions in the genesis block.
    transactions = "genesis_transactions.json"
    
    #
    # Accounts since the genesis block.
    #
    
    [[accounts]]
    address = "0xa0ee7a142d267c1f36714e4a8f75612f20a79720"
    balance = "04ee2d6d415b85acef8100000000"
    
    [[accounts]]
    address = "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266"
    balance = "04ee2d6d415b85acef8100000000"
    
    #
    # Parameters which make the chain to be unique.
    #
    
    [params]

    The "params" section is empty now, so current PR is consensus compatible.
    In nearly future, contract_size_limit can be added into "params" section.

    ❓ Any other fields for genesis block should be configurable?

What is the impact of this PR?

Breaking Change:

  • Command line interface
    • The argeuments for run command are changed:
      • --genesis is removed.
      • --chain-spec replaces --genesis.
    • The user provided files for run command are changed.
      • The accounts section is removed from configuration file.
      • Two new files for chain specification: chain specification in TOML and genesis transactions in JSON.

Special notes for your reviewer:

NIL

PR relation:

CI Settings

CI Usage

Tip: Check the CI you want to run below, and then comment /run-ci.

CI Switch

  • Cargo Clippy
  • Coverage Test
  • E2E Tests
  • Code Format
  • Unit Tests
  • Web3 Compatible Tests
  • OCT 1-5 And 12-15
  • OCT 6-10
  • OCT 11
  • OCT 16-19
  • v3 Core Tests

CI Description

CI Name Description
Chaos CI Test the liveness and robustness of Axon under terrible network condition
Cargo Clippy Run cargo clippy --all --all-targets --all-features
Coverage Test Get the unit test coverage report
E2E Test Run end-to-end test to check interfaces
Code Format Run cargo +nightly fmt --all -- --check and cargo sort -gwc
Web3 Compatible Test Test the Web3 compatibility of Axon
v3 Core Test Run the compatibility tests provided by Uniswap V3
OCT 1-5 | 6-10 | 11 | 12-15 | 16-19 Run the compatibility tests provided by OpenZeppelin

@yangby-cryptape yangby-cryptape force-pushed the yangby/refactor/split-configs branch 3 times, most recently from 0e45800 to 6e6ca2b Compare August 17, 2023 07:57
@yangby-cryptape yangby-cryptape marked this pull request as ready for review August 17, 2023 08:10
@yangby-cryptape yangby-cryptape requested a review from a team as a code owner August 17, 2023 08:10
@yangby-cryptape yangby-cryptape requested review from jjyr, ashuralyk, Flouse, blckngm, driftluo and KaoImin and removed request for jjyr and ashuralyk August 17, 2023 08:10
@yangby-cryptape

This comment was marked as off-topic.

@axon-bot

This comment was marked as off-topic.

@yangby-cryptape yangby-cryptape force-pushed the yangby/refactor/split-configs branch from 6e6ca2b to b2ad2d7 Compare August 18, 2023 03:41
@yangby-cryptape

This comment was marked as off-topic.

@axon-bot
Copy link

axon-bot bot commented Aug 18, 2023

CI tests run on commit:

CI test list:

  • Code Format
  • Cargo Clippy
  • E2E Tests
  • Unit Tests

Please check ci test results later.

@Flouse Flouse linked an issue Aug 19, 2023 that may be closed by this pull request
@yangby-cryptape yangby-cryptape added this pull request to the merge queue Aug 21, 2023
Merged via the queue into main with commit 1d89fa1 Aug 21, 2023
@Flouse Flouse deleted the yangby/refactor/split-configs branch August 21, 2023 02:50
@Flouse Flouse linked an issue Aug 31, 2023 that may be closed by this pull request
20 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Refactor the config.toml, split the consensus parameters. Transactions root of genesis block is incorrect
4 participants