Skip to content

Inherit parent timestamp if later than child - #669

Open
yacovm wants to merge 3 commits into
mainfrom
654
Open

yacovm wants to merge 3 commits into
mainfrom
654

Conversation

@yacovm

@yacovm yacovm commented Oct 27, 2026 •

Copy link
Copy Markdown
Collaborator

This PR makes the child block inherit the timestamp of the parent if it's later. This makes the timestamp non-decreasing as in the proposerVM.

Signed-off-by: Yacov Manevich <yacov.manevich@avalabs.org>
@samliok

samliok commented Oct 28, 2026 •

Copy link
Copy Markdown
Collaborator

This PR makes the child block inherit the timestamp of the parent if it's later. This makes the timestamp non-decreasing as in the proposerVM.

Two questions

  1. Will a block verify if its child block has a lower timestamp than the parent?
  • Seems like we would reject it in verifyTimestamp?
  1. If yes to question 1, why don't we just check if child block has a lower timestamp and only then set the timestamp to the parent. Otherwise set it to now

@yacovm

yacovm commented Oct 28, 2026

Copy link
Copy Markdown
Collaborator Author

This PR makes the child block inherit the timestamp of the parent if it's later. This makes the timestamp non-decreasing as in the proposerVM.

Two questions

  1. Will a block verify if its child block has a lower timestamp than the parent?
  • Seems like we would reject it in verifyTimestamp?
  1. If yes to question 1, why don't we just check if child block has a lower timestamp and only then set the timestamp to the parent. Otherwise set it to now

The problem here is that if a block has a timestamp that is lower than its parent, it is an illegal block and verifyTimestamp rejects it.

If yes to question 1, why don't we just check if child block has a lower timestamp and only then set the timestamp to the parent. Otherwise set it to now

That's what we do though:

	if timestamp.Before(parentTime) {
		timestamp = parentTime
	}

@samliok samliok left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

same comments about the test as the other pr

#670 (comment)
#670 (comment)

Signed-off-by: Yacov Manevich <yacov.manevich@avalabs.org>
Signed-off-by: Yacov Manevich <yacov.manevich@avalabs.org>
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.

Honest builders never raise timestamp to parent's, so a leader's future timestamp voids honest proposals

2 participants