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

fix(gnodev): time drifting in gnodev #1510

Merged
merged 1 commit into from
Jan 12, 2024

Conversation

gfanton
Copy link
Member

@gfanton gfanton commented Jan 10, 2024

fix #1507

It appears that using TestConsensusConfig as the default consensus configuration in gnodev causes time drift. This can be fixed by setting cfg.Consensus.SkipTimeoutCommit to false. However, I'm not certain about the exact reason why this setting actually corrects the time drifting issue.

@gfanton gfanton self-assigned this Jan 10, 2024
@gfanton gfanton requested a review from a team as a code owner January 10, 2024 09:35
Signed-off-by: gfanton <8671905+gfanton@users.noreply.github.com>
@thehowl
Copy link
Member

thehowl commented Jan 11, 2024

I'm putting in the review meeting to quickly assess whether this could have any unintended side effects we might want to guard against.

Copy link
Member

@zivkovicmilos zivkovicmilos left a comment

Choose a reason for hiding this comment

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

I'm suspecting this has to do with the moment at which the block proposer starts building the block (creates the VM context for the timestamp). The consensus protocol iterates through rounds until it is able to commit on a block, and move on to the next height. I'm guessing this setting forces the node to begin a new round with a fresh context instead of simply resetting the round (and keeping the old context with the old timestamp).

I'm not so sure this setting is part of the actual consensus (tendermint) specification, or just an in-code optimization (albeit buggy)

Copy link
Member

@thehowl thehowl left a comment

Choose a reason for hiding this comment

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

Agreed with Milos to merge it, as it only impacts gnodev anyway and we can understand root causes with later anyway :) (probably Milos' job with the consensus engine refactor 😈)

@thehowl thehowl merged commit cdc054b into gnolang:master Jan 12, 2024
8 checks passed
gfanton added a commit to moul/gno that referenced this pull request Jan 18, 2024
fix gnolang#1507 

It appears that using `TestConsensusConfig` as the default consensus
configuration in gnodev causes time drift. This can be fixed by setting
`cfg.Consensus.SkipTimeoutCommit` to `false`. However, I'm not certain
about the exact reason why this setting actually corrects the time
drifting issue.

Signed-off-by: gfanton <8671905+gfanton@users.noreply.github.com>
@gfanton gfanton deleted the fix/gnodev-time-drifting branch March 19, 2024 16:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Status: No status
Archived in project
Development

Successfully merging this pull request may close these issues.

gnodev time.Now() drifting away from real time
3 participants