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(cli): Remove babe-lead flag #3193

Merged
merged 3 commits into from
Apr 11, 2023

Conversation

dimartiro
Copy link
Contributor

@dimartiro dimartiro commented Apr 5, 2023

Changes

  • Removes babe-lead flag that prevents a node to create blocks until it receive the first one

Tests

make tests
  • manual tests running nodes locally checking that all nodes are producing blocks using the same canonical chain
  • also tested using zombienet

Issues

#3184

Primary Reviewer

@timwu20

@dimartiro dimartiro changed the title Diego/remove babe lead flag feat(cli): Remove babe-lead flag Apr 5, 2023
@dimartiro dimartiro force-pushed the diego/remove-babe-lead-flag branch from 5420c96 to 77f16ea Compare April 5, 2023 22:04
@codecov
Copy link

codecov bot commented Apr 5, 2023

Codecov Report

Merging #3193 (9b7f93d) into development (91b748f) will decrease coverage by 0.08%.
The diff coverage is n/a.

Additional details and impacted files
@@               Coverage Diff               @@
##           development    #3193      +/-   ##
===============================================
- Coverage        51.62%   51.55%   -0.08%     
===============================================
  Files              221      221              
  Lines            28283    28236      -47     
===============================================
- Hits             14601    14556      -45     
+ Misses           12364    12362       -2     
  Partials          1318     1318              

@noot
Copy link
Contributor

noot commented Apr 5, 2023

the reason the --babe-lead flag exists is because the start slot of the network is based on the timestamp of block 1. if there are two conflicting block 1s, then the network will partition due to some nodes having a different start slot than others. I'd ensure this issue is resolved before merging this

the fork choice rule should pick the same block 1 on every node, but I believe the start slot was being set on first validation which was the problem

@dimartiro
Copy link
Contributor Author

dimartiro commented Apr 6, 2023

the reason the --babe-lead flag exists is because the start slot of the network is based on the timestamp of block 1. if there are two conflicting block 1s, then the network will partition due to some nodes having a different start slot than others. I'd ensure this issue is resolved before merging this

the fork choice rule should pick the same block 1 on every node, but I believe the start slot was being set on first validation which was the problem

Thanks for this comment Elizabeth.

We've made a lot of changes since this flag was added, so I think that's why this issue should be resolved by now.
I did some tests locally and it seems to be working good selecting the right canonical chain but I gonna be doing more tests today to be sure.
I'm also working on use zombienet #3192 to automatize this tests
What do you think is the best way to test this change? If you have any recommendation will be very helpful
Also, do you know how is this solved in substrate?

@noot
Copy link
Contributor

noot commented Apr 6, 2023

okay awesome, I just wasn't sure if context was needed for why it was there in the first place lol. if it's working with multiple block producing nodes and multiple block 1s being produced then I think you're good 👍

edit: to force multiple block 1s you can modify the babe threshold to make it more likely btw

@dimartiro dimartiro changed the title feat(cli): Remove babe-lead flag refactor(cli): Remove babe-lead flag Apr 10, 2023
Copy link
Contributor

@qdm12 qdm12 left a comment

Choose a reason for hiding this comment

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

Looking nice 👍

@jimjbrettj
Copy link
Contributor

image
This is not a blocker I don't think, but do you know why two different blocks are built with the same number here?

To clarify, you did not introduce this, just an interesting thing I observed that probably should be looked into even if its not in this PR

Copy link
Contributor

@jimjbrettj jimjbrettj left a comment

Choose a reason for hiding this comment

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

Great work!

@dimartiro
Copy link
Contributor Author

image This is not a blocker I don't think, but do you know why two different blocks are built with the same number here?

To clarify, you did not introduce this, just an interesting thing I observed that probably should be looked into even if its not in this PR

Very good catch @jimjbrettj ! 👏 I executed the tests in development and it has the same behavior so it is not introduced by my change.

image

@dimartiro dimartiro merged commit af0435d into development Apr 11, 2023
@dimartiro dimartiro deleted the diego/remove-babe-lead-flag branch April 11, 2023 23:41
Copy link

🎉 This PR is included in version 0.8.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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.

4 participants