Skip to content

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.

4 participants