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

Trades on Base Network failing #8190

Open
2 tasks done
MBMaria opened this issue Nov 26, 2024 · 3 comments
Open
2 tasks done

Trades on Base Network failing #8190

MBMaria opened this issue Nov 26, 2024 · 3 comments
Assignees
Labels
bug Something isn't working needs engineering Requires engineering input before bounty

Comments

@MBMaria
Copy link

MBMaria commented Nov 26, 2024

Overview

Attempting to trade on Base network is giving 500 server errors in console

References and additional details

Attempting a trade with approval 1:
image
https://jam.dev/c/c5279777-8c46-42a9-a24a-b87a4846ceb8
Attempting trade - the approval disappeared after the transaction finishes and the trade spits out a dud txid - also shows protocol as $2.62M . trade never completed
https://jam.dev/c/a26bb9f3-c3b2-4e5f-be0e-faf0eea0e35f

Acceptance Criteria

Should be able to trade on base

Need By Date

No response

Screenshots/Mockups

No response

Ownership

  • If my bounty needs engineering or needs product I have added the respective labels on the right
  • As the sponsor of this bounty I will review the changes in a preview environment (ops/product) or review the PR (engineering)

Estimated effort

No response

Sponsor / Stakeholder

No response

Bounty Hunters

  • Join our discord
  • Include an expected timeline for you to complete work in the work plan when you apply for this bounty!
  • Please refer to this link for some basic info
  • Please do not start work on this issue until you are approved in Gitcoin.
@MBMaria MBMaria added bug Something isn't working needs engineering Requires engineering input before bounty labels Nov 26, 2024
@woodenfurniture
Copy link
Member

"{\"code\":-32000,\"message\":\"transaction underpriced: gas tip cap 48, minimum needed 50\"}"

@gomesalexandre
Copy link
Contributor

gomesalexandre commented Nov 26, 2024

This logic works fine on other chains so assuming we respond with and/or call with wrong geth params somewhere in unchained land (48 instead of 50)

https://github.com/ethereum/go-ethereum/blob/b4d99e39176f89bb0ffbb32635e9cf17b5fd7367/core/txpool/validation.go#L120
https://github.com/ethereum/go-ethereum/blob/b4d99e39176f89bb0ffbb32635e9cf17b5fd7367/core/types/transaction.go#L343-L344
https://pkg.go.dev/github.com/ethereum/go-ethereum#CallMsg

GasTipCap *big.Int        // EIP-1559 tip per gas.

i.e this guy is effectively maxPriorityFeePerGas (the one we pass in) , which is 50, but actual tip is 48 i.e lower than the max (good) but also lower than the min (bad, this results in broadcast failures).

The min is defined as MinTip in geth and is the one that throws this error, since min tip is higher than actual, and doesn't seem to be something we're in control of with Tx input as we can control the cap, not the min (which is a node-level enforced number).

Just gave a try to a ugly monkey patch to triple check the the min gas tip issue is coming from the node and us parametrizing things doesn't change anything and we get the exact same error

diff --git a/packages/chain-adapters/src/evm/base/BaseChainAdapter.ts b/packages/chain-adapters/src/evm/base/BaseChainAdapter.ts
index 5127770f95..4d3e3c6e20 100644
--- a/packages/chain-adapters/src/evm/base/BaseChainAdapter.ts
+++ b/packages/chain-adapters/src/evm/base/BaseChainAdapter.ts
@@ -83,0 +84,6 @@ export class ChainAdapter extends EvmBaseAdapter<KnownChainIds.BaseMainnet> {
+    const maxPriorityFeePerGas = fast.maxPriorityFeePerGas
+      ? BigNumber.min(48, fast.maxPriorityFeePerGas).toFixed(0)
+      : undefined
+
@@ -91 +97 @@ export class ChainAdapter extends EvmBaseAdapter<KnownChainIds.BaseMainnet> {
-        chainSpecific: { gasLimit, l1GasLimit, ...fast },
+        chainSpecific: { gasLimit, l1GasLimit, ...fast, maxPriorityFeePerGas },
@@ -99 +105 @@ export class ChainAdapter extends EvmBaseAdapter<KnownChainIds.BaseMainnet> {
-        chainSpecific: { gasLimit, l1GasLimit, ...average },
+        chainSpecific: { gasLimit, l1GasLimit, ...average, maxPriorityFeePerGas },
@@ -107 +113 @@ export class ChainAdapter extends EvmBaseAdapter<KnownChainIds.BaseMainnet> {
-        chainSpecific: { gasLimit, l1GasLimit, ...slow },
+        chainSpecific: { gasLimit, l1GasLimit, ...slow, maxPriorityFeePerGas },

@gomesalexandre
Copy link
Contributor

gomesalexandre commented Nov 28, 2024

@kaladinlight not sure if that helps but FYI I'm now able to broadcast BASE approval Txs and trade Txs (seemingly), although actual trade Txs seem stuck in the mempool somehow https://basescan.org/tx/0xe46c5d808cf3aba3de3668f849a69371b301e62c72608b2e40dee01e62d29be7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs engineering Requires engineering input before bounty
Projects
Status: In progress
Development

No branches or pull requests

4 participants