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

BM-679: Commit to requestId and requestDigest in Assessor #441

Merged

Conversation

capossele
Copy link
Contributor

@capossele capossele commented Mar 25, 2025

This PR addresses both #436 and #437 issues by committing to the positional index, the requestId and requestDigest as part of the leaf body in the assessor tree.

Closes BM-678
Closes BM-679

@github-actions github-actions bot changed the title Commit to requestId and requestDigest in Assessor BM-679: Commit to requestId and requestDigest in Assessor Mar 25, 2025
/// - The request ID.
/// - The request digest.
/// - The claim digest.
pub fn commit(
Copy link
Member

Choose a reason for hiding this comment

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

We should use a struct here and domain separation (e.g. EIP-712) instead of just concatting these bytes.

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 with 3a2da80.
However, the gas cost of using that is not negligible

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Gas released issue fixed in cdaceae

requestDigests[i] = fills[i].requestDigest;
}
bytes32 root = MerkleProofish.processTree(claimDigests);
bytes32 root = MerkleProofish.processTree(leaves);

bytes memory journal = abi.encode(
AssessorJournal({
Copy link
Member

Choose a reason for hiding this comment

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

We should also drop the requestDigests field from AssessorJournal since is is now redundant.

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 with 3a2da80

Copy link
Member

@nategraf nategraf left a comment

Choose a reason for hiding this comment

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

Hashing looks good to me now. Thanks for taking care of this!

@capossele capossele enabled auto-merge (squash) March 26, 2025 13:46
@capossele capossele merged commit f2d7a6c into main Mar 26, 2025
17 checks passed
@capossele capossele deleted the angelo/bm-679-prevent-re-ordering-of-fulfillments-in-batches branch March 26, 2025 14:09
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.

3 participants