8000 consensus: do we really need `initialHeight` in the consensus reactor? · Issue #4491 · cometbft/cometbft · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

consensus: do we really need initialHeight in the consensus reactor? #4491

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

Open
cason opened this issue Nov 14, 2024 · 2 comments
Open

consensus: do we really need initialHeight in the consensus reactor? #4491

cason opened this issue Nov 14, 2024 · 2 comments
Labels
consensus enhancement New feature or request

Comments

@cason
Copy link
Contributor
cason commented Nov 14, 2024
          Not regarding this PR, but the reason for which we need to keep this is so.... annoying and minor. I really would find a different solution for that.

Originally posted by @cason in #4436 (comment)


This value is copied from the consensus state (the actual algorithm implementation) in order to validate received messages of a single type, which is a control message, where a node reports its current state:

func (m *NewRoundStepMessage) ValidateHeight(initialHeight int64) error

I really think that once we have started a node, the state.InitialHeight never changes. It is setup in the genesis, loaded at startup, but it cannot be changed by the anyone. This code is super old, introduced by tendermint/tendermint#5191.

Nonetheless, with more or less efficient methods we are pulling this integer every time we receive such a message from any peer (several times per consensus round). This is really inefficient and we should probably get rid of this logic.

@andynog
Copy link
Contributor
andynog commented Nov 14, 2024

I think it makes sense. It seems that you can get that from the state and as you mentioned it doesn't change.

@faddat
Copy link
Contributor
faddat commented Nov 27, 2024

I agree with @andynog ; we need initialHeight.

A great example was saving Juno.

After the attack that shattered it into 1 chain per validator (btw still don't know how this happened, all vals saw their block as valid (kinda know how it happened, I think something with using system time) we used that feature to get the chain up and running again.

Note: just reread issue and noted the title -- as for the feature I would vote to keep it.

And for where - I noticed you mentioned the consensus reactor -- was there thought to moving it elsewhere?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
consensus enhancement New feature or request
Projects
No open projects
Status: Todo
Development

No branches or pull requests

3 participants
0