You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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.
The text was updated successfully, but these errors were encountered: