Flashbot bundle is not included because "isSendToMiners" is false?

Open
#123 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
25/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
javascript
Domain
api

Research direction

Start by tracing the flashbotsProvider calls to signBundle, simulate, sendRawBundle, and getBundleStats in the reported example. Compare the target blocks used for simulation and submission, then determine whether isSentToMiners=false is expected for these submissions; done means documenting the cause and the expected bundle status behavior.

Written by the indexing model from the issue text.

Description

I'm trying to send a flashbot Bundle with several transactions. I use the following code to sign and send a bundle:

 const signedTransactions = await flashbotsProvider.signBundle([
    {
      signer: MyWallet,
      transaction: firstTx
    },
    {
      signer: MyWallet,
      transaction: secondTx
    },
    {
      signer: MyWallet,
      transaction: thirdTx
    }]);
    const targetBlockNumber = block.number; 
    const simulation = await flashbotsProvider.simulate(
      signedTransactions,
      targetBlockNumber + 1
    )

    console.log(simulation);
    console.log("bundleHash: ", simulation.bundleHash);

    for (var i = 1; i <= 10; i++) {

      console.log(">>>>>> ", i);

      const bundleSubmission = await flashbotsProvider.sendRawBundle(
        signedTransactions,
        targetBlockNumber + i
      )
      console.log('bundle submitted, waiting', bundleSubmission.bundleHash)

      const waitResponse = await bundleSubmission.wait()
      console.log(`Wait Response: ${FlashbotsBundleResolution[waitResponse]}`)
      if (
        waitResponse === FlashbotsBundleResolution.BundleIncluded ||
        waitResponse === FlashbotsBundleResolution.AccountNonceTooHigh
      ) {
        console.log('Bundle included!')
        process.exit(0)
      } else {

        console.log(">>>", simulation.bundleHash);

        console.log({
          bundleStats: await flashbotsProvider.getBundleStats(
            simulation.bundleHash,
            targetBlockNumber + 1,
          ),
          userStats: await flashbotsProvider.getUserStats(),
        })
      }
    }

The simulation is successful. However, In order to ensure that the bundle can be included, I for loop 10 times to send a new bundle in case the previous bundle fails. It seems that the bundles are not included because they are not sent to the miners(isSentToMiners is false). Why does this happen?

bundleHash:  0x012ca7ac493afc4bf288bb9cde4b49d521d1c12c01d66705d8fbd3bdfb1c6112
>>>>>>  1
bundle submitted, waiting 0x012ca7ac493afc4bf288bb9cde4b49d521d1c12c01d66705d8fbd3bdfb1c6112
Wait Response: BlockPassedWithoutInclusion
>>> 0x012ca7ac493afc4bf288bb9cde4b49d521d1c12c01d66705d8fbd3bdfb1c6112
{
  bundleStats: {
    isHighPriority: true,
    isSentToMiners: false,
    isSimulated: true,
    simulatedAt: '2023-02-12T08:03:16.241Z',
    submittedAt: '2023-02-12T08:03:16.233Z'
  },
  userStats: {
    all_time_gas_simulated: '',
    all_time_miner_payments: '',
    is_high_priority: false,
    last_1d_gas_simulated: '',
    last_1d_miner_payments: '',
    last_7d_gas_simulated: '',
    last_7d_miner_payments: ''
  }
}
>>>>>>  2
bundle submitted, waiting 0x012ca7ac493afc4bf288bb9cde4b49d521d1c12c01d66705d8fbd3bdfb1c6112
Wait Response: BlockPassedWithoutInclusion
>>> 0x012ca7ac493afc4bf288bb9cde4b49d521d1c12c01d66705d8fbd3bdfb1c6112
{
  bundleStats: {
    isHighPriority: true,
    isSentToMiners: false,
    isSimulated: true,
    simulatedAt: '2023-02-12T08:03:16.241Z',
    submittedAt: '2023-02-12T08:03:16.233Z'
  },
  userStats: {
    all_time_gas_simulated: '',
    all_time_miner_payments: '',
    is_high_priority: false,
    last_1d_gas_simulated: '',
    last_1d_miner_payments: '',
    last_7d_gas_simulated: '',
    last_7d_miner_payments: ''
  }
}
>>>>>>  3
bundle submitted, waiting 0x012ca7ac493afc4bf288bb9cde4b49d521d1c12c01d66705d8fbd3bdfb1c6112
Wait Response: BlockPassedWithoutInclusion
>>> 0x012ca7ac493afc4bf288bb9cde4b49d521d1c12c01d66705d8fbd3bdfb1c6112
{
  bundleStats: {
    isHighPriority: true,
    isSentToMiners: false,
    isSimulated: true,
    simulatedAt: '2023-02-12T08:03:16.241Z',
    submittedAt: '2023-02-12T08:03:16.233Z'
  },
  userStats: {
    all_time_gas_simulated: '',
    all_time_miner_payments: '',
    is_high_priority: false,
    last_1d_gas_simulated: '',
    last_1d_miner_payments: '',
    last_7d_gas_simulated: '',
    last_7d_miner_payments: ''
  }
}
>>>>>>  4
bundle submitted, waiting 0x012ca7ac493afc4bf288bb9cde4b49d521d1c12c01d66705d8fbd3bdfb1c6112
Wait Response: BlockPassedWithoutInclusion
>>> 0x012ca7ac493afc4bf288bb9cde4b49d521d1c12c01d66705d8fbd3bdfb1c6112
{
  bundleStats: {
    isHighPriority: true,
    isSentToMiners: false,
    isSimulated: true,
    simulatedAt: '2023-02-12T08:03:16.241Z',
    submittedAt: '2023-02-12T08:03:16.233Z'
  },
  userStats: {
    all_time_gas_simulated: '',
    all_time_miner_payments: '',
    is_high_priority: false,
    last_1d_gas_simulated: '',
    last_1d_miner_payments: '',
    last_7d_gas_simulated: '',
    last_7d_miner_payments: ''
  }
}
>>>>>>  5
bundle submitted, waiting 0x012ca7ac493afc4bf288bb9cde4b49d521d1c12c01d66705d8fbd3bdfb1c6112
Wait Response: BlockPassedWithoutInclusion
>>> 0x012ca7ac493afc4bf288bb9cde4b49d521d1c12c01d66705d8fbd3bdfb1c6112
{
  bundleStats: {
    isHighPriority: true,
    isSentToMiners: false,
    isSimulated: true,
    simulatedAt: '2023-02-12T08:03:16.241Z',
    submittedAt: '2023-02-12T08:03:16.233Z'
  },
  userStats: {
    all_time_gas_simulated: '',
    all_time_miner_payments: '',
    is_high_priority: false,
    last_1d_gas_simulated: '',
    last_1d_miner_payments: '',
    last_7d_gas_simulated: '',
    last_7d_miner_payments: ''
  }
}
>>>>>>  6
bundle submitted, waiting 0x012ca7ac493afc4bf288bb9cde4b49d521d1c12c01d66705d8fbd3bdfb1c6112
Wait Response: BlockPassedWithoutInclusion
>>> 0x012ca7ac493afc4bf288bb9cde4b49d521d1c12c01d66705d8fbd3bdfb1c6112
{
  bundleStats: {
    isHighPriority: true,
    isSentToMiners: false,
    isSimulated: true,
    simulatedAt: '2023-02-12T08:03:16.241Z',
    submittedAt: '2023-02-12T08:03:16.233Z'
  },
  userStats: {
    all_time_gas_simulated: '',
    all_time_miner_payments: '',
    is_high_priority: false,
    last_1d_gas_simulated: '',
    last_1d_miner_payments: '',
    last_7d_gas_simulated: '',
    last_7d_miner_payments: ''
  }
}
>>>>>>  7
bundle submitted, waiting 0x012ca7ac493afc4bf288bb9cde4b49d521d1c12c01d66705d8fbd3bdfb1c6112
Wait Response: BlockPassedWithoutInclusion
>>> 0x012ca7ac493afc4bf288bb9cde4b49d521d1c12c01d66705d8fbd3bdfb1c6112
{
  bundleStats: {
    isHighPriority: true,
    isSentToMiners: false,
    isSimulated: true,
    simulatedAt: '2023-02-12T08:03:16.241Z',
    submittedAt: '2023-02-12T08:03:16.233Z'
  },
  userStats: {
    all_time_gas_simulated: '',
    all_time_miner_payments: '',
    is_high_priority: false,
    last_1d_gas_simulated: '',
    last_1d_miner_payments: '',
    last_7d_gas_simulated: '',
    last_7d_miner_payments: ''
  }
}
>>>>>>  8
bundle submitted, waiting 0x012ca7ac493afc4bf288bb9cde4b49d521d1c12c01d66705d8fbd3bdfb1c6112
Wait Response: BlockPassedWithoutInclusion
>>> 0x012ca7ac493afc4bf288bb9cde4b49d521d1c12c01d66705d8fbd3bdfb1c6112
{
  bundleStats: {
    isHighPriority: true, 
    isSentToMiners: false,
    isSimulated: true,    
    simulatedAt: '2023-02-12T08:03:16.241Z',
    submittedAt: '2023-02-12T08:03:16.233Z'
  },
  userStats: {
    all_time_gas_simulated: '',
    all_time_miner_payments: '',
    is_high_priority: false,
    last_1d_gas_simulated: '',
    last_1d_miner_payments: '',
    last_7d_gas_simulated: '',
    last_7d_miner_payments: ''
  }
}
Dominant language
No language data
Stars
2.6k
Forks
291
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from flashbots/pm

All issues in flashbots/pm

Similar issues

More Backend & API Design issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.