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

Update transaction format for Arbitrum #2243

Closed
leszko opened this issue Feb 7, 2022 · 2 comments · Fixed by #2171
Closed

Update transaction format for Arbitrum #2243

leszko opened this issue Feb 7, 2022 · 2 comments · Fixed by #2171

Comments

@leszko
Copy link
Contributor

leszko commented Feb 7, 2022

Is your feature request related to a problem? Please describe.
Arbitrum treats the gas price differently than Ethereum. It uses gasPrice as the maximum gas price that a user may pay. Also Aribtrum probably does not accept the post-london upgrade transaction format.

Describe the solution you'd like
We need address the following points:

  • Gas Price Monitor (oracle) does not make sense anymore
  • Transaction Replacement does not make sense anymore
  • All places where we use baseFee do not make sense anymore (there is no baseFee in Arbitrum)
  • Setting max gas price is different
@leszko leszko self-assigned this Feb 7, 2022
@yondonfu
Copy link
Member

yondonfu commented Feb 8, 2022

Can we just handle Arbitrum transactions the same way that we would handle any pre-London chain by defaulting to the legacy tx format similar to what the contract binding base code does i.e. check if the latest block header of the chain specifies a BaseFee and if not assume that the chain does not support the dynamic tx format and use the legacy tx format instead?

Gas Price Monitor (oracle) does not make sense anymore

I don't think this is true. The GasPriceMonitor is still used to return a cached gas price representing the expected current gas price of the chain in pm.Recipient in order to estimate the current transaction cost for redeeming a ticket.

Transaction Replacement does not make sense anymore

I don't think this is necessarily true. We could just adjust the GasPrice field of the replacement tx using the legacy format instead of the GasFeeCap/GasTipCap fields of the replacement using the dynamic fee format. It is worth noting that there is less of a need for replacement txs on Arbitrum right now given that txs should be confirmed almost instantaneously after being received, however, given the possibility of slower confirmations in the event of congestion I think it is worthwhile keeping this mechanism around for now.

All places where we use baseFee do not make sense anymore (there is no baseFee in Arbitrum)

It is also used here

if head.BaseFee == nil {
.

Setting max gas price is different

I believe the GasPrice field of a tx will always be the max that a user will pay per unit of gas consumed on Arbitrum and if that is the case we could just set the GasPrice field to the -maxGasPrice specified by a user and the user will always pay that price or less (will be less if the current gas price on Arbitrum is lower than the specified gas price). So, this could actually simplify things a bit!

@leszko
Copy link
Contributor Author

leszko commented Feb 8, 2022

Can we just handle Arbitrum transactions the same way that we would handle any pre-London chain by defaulting to the legacy tx format similar to what the contract binding base code does i.e. check if the latest block header of the chain specifies a BaseFee and if not assume that the chain does not support the dynamic tx format and use the legacy tx format instead?

Yes, I think you're right, I made the changes in the max gas price PR: #2171. PTAL

Gas Price Monitor (oracle) does not make sense anymore

I don't think this is true. The GasPriceMonitor is still used to return a cached gas price representing the expected current gas price of the chain in pm.Recipient in order to estimate the current transaction cost for redeeming a ticket.

Right, I didn't touch Gas Price Monitor.

Transaction Replacement does not make sense anymore

I don't think this is necessarily true. We could just adjust the GasPrice field of the replacement tx using the legacy format instead of the GasFeeCap/GasTipCap fields of the replacement using the dynamic fee format. It is worth noting that there is less of a need for replacement txs on Arbitrum right now given that txs should be confirmed almost instantaneously after being received, however, given the possibility of slower confirmations in the event of congestion I think it is worthwhile keeping this mechanism around for now.

Yes, you may be right. I kept the replacement logic. However, note that I never encountered the slow configuration. So the transaction was either accepted or rejected, never pending in Arbitrum.

All places where we use baseFee do not make sense anymore (there is no baseFee in Arbitrum)

It is also used here

if head.BaseFee == nil {

We don't need to change it for now since this logic is executed only in the case of dynamic fee tx. So, it won't be ever executed in Aribitrum.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants