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

Index account balances #284

Closed
sideninja opened this issue Jun 7, 2024 · 1 comment
Closed

Index account balances #284

sideninja opened this issue Jun 7, 2024 · 1 comment
Assignees

Comments

@sideninja
Copy link
Contributor

Currently, we use Cadence script execution to obtain an EVM account balance through the EVM address.balance() method. This works fine for the latest block, the problem is, that the EVM GW get balance API allows for specifying past EVM block heights at which we want to obtain an account balance.
We solved this problem by executing the balance Cadence script at the previous Cadence block, but the problem is, that one Cadence block can contain multiple EVM blocks, and if the EVM height at which we want to obtain the balance is inside such a Cadence block with multiple heights, we will always get the state at the end of the Cadence block, resulting in wrong value.

How we can address this issue is in different ways, short-term solution is to use the transaction traces to index balance changes, longer-term solution is to use either local execution or a modified archive node that allows for EVM height-resolution script execution. This means allows for executing a script at intermediate EVM heights not just Cadence height.

@sideninja
Copy link
Contributor Author

Related to: #322

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

No branches or pull requests

1 participant