-
Notifications
You must be signed in to change notification settings - Fork 267
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
feat: retrieves timeout propose and timeout commit dynamically per height according to the app version #1494
feat: retrieves timeout propose and timeout commit dynamically per height according to the app version #1494
Conversation
…s-timeouts-to-endblock-abci
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for future readers, we've had discussions on if we need to store the timeouts in the state or not. We don't need to, as we're always capable of reading these values from the application. The rpc portion was also only added for being able to query nodes during tests, but is not needed.
also per a previous discussion, we don't need to block on that.
will approve after some e2e testing, either here or in the knuu tests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 thanks for testing this
its not a major deal, but in the future I think we can make reviewer's lives easier by limiting the scope of PRs. there are a lot of changes here such as unrelated spelling / doc stuff and RPC / storing the state that I think would have been possible to avoid.
if there are any remaining todos for edge cases or cleanups, then do you mind writing those up @staheri14 sometime next week?
I agree, I myself am against large PRs. However, for this one, I initially suggested creating an ADR, but it was deemed unnecessary. If we had an ADR, then major design decisions could have been documented, followed by smaller PRs based on that design. Since there was no design document, I had to include everything in a single PR to ensure it made sense to the reviewer. But if it makes it easier to review, I can and will be willing to split the PR into smaller PRs. |
Sure, will do next week! |
@@ -674,9 +674,28 @@ func (cs *State) updateToState(state sm.State) { | |||
// to be gathered for the first block. | |||
// And alternative solution that relies on clocks: | |||
// cs.StartTime = state.LastBlockTime.Add(timeoutCommit) | |||
cs.StartTime = cs.config.Commit(cmttime.Now()) | |||
|
|||
if state.LastBlockHeight == 0 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you want to keep this can you compact this into a simpler IsGenesis
method and then just have a single if statement to set cs.StartTime
Thanks for clarifying that saving timeouts and the RPC endpoint are for the celestia-app e2e tests. I had initially thought they were used in this repo for testing. My approach would be to measure the block time before the upgrade and measure the block time after the upgrade and assert that the first is close to 11 seconds and the second is close to 6 seconds |
…estiaorg/celestia-core into sanaz/adds-timeouts-to-endblock-abci
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A lot of the comments I left on the last review haven't been addressed. Do you want me to continue re-reviewing?
consensus/state.go
Outdated
// state represents the genesis state, hence the StartTime should be set based on the state's TimeoutCommit | ||
// we don't use cs.state.TimeoutCommit because that is zero | ||
cs.StartTime = cs.config.CommitWithCustomTimeout(cmttime.Now(), state.TimeoutCommit) | ||
} else { | ||
// if state does not represent the genesis state, | ||
// we use the cs.state.TimeoutCommit | ||
cs.StartTime = cs.config.CommitWithCustomTimeout(cmttime.Now(), cs.state.TimeoutCommit) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment wasn't addressed.
node/node.go
Outdated
fastSync := config.FastSyncMode && !onlyValidatorIsUs(state, | ||
pubKey) // the state certainly has the latest timeouts according |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment wasn't addressed.
node/node.go
Outdated
// app may modify the validator set, specifying ourselves as the only validator. | ||
fastSync := config.FastSyncMode && !onlyValidatorIsUs(state, | ||
pubKey) // the state certainly has the latest timeouts according | ||
// the app version lastBlock in the blockstore |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment wasn't addressed.
node/node.go
Outdated
@@ -888,6 +895,7 @@ func NewNodeWithContext(ctx context.Context, | |||
} | |||
|
|||
// Make MempoolReactor | |||
// TODO limit the proxyApp to Mempool only |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment wasn't addressed.
node/node.go
Outdated
@@ -943,6 +952,7 @@ func NewNodeWithContext(ctx context.Context, | |||
} | |||
|
|||
// Setup Transport. | |||
// TODO limit the proxyApp to Query only |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment wasn't addressed.
@@ -77,4 +77,7 @@ message State { | |||
|
|||
// the latest AppHash we've received from calling abci.Commit() | |||
bytes app_hash = 13; | |||
|
|||
// timeouts to be used for the next block height | |||
tendermint.abci.TimeoutsInfo timeouts = 15 [(gogoproto.nullable) = false]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[question] why not 14? The last used field number is 13
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is a good question
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's weirdly formatted but above there is initial_height
which uses the 14 tag
rpc/core/routes.go
Outdated
@@ -54,6 +54,9 @@ var Routes = map[string]*rpc.RPCFunc{ | |||
|
|||
// evidence API | |||
"broadcast_evidence": rpc.NewRPCFunc(BroadcastEvidence, "evidence"), | |||
|
|||
// get Timeouts by height | |||
"timeout": rpc.NewRPCFunc(ConsensusTimeoutsInfo, "height"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment wasn't addressed.
I'll still need to fix the linter, so there will be at least one more commit |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few of my comments still haven't been addressed but not going to block on any of them.
golangci-lint is failing.
It would have been nice if the PR description included a Testing section that describes how this PR was manually tested.
The celestia-core portion of #3859