flashbots/suave-geth

Precompiles `simulateBundle` & `submitBundleJsonRPC` have different inputs

halo3mic opened this issue · 0 comments

For simulateBundle you have to pass a struct as input that reflects

type SBundle struct {
 BlockNumber     *big.Int      `json:"blockNumber,omitempty"` // if BlockNumber is set it must match DecryptionCondition!
 MaxBlock        *big.Int      `json:"maxBlock,omitempty"`
 Txs             Transactions  `json:"txs"`
 RevertingHashes []common.Hash `json:"revertingHashes,omitempty"`
 RefundPercent   *int          `json:"percent,omitempty"`
}

For submitBundleJsonRPC you have to pass json encoded string:

[
    {
      txs,               // Array[String], A list of signed transactions to execute in an atomic bundle
      blockNumber,       // String, a hex encoded block number for which this bundle is valid on
      minTimestamp,      // (Optional) Number, the minimum timestamp for which this bundle is valid, in seconds since the unix epoch
      maxTimestamp,      // (Optional) Number, the maximum timestamp for which this bundle is valid, in seconds since the unix epoch
      revertingTxHashes, // (Optional) Array[String], A list of tx hashes that are allowed to revert
      replacementUuid,   // (Optional) String, UUID that can be used to cancel/replace this bundle
    }
  ]

I understand that these work differently (simulate does local simulation via buildBlock & submitBundle just does signing and remote call). Still this could be a source of confusion and would help to have similar input for both of these precompiles.