-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Conversation
build is failing |
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.
LGTM
matchWithdrawalRoot := bytes.Equal(r1, r2) | ||
if !matchWithdrawalRoot { |
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.
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") |
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.
}).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 { |
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.
} 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") | ||
} |
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.
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
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