flashbots / ethers-provider-flashbots-bundle

Flashbots provider for ethers.js
543 stars 212 forks source link

simulate error code=-32000 #114

Open yuzhongrong opened 7 months ago

yuzhongrong commented 7 months ago
image

the code:

` const maxBaseFeeInFutureBlock = FlashbotsBundleProvider.getMaxBaseFeeInFutureBlock(block.baseFeePerGas, BLOCKS_IN_THE_FUTURE)

 //定义一个eip1559交易
const eip1559Transaction  = {
  to: '0xC1c4301C5bd4eBe2C04817aC815AaceB4DeDA8DB',
  type: 2,
  maxFeePerGas: PRIORITY_FEE.add(maxBaseFeeInFutureBlock),
  maxPriorityFeePerGas: PRIORITY_FEE,
  gasLimit: 100000,
  data: '0x',
  chainId: 5,
  value: ethers.utils.parseEther("0.1105"),
  nonce:mNonce

}

//签名绑定包
const signedTransactions = await flashbotsProvider.signBundle([

  {
    signer: wallet,
    transaction: eip1559Transaction
  }
])

//模拟
const targetBlockNumber = block.number + BLOCKS_IN_THE_FUTURE
const simulation = await flashbotsProvider.simulate(signedTransactions, targetBlockNumber)

// Using TypeScript discrimination
if ('error' in simulation) {
  console.warn(`Simulation Error: ${simulation.error.message}`)
  process.exit(1)
} else {
  console.log(`Simulation Success: ${JSON.stringify(simulation, null, 2)}`)
}

`

yuzhongrong commented 7 months ago

Why does it always show -32000 ,Is there something wrong?

m-tq commented 7 months ago

i have the same issue

yuzhongrong commented 7 months ago

it is upgrading??

yuzhongrong commented 7 months ago

Still the same today.
the los is Simulation Error: err: %!w(); txhash 0xb9db468643784760b03e4e9f3e50b467a88150fd2d47838f42f6a1289bb95016

m-tq commented 7 months ago

i don't know whats wrong, but before its working fine

yuzhongrong commented 7 months ago

i don't know whats wrong, but before its working fine

i switch the sepolia network. it is error again

this is. log:

status: 500, headers: { date: 'Sun, 28 Jan 2024 08:07:38 GMT', 'content-type': 'application/json', 'content-length': '33', connection: 'close', 'x-amzn-requestid': '44d81010-a09b-4ff6-809d-00b811424e6b', 'x-amz-apigw-id': 'SPazwFmNCYcEcoA=', vary: 'Origin', 'x-amzn-trace-id': 'Root=1-65b60b4a-735ba67e7cd33f440702c49c;Sampled=0;lineage=48094f26:0' }, body: '{"error":"Internal Server Error"}',

yuzhongrong commented 7 months ago

This should be flashbot’s own internal problem