-
Notifications
You must be signed in to change notification settings - Fork 21
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
BM-679: Commit to requestId and requestDigest in Assessor #441
Conversation
This reverts commit 99c41bd.
crates/assessor/src/lib.rs
Outdated
/// - The request ID. | ||
/// - The request digest. | ||
/// - The claim digest. | ||
pub fn commit( |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
contracts/test/TestUtils.sol
Outdated
requestDigests[i] = fills[i].requestDigest; | ||
} | ||
bytes32 root = MerkleProofish.processTree(claimDigests); | ||
bytes32 root = MerkleProofish.processTree(leaves); | ||
|
||
bytes memory journal = abi.encode( | ||
AssessorJournal({ |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done with 3a2da80
There was a problem hiding this 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!
This PR addresses both #436 and #437 issues by committing to the positional index, the
requestId
andrequestDigest
as part of the leaf body in the assessor tree.Closes BM-678
Closes BM-679