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

Proposer compare withdrawal roots #11977

Merged
merged 16 commits into from
Feb 17, 2023
Merged

Conversation

terencechain
Copy link
Member

Proposer should compare local vs builder withdrawal roots, if they don't match then default to local block building. This prevents builder and relayer bugs result in block proposal failures

@terencechain terencechain requested a review from a team as a code owner February 9, 2023 16:07
@terencechain terencechain requested review from kasey, rkapka and james-prysm and removed request for a team February 9, 2023 16:07
@saolyn
Copy link
Contributor

saolyn commented Feb 9, 2023

build is failing

Copy link
Contributor

@potuz potuz left a comment

Choose a reason for hiding this comment

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

LGTM

Comment on lines 75 to 76
matchWithdrawalRoot := bytes.Equal(r1, r2)
if !matchWithdrawalRoot {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
matchWithdrawalRoot := bytes.Equal(r1, r2)
if !matchWithdrawalRoot {
matchWithdrawalsRoot := bytes.Equal(r1, r2)
if !matchWithdrawalsRoot {

log.WithFields(logrus.Fields{
"local": r1,
"remote": r2,
}).Warn("Proposer: withdrawal roots don't match, using local")
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
}).Warn("Proposer: withdrawal roots don't match, using local")
}).Warn("Proposer: withdrawals roots don't match, using local")

// Compare payload values between local and builder. Default to the local value if it is higher.
builderValue, err := builderPayload.Value()
if err != nil {
log.WithError(err).Warn("Proposer: failed to get builder payload value") // Default to local if can't get builder value.
} else if builderValue.Cmp(localValue) > 0 {
} else if builderValue.Cmp(localValue) > 0 && matchWithdrawalRoot {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
} else if builderValue.Cmp(localValue) > 0 && matchWithdrawalRoot {
} else if builderValue.Cmp(localValue) > 0 && matchWithdrawalsRoot {

"local": r1,
"remote": r2,
}).Warn("Proposer: withdrawal roots don't match, using local")
}
Copy link
Contributor

Choose a reason for hiding this comment

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

An alternative is to add here an } else and prevent continuing if we already know that we are not going to use the builder cause the withdrawals root doesn't match

@delete-merged-branch delete-merged-branch bot deleted the branch develop February 10, 2023 19:36
@terencechain terencechain changed the base branch from proposer-compare-values to develop February 13, 2023 20:51
rauljordan
rauljordan previously approved these changes Feb 13, 2023
@terencechain terencechain self-assigned this Feb 14, 2023
@terencechain terencechain added the Ready For Review A pull request ready for code review label Feb 14, 2023
rauljordan
rauljordan previously approved these changes Feb 14, 2023
@prylabs-bulldozer prylabs-bulldozer bot merged commit 2839f2c into develop Feb 17, 2023
@delete-merged-branch delete-merged-branch bot deleted the proposer-compare-wd-roots branch February 17, 2023 15:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Ready For Review A pull request ready for code review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants