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

chore(bolt-sidecar): test calculate_max_basefee() #681

Open
wants to merge 1 commit into
base: unstable
Choose a base branch
from

Conversation

estensen
Copy link
Contributor

Add tests to verify current behavior

Is adding 1 to to round up something that's intentional?

// Perform the multiplication and division (and add 1 to round up)
max_basefee = max_basefee * multiplier / divisor + 1;

@estensen
Copy link
Contributor Author

Is adding 1 to to round up something that's intentional?

I think overestimating the basefee is fine since we just wanna make sure we don't accept a lower fee than we should have.

@thedevbirb
Copy link
Contributor

I think adding 1 is used similarly to a div_ceil, and to ensure 0 is not returned. As such, a combination of div_cel and max(value, 1) is probably slightly better.

base fee should never be zero: https://github.com/ethereum/go-ethereum/blob/509a64ffb9405942396276ae111d06f9bded9221/consensus/misc/eip1559/eip1559.go#L74-L83

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.

2 participants