-
Notifications
You must be signed in to change notification settings - Fork 361
roller: update tx gas cost as per EIP-7623 #7206
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
Conversation
pkg/arvo/ted/roller/send.hoon
Outdated
| =/ gas-limit=@ud | ||
| %+ add 22.000 :: 1.000 gas are added to the base fee for emitting the log | ||
| %+ max | ||
| (add (mul 16 p.batch-data) use-gas-price) |
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 don't see why the gas price comes in at this stage. If I understand the code correctly, you will end up with max-cost having a term that is quadratic in the gas price.
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.
How about something like
=/ gas-limit=@ud
%+ max
(add (mul 16 p.batch-data) 22.000)
(mul 40 p.batch-data)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.
Or for simplicity we could use
=/ gas-limit=@ud (add 22.000 (mul 40 p.batch-data))- I'm not sure what the impact is of specifying a higher gas limit than is actually needed though.
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'm not sure what the impact is of specifying a higher gas limit than is actually needed though.
I tried reading the Ethereum docs and it seems that if you specify a higher gas limit than needed, you only get charged for the gas actually used. https://ethereum.org/en/developers/docs/gas/#what-is-gas-limit
For example, if you put a gas limit of 50,000 for a simple ETH transfer, the EVM would consume 21,000, and you would get back the remaining 29,000.
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.
the impact is of specifying a higher gas limit
changing that is what enabled the blocked transactions in the main roller to be sent to the contract. it seems that specifying something less makes the transaction invalid and the nodes rejects them:
Any transaction with a gas limit below 21000 + TOTAL_COST_FLOOR_PER_TOKEN * tokens_in_calldata or below its intrinsic gas cost (take the maximum of these two calculations) is considered invalid.
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.
Sorry, my phrasing wasn't clear enough. I meant "higher than is actually needed" not "higher than we are specifying now". In other words, do we have to make an accurate calculation or can we just pick any number that is greater than the minimum even if it is an overestimate?
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.
Yeah, I believe any number high enough should work, and you would get the remaining back as you said.
resonant-riches
left a comment
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.
The simple version with the overestimate looks good to me. I haven't tested it though.
|
I tested this using the method suggested in #7192 (comment) and |
I spoke too soon, after a few minutes it said |
|
I will top up the wallet and try again. |
|
Theres a chance that you have enough funds but you've been retrying for so long that every attempt has increased the gas assigned for this transaction to something insane try this:
|
|
I messed things up by trying to rotate the account used by the roller rather than topping up the old account. But now it keeps trying to use the nonce from the old account and getting |
|
If you want to have at your roller problem synchronously you can shoot an email to [email protected], merging this fix now. |
See https://eips.ethereum.org/EIPS/eip-7623 for context