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

[1.0.3] Trace_API: Fix get_transaction_trace endpoint fails to return transaction trace if the initial block including the transaction forks out #966

Open
wants to merge 9 commits into
base: release/1.0
Choose a base branch
from

Conversation

linh2931
Copy link
Member

@linh2931 linh2931 commented Oct 22, 2024

Trace_API's get_transaction_trace is supposed to return the transaction trace of a transaction. But the current implementation only finds any block whose block number matches the first block proposing the transaction; this block might not contains the transaction due to forking.

This PR

  • adds a test reproducing the problem and a test for normal case.
  • fixes the problem by not updating trx_block_num in get_trx_block_number if the block does not include the transaction.

Resolves #942

@linh2931 linh2931 added the bug The product is not working as was intended. label Oct 22, 2024
}

return has_trx;
}
Copy link
Member

Choose a reason for hiding this comment

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

I can't really tell for sure, but would a visit() + overloaded lambda be more concise or cleaner?

Copy link
Member Author

Choose a reason for hiding this comment

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

The function is no longer needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug The product is not working as was intended.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants