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

tracing: use correct exchange rates #352

Merged
merged 2 commits into from
Apr 1, 2025

Conversation

gastonponti
Copy link

@gastonponti gastonponti commented Mar 31, 2025

The tracer for a transaction in the index N was using the state produced by the index N-1 to calculate the fee currency rates.
As part of our block context, we calculate the fee currency rates only at the beginning of the block.

With the bugged code, if some tx between the index 0 and N-1 changes the rates of the currency that the N-tx is pretending to use, the N-tx is going to generate a wrong output.

@gastonponti gastonponti changed the base branch from optimism to celo-rebase-12 March 31, 2025 18:19
Copy link

@seolaoh seolaoh left a comment

Choose a reason for hiding this comment

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

LGTM! I updated our internal debug node with 7a83f2f and confirmed that no more CreditFees() error occurs during tracing. Now the call trace for the 2 txs are consistently showing invalid signature error which is an issue from their side. (regarding https://github.com/celo-org/celo-blockchain-planning/issues/955)

@palango palango changed the title Fix tracer block context rates used tracing: use correct exchange rates Apr 1, 2025
@palango palango merged commit ddf58ec into celo-rebase-12 Apr 1, 2025
7 checks passed
@palango palango deleted the gastonponti/fix-debug-tx-rates branch April 1, 2025 10:31
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.

tracing: Errors with "Cannot credit more than debited"
3 participants