-
Notifications
You must be signed in to change notification settings - Fork 0
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
Refactor(data-requests): pad hashes #127
Conversation
@@ -59,7 +59,7 @@ pub fn calculate_dr_id_and_args( | |||
tally_binary_id: tally_binary_id.clone(), | |||
dr_inputs: dr_inputs.clone(), | |||
tally_inputs: tally_inputs.clone(), | |||
memo: memo.clone(), | |||
memo: memo.clone().try_into().unwrap(), |
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.
memo
should be Bytes
and not a Hash
.
In that way, we don't need to use that unwrap
.
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.
I just noticed we already have a Memo
type, so I used it.
5b23f72
to
f79fa57
Compare
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.
As discussed with @jamesondh , approving for later updating due to the changes to DR specs 😅
f79fa57
to
779109a
Compare
Note
All this work was done by Jameson #116, but we decided to redo it because he forked from a branch that we decided not to merge, so rebasing his PR was very hard.
Motivation
Update the data request hashing function to match the current EVM function.
Explanation of Changes
Used alloy library to pad variable length inputs in hashing function for data request hashes.
Testing
Compared data request hashes to
testHash
function in EVM contracts' latest commit, which uses identical arguments to produce an identical hash.Related PRs and Issues
Created in response to this PR for EVM: sedaprotocol/seda-evm-contracts#23
Data result ID hashes are currently not matching tthe EVM contracts, see related issue: #115