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

IF: Unification: Deprecate proposal and new_block messages #1910

Closed
Tracked by #1508
arhag opened this issue Nov 16, 2023 · 4 comments · Fixed by #1919
Closed
Tracked by #1508

IF: Unification: Deprecate proposal and new_block messages #1910

arhag opened this issue Nov 16, 2023 · 4 comments · Fixed by #1919
Assignees

Comments

@arhag
Copy link
Member

arhag commented Nov 16, 2023

We do not need the new_block message anymore. Just get rid of it.

Remove proposal network message and instead generate a proposal to incorporate into qc_chain by generating one from the signed_block network message. We need to extract the relevant proposal information from the signed_block. Right now all that is needed is proposal it builds off of. This can be identified using the previous field of the signed_block. We can have the proposal ID be the block ID now to make this identification easy.

EDIT: We don't need to remove the proposal network message as part of this issue since we will make more significant changes soon that makes that work obsolete.

@fcecin
Copy link

fcecin commented Nov 19, 2023

Part 1/2 of this issue (remove new block message) is addressed by #1919

For part 2/2 (remove proposal message), my current idea is:

  • Remove message propagation from qc_chain::process_proposal, since it is no longer a network message
  • Change test_pacemaker to not require hs_proposal_message multi-hop propagation (do what was being done for the now defunct hs_new_block_message)

This guarantees that the unit tests keep working with minimal modifications (since the unit tests don't have signed_block, so they will keep using hs_proposal_message internally to emulate it, at least for now).

Then:

  • Produce a hs_proposal_message structure anywhere in e.g. net_plugin and pass it to the chain_pacemaker (e.g. when a signed_block is received, or at any time when a new proposal is supposed to be modeled inside of the qc_chain)
  • Remove qc_chain::on_beat() (no longer needed; instead the production of a signed_block locally is no different than receiving a signed_block from a remote producer)

Does this look like a good idea?

@linh2931
Copy link
Member

It sounds good. Shoud _message be dropped from hs_proposal_message in the structure's name?

@fcecin
Copy link

fcecin commented Nov 20, 2023

It sounds good. Shoud _message be dropped from hs_proposal_message in the structure's name?

I'm fiddling with this here and I think it is still called a "message", as that's how it's used in the unit tests. I am not sure if this struct is what's actually sent to the qc_chain in some callback. It is possible we don't even have to mention this struct outside of the hotstuff library, and instead you send something else (either some flat parameters in the callback notifying of a new signed_block being produced or received, or we send in some other structure that we could name hs_proposal for example. But I'm not sure at this point. So for now I'm leaving it as-is.

I think that after the prototype, the unit tests are going to change significantly. I am not sure we will be emulating the network in unit tests going forward. My instinct would be to write tests of the "integration" type, that is, start multiple nodeos processes to test networking. For this to work with IF we may need to expose some extra test APIs. But that would allow us to wipe all these messaging concepts that we are keeping in the prototype to ensure the whole thing can be validated very quickly and we can iterate fast (all the unit tests take 3 seconds to run).

This was referenced Nov 22, 2023
@fcecin fcecin linked a pull request Nov 23, 2023 that will close this issue
@arhag
Copy link
Member Author

arhag commented Dec 4, 2023

#1919 is sufficient to close this issue. #1929 is no longer needed.

@arhag arhag closed this as completed Dec 4, 2023
@github-project-automation github-project-automation bot moved this from Todo to Done in Team Backlog Dec 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
4 participants