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

Log simulation errors #26

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

yawhide
Copy link

@yawhide yawhide commented Jan 10, 2024

Partially fixes #24

Log simulation errors

Took code from flashbot's example https://github.com/flashbots/ethers-provider-flashbots-bundle/blob/master/src/demo.ts#L99

@yawhide
Copy link
Author

yawhide commented Jan 10, 2024

@xrchz do you have an easy way to test this without rocketpool node deposit?

@xrchz
Copy link
Owner

xrchz commented Jan 10, 2024

Thanks for this! I have a pending deposit I can test with, but need to wait for the deposit pool to not be overfull, since otherwise it errors out before getting to the simulation.

@xrchz
Copy link
Owner

xrchz commented Jan 12, 2024

I tried it and got this

Simulation results: {
  "bundleGasPrice": {
    "type": "BigNumber",
    "hex": "0x05f5e100"
  },
  "bundleHash": "0x76214368419040f1f463fa2c3c2e357abd60d6247ed30263990cab3caf0f7d1f",
  "coinbaseDiff": {
    "type": "BigNumber",
    "hex": "0x7ea3cdf2a400"
  },
  "ethSentToCoinbase": {
    "type": "BigNumber",
    "hex": "0x00"
  },
  "gasFees": {
    "type": "BigNumber",
    "hex": "0x7ea3cdf2a400"
  },
  "results": [
    {
      "txHash": "0x70cfbdca2b8513086caa5ec9f22fd8130eb28824fd9a8731c926a1de02f5a30b",
      "gasUsed": 1235773,
      "gasPrice": "100000000",
      "gasFees": "123577300000000",
      "fromAddress": "0xa4186193281f7727C070766ba60B63Df74eA4Da1",
      "toAddress": "0x2FB42FfE2d7dF8381853e96304300c6a5E846905",
      "coinbaseDiff": "123577300000000",
      "ethSentToCoinbase": "0",
      "value": "0x"
    },
    {
      "txHash": "0x428683ddcdf4b7e2f4468b1c7c223d66cb141fc9fb4072250be0352c353f7c70",
      "gasUsed": 156647,
      "gasPrice": "100000000",
      "gasFees": "15664700000000",
      "fromAddress": "0xa4186193281f7727C070766ba60B63Df74eA4Da1",
      "toAddress": "0x6fCfE8c6e35fab88e0BecB3427e54c8c9847cdc2",
      "coinbaseDiff": "15664700000000",
      "ethSentToCoinbase": "0",
      "error": "execution reverted",
      "value": null
    }
  ],
  "stateBlockNumber": 18989909,
  "totalGasUsed": 1392420,
  "firstRevert": {
    "txHash": "0x428683ddcdf4b7e2f4468b1c7c223d66cb141fc9fb4072250be0352c353f7c70",
    "gasUsed": 156647,
    "gasPrice": "100000000",
    "gasFees": "15664700000000",
    "fromAddress": "0xa4186193281f7727C070766ba60B63Df74eA4Da1",
    "toAddress": "0x6fCfE8c6e35fab88e0BecB3427e54c8c9847cdc2",
    "coinbaseDiff": "15664700000000",
    "ethSentToCoinbase": "0",
    "error": "execution reverted",
    "value": null
  }
}

So looks like it's not detecting the error.

@xrchz
Copy link
Owner

xrchz commented Jan 12, 2024

Might have to look for firstRevert instead of error (or in addition to error actually probably)

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

Successfully merging this pull request may close these issues.

Improve the logs
2 participants