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

Ignore receipts from failed transactions in message_receipts_proof #2478

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

AurelienFT
Copy link
Contributor

Resolves #2421

In this PR we changed the message_receipts_proof to ignore the receipts from the failed transactions.

Checklist

  • Breaking changes are clearly marked as such in the PR description and changelog
  • New behavior is reflected in tests
  • The specification matches the implemented behavior (link update PR if changes are needed)

Before requesting review

  • I have reviewed the code myself
  • I have created follow-up issues caused by this PR and linked them here

@AurelienFT AurelienFT requested a review from a team December 6, 2024 14:04
@AurelienFT AurelienFT marked this pull request as draft December 6, 2024 14:21
@AurelienFT AurelienFT marked this pull request as ready for review December 6, 2024 14:26
@@ -278,7 +278,11 @@ fn message_receipts_proof<T: MessageProofData + ?Sized>(
// Get the message receipts from the block.
let leaves: Vec<Vec<Receipt>> = message_block_txs
.iter()
.map(|id| database.receipts(id))
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe we also need to update another place with database.receipts function call. And remove receipts function at all=)

image

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

crates/fuel-core/src/query/message.rs Show resolved Hide resolved
database.insert_receipts(valid_tx_id, valid_tx_receipts.clone());

// Get the message proof with the valid transaction
let message_proof_valid_tx = message_receipts_proof(
Copy link
Collaborator

Choose a reason for hiding this comment

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

It would be nice if we tested public function message_proof instead of the private

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@AurelienFT AurelienFT requested review from xgreenx and a team December 9, 2024 10:11
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.

message_receipts_proof creates invalid proof if transaction with MessageOut receipt failed
2 participants