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

Manual seal mode for dev #870

Merged
merged 13 commits into from
Jan 6, 2023
Merged

Manual seal mode for dev #870

merged 13 commits into from
Jan 6, 2023

Conversation

zqhxuyuan
Copy link
Contributor

@zqhxuyuan zqhxuyuan commented Oct 24, 2022

Description

relates to OR closes: #828

  • only produce blocks when a transaction is submitted
  • add localdev spec config for dev/standalone mode
  • extract builder logic into builder.rs
  • run single local node example: cargo run -- --chain=dolphin-localdev --alice
  • add instant finalized/sealing

image


Before we can approve this PR for merge, please make sure that all the following items have been checked off:

  • Linked to Github issue with discussion and accepted design OR have an explanation in the PR that describes this work.
  • Added one label out of the L- group to this PR
  • Added one or more labels from the A- and C- groups to this PR
  • Explicitly labelled A-calamari, A-dolphin and/or A-manta if your changes are meant for/impact either of these (CI depends on it)
  • This PR is targeted against the current Milestone ( otherwise discuss if it can be added in time)
  • Re-reviewed Files changed in the Github PR explorer.

Situational Notes:

  • If adding functionality, write unit tests!
  • If importing a new pallet, choose a proper module index for it, and allow it in BaseFilter. Ensure every extrinsic works from front-end. If there's corresponding tool, ensure both work for each other.
  • If needed, update our Javascript/Typescript APIs. These APIs are officially used by exchanges or community developers.
  • If modifying existing runtime storage items, make sure to implement storage migrations for the runtime and test them with try-runtime. This includes migrations inherited from upstream changes, and you can search the diffs for modifications of #[pallet::storage] items to check for any.
  • If runtime changes, need to update the version numbers properly:
    • authoring_version: The version of the authorship interface. An authoring node will not attempt to author blocks unless this is equal to its native runtime.
    • spec_version: The version of the runtime specification. A full node will not attempt to use its native runtime in substitute for the on-chain Wasm runtime unless all of spec_name, spec_version, and authoring_version are the same between Wasm and native.
    • impl_version: The version of the implementation of the specification. Nodes are free to ignore this; it serves only as an indication that the code is different; as long as the other two versions are the same then while the actual code may be different, it is nonetheless required to do the same thing. Non-consensus-breaking optimizations are about the only changes that could be made which would result in only the impl_version changing.
    • transaction_version: The version of the extrinsics interface. This number must be updated in the following circumstances: extrinsic parameters (number, order, or types) have been changed; extrinsics or pallets have been removed; or the pallet order in the construct_runtime! macro or extrinsic order in a pallet has been changed. You can run the metadata_diff.yml workflow for help. If this number is updated, then the spec_version must also be updated
  • Verify benchmarks & weights have been updated for any modified runtime logics

Signed-off-by: zqhxuyuan <zqhxuyuan@gmail.com>
Signed-off-by: zqhxuyuan <zqhxuyuan@gmail.com>
Signed-off-by: zqhxuyuan <zqhxuyuan@gmail.com>
@zqhxuyuan zqhxuyuan added A-client Client - i.e. not upgradeable with the runtime - changes C-experiment Category: Experimental feature or tool L-added Log: Issues and PRs related to addition labels Oct 24, 2022
@Garandor Garandor added the P-low Priority: Low label Nov 5, 2022
@github-actions
Copy link

Please signoff on all commits with your name, email and gpg key for the Developer's Certificate of Origin.
git config --global user.name your_name
git config --global user.email you_email
COMMAND : git commit -s -S -m your_commit_message
-s = Signed-off-by
-S = Verify commit using gpg key
If there is more than one commit in your pull request and your git client is modern enough (2.13+), rebase the required number of commits with --signoff:
git rebase --signoff HEAD~<number_of_commits>
Then, force push:
git push -f origin <your_branch>
For instructions on managing gpg signature verification please visit: https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits

Signed-off-by: zqhxuyuan <zqhxuyuan@gmail.com>
Signed-off-by: zqhxuyuan <zqhxuyuan@gmail.com>
@zqhxuyuan zqhxuyuan marked this pull request as ready for review January 3, 2023 09:40
ferrell-code and others added 2 commits January 3, 2023 17:42
Signed-off-by: Charles Ferrell <charlie@manta.network>
Signed-off-by: zqhxuyuan <zqhxuyuan@gmail.com>
Copy link
Contributor

@ferrell-code ferrell-code left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me

node/src/chain_specs/dolphin.rs Outdated Show resolved Hide resolved
node/src/chain_specs/dolphin.rs Outdated Show resolved Hide resolved
Signed-off-by: zqhxuyuan <zqhxuyuan@gmail.com>
ferrell-code
ferrell-code previously approved these changes Jan 4, 2023
@Garandor
Copy link
Contributor

Garandor commented Jan 4, 2023

building from the current commit and running cargo run -- --chain=dolphin-localdev --alice --force-authoring i get long log lines of

2023-01-04 14:46:38 💤 Idle (0 peers), best: #0 (0x7bd7…bee7), finalized #0 (0x7bd7…bee7), ⬇ 66 B/s ⬆ 82 B/s    
2023-01-04 14:46:43 💤 Idle (0 peers), best: #0 (0x7bd7…bee7), finalized #0 (0x7bd7…bee7), ⬇ 0 ⬆ 0    
2023-01-04 14:46:48 💤 Idle (0 peers), best: #0 (0x7bd7…bee7), finalized #0 (0x7bd7…bee7), ⬇ 54 B/s ⬆ 61 B/s    
2023-01-04 14:46:53 💤 Idle (0 peers), best: #0 (0x7bd7…bee7), finalized #0 (0x7bd7…bee7), ⬇ 0 ⬆ 0    
[...]
2023-01-04 14:49:18 💤 Idle (0 peers), best: #0 (0x7bd7…bee7), finalized #0 (0x7bd7…bee7), ⬇ 0 ⬆ 0    
2023-01-04 14:49:23 💤 Idle (0 peers), best: #0 (0x7bd7…bee7), finalized #0 (0x7bd7…bee7), ⬇ 0 ⬆ 0    
2023-01-04 14:49:28 💤 Idle (0 peers), best: #0 (0x7bd7…bee7), finalized #0 (0x7bd7…bee7), ⬇ 0 ⬆ 0    
2023-01-04 14:49:33 💤 Idle (0 peers), best: #0 (0x7bd7…bee7), finalized #0 (0x7bd7…bee7), ⬇ 0 ⬆ 0    

I gave up after 5min

@ferrell-code
Copy link
Contributor

building from the current commit and running cargo run -- --chain=dolphin-localdev --alice --force-authoring i get long log lines of

2023-01-04 14:46:38 💤 Idle (0 peers), best: #0 (0x7bd7…bee7), finalized #0 (0x7bd7…bee7), ⬇ 66 B/s ⬆ 82 B/s    
2023-01-04 14:46:43 💤 Idle (0 peers), best: #0 (0x7bd7…bee7), finalized #0 (0x7bd7…bee7), ⬇ 0 ⬆ 0    
2023-01-04 14:46:48 💤 Idle (0 peers), best: #0 (0x7bd7…bee7), finalized #0 (0x7bd7…bee7), ⬇ 54 B/s ⬆ 61 B/s    
2023-01-04 14:46:53 💤 Idle (0 peers), best: #0 (0x7bd7…bee7), finalized #0 (0x7bd7…bee7), ⬇ 0 ⬆ 0    
[...]
2023-01-04 14:49:18 💤 Idle (0 peers), best: #0 (0x7bd7…bee7), finalized #0 (0x7bd7…bee7), ⬇ 0 ⬆ 0    
2023-01-04 14:49:23 💤 Idle (0 peers), best: #0 (0x7bd7…bee7), finalized #0 (0x7bd7…bee7), ⬇ 0 ⬆ 0    
2023-01-04 14:49:28 💤 Idle (0 peers), best: #0 (0x7bd7…bee7), finalized #0 (0x7bd7…bee7), ⬇ 0 ⬆ 0    
2023-01-04 14:49:33 💤 Idle (0 peers), best: #0 (0x7bd7…bee7), finalized #0 (0x7bd7…bee7), ⬇ 0 ⬆ 0    

I gave up after 5min

Try submitting an extrinsic. It won't produce blocks unless a transaction is submitted

We should document this in README

@Garandor
Copy link
Contributor

Garandor commented Jan 4, 2023

the --force-authoring switch seems unnecessary. All it does in nimbus is skip eligibility check of the keys in the node. It'll use the first in store, which when run with --alice is the only one anyway

Copy link
Contributor

@Garandor Garandor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Almost LGTM, looks great with the factored out builder.rs

node/src/command.rs Outdated Show resolved Hide resolved
node/src/builder.rs Outdated Show resolved Hide resolved
Signed-off-by: zqhxuyuan <zqhxuyuan@gmail.com>
@Garandor Garandor added the DO-NOT-MERGE Labels a PR that should not be merged label Jan 5, 2023
Copy link
Contributor

@Garandor Garandor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thx for the PR and LGTM

@Garandor Garandor added A-client Client - i.e. not upgradeable with the runtime - changes and removed A-client Client - i.e. not upgradeable with the runtime - changes DO-NOT-MERGE Labels a PR that should not be merged labels Jan 5, 2023
@zqhxuyuan zqhxuyuan added A-calamari Area: Issues and PRs related to the Calamari Runtime A-dolphin Area: Issues and PRs related to the Dolphin Runtime labels Jan 6, 2023
Copy link
Contributor

@ghzlatarev ghzlatarev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice

@ghzlatarev ghzlatarev merged commit 1bdcec4 into manta Jan 6, 2023
@ghzlatarev ghzlatarev deleted the manual_seal_mode branch January 6, 2023 11:31
SupremoUGH pushed a commit that referenced this pull request Jan 10, 2023
* slot skip cause block2 stuck

Signed-off-by: zqhxuyuan <zqhxuyuan@gmail.com>

* slot skip cause block2 stuck

Signed-off-by: zqhxuyuan <zqhxuyuan@gmail.com>

* calamari works by only one collator

Signed-off-by: zqhxuyuan <zqhxuyuan@gmail.com>

* add dolphin localdev

Signed-off-by: zqhxuyuan <zqhxuyuan@gmail.com>

* add instant finalize

Signed-off-by: Charles Ferrell <charlie@manta.network>

* format

Signed-off-by: zqhxuyuan <zqhxuyuan@gmail.com>

* update dev name

Signed-off-by: zqhxuyuan <zqhxuyuan@gmail.com>

* build dev consensus

Signed-off-by: zqhxuyuan <zqhxuyuan@gmail.com>

Signed-off-by: zqhxuyuan <zqhxuyuan@gmail.com>
Signed-off-by: Charles Ferrell <charlie@manta.network>
Co-authored-by: Charles Ferrell <charlie@manta.network>
Co-authored-by: Adam Reif <garandor@manta.network>
Signed-off-by: SupremoUGH <francisco@manta.network>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-calamari Area: Issues and PRs related to the Calamari Runtime A-client Client - i.e. not upgradeable with the runtime - changes A-dolphin Area: Issues and PRs related to the Dolphin Runtime C-experiment Category: Experimental feature or tool L-added Log: Issues and PRs related to addition P-low Priority: Low
Projects
None yet
Development

Successfully merging this pull request may close these issues.

dev mode with instant-seal or without it
4 participants