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

feat(CA): adding transaction simulation #859

Merged
merged 1 commit into from
Dec 12, 2024
Merged

Conversation

geekbrother
Copy link
Contributor

Description

This PR adds the transaction simulation using the Tenderly simulation provider to the chain abstraction route endpoint to check for the ERC20 asset changes in case the initial transaction is not an ERC20 transfer.

How Has This Been Tested?

Integration tests update TBD.

Due Diligence

  • Breaking change
  • Requires a documentation update
  • Requires a e2e/integration test update

/// Compute the storage slot for a given address and slot number to use in the
/// simulation state overrides
/// https://docs.tenderly.co/simulations/state-overrides#storage-slot-calculation
pub fn compute_simulation_storage_slot(address: Address, slot_number: u64) -> Bytes {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We shouldn't need to convert to/from hex in order to concatenate some bytes together

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated the implementation a bit, but we still need to contact two B256 and use this for the keccak.

Copy link
Member

@chris13524 chris13524 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this PR set the gas field somewhere?

@geekbrother geekbrother force-pushed the feat/add_tenderly_sim branch 2 times, most recently from 49870b7 to 49cdfce Compare December 11, 2024 22:57
@geekbrother geekbrother changed the title [draft] feat(CA): adding transaction simulation feat(CA): adding transaction simulation Dec 11, 2024
@geekbrother
Copy link
Contributor Author

Should this PR set the gas field somewhere?

This is a quite big PR and a lot of changes, let's merge this first and I'll add gas with the caching as a follow-up (don't want to make two monster stacked PRs 😅).

@geekbrother geekbrother merged commit 85d9ed5 into master Dec 12, 2024
19 checks passed
@geekbrother geekbrother deleted the feat/add_tenderly_sim branch December 12, 2024 11:53
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.

2 participants