-
Notifications
You must be signed in to change notification settings - Fork 180
Add Buffer for Extra Data #45
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
base: main
Are you sure you want to change the base?
Conversation
|
@MSilb7 given our recent discussions about this, is this PR still relevant? |
|
cc @MSilb7 @sebastianst should we still consider this PR? |
|
|
||
| Conceptually what the above function captures is the formula below, where `compressedTxSize = | ||
| (zeroes*4 + ones*16) / 16` can be thought of as a rough approximation of how many bytes the | ||
| (zeroes*4 + ones*16 + 68*16) / 16` can be thought of as a rough approximation of how many bytes the |
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.
where did 68 come from? seems like magic number
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.
I think that's an estimate of the overhead data of a tx, mostly coming from its signature?
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.
In some places the 68 is hardcoded, to estimate cost before signing. But after the tx has been signed and encoded there's no need to add the 68. So it completely depends on context whether or not it's a necessary addition.
it has been merged to impl, so it seems we must https://github.com/ethereum-optimism/optimism/blob/6d9d43cb6f2721c9638be9fe11d261c0602beb54/packages/contracts-bedrock/src/L2/GasPriceOracle.sol#L236-L250 |
Add buffer in
compressed tx sizefor extra data, per: https://github.com/ethereum-optimism/optimism/blob/dad21c03834a3164ae7fbba2850dfd29b5e4dea7/packages/contracts-bedrock/src/L2/GasPriceOracle.sol#L159cc @K-Ho