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

Precompiles simulateBundle & submitBundleJsonRPC have different inputs #191

Open
halo3mic opened this issue Feb 9, 2024 · 0 comments
Open

Comments

@halo3mic
Copy link
Contributor

halo3mic commented Feb 9, 2024

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.

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

No branches or pull requests

1 participant