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

fix: update hashing function to latest spec #64

Merged
merged 1 commit into from
Sep 25, 2023
Merged

Conversation

jamesondh
Copy link
Contributor

@jamesondh jamesondh commented Sep 19, 2023

Motivation

The DR hashing function incorrectly includes payback_address and seda_payload, which are not known by external chains at time of DR creation.

Explanation of Changes

  • Removed payback_address and seda_payload from DR hashing function
  • Refactored memo hash to remove value, keeping only chain_id and nonce. This is only to reflect how memo is calculated in the EVM contracts, i.e. the CosmWasm contracts don't care about how memo is calculated.
  • Removed deprecated util functions hash_update() and pad_to_32_bytes() since the hashing function no longer requires them

Testing

Currently with the test inputs, the CosmWasm contracts and EVM contracts generate a test DR hash of 0x27e7eec2f319302826ea53ae08b4aac6c4824cc07eafcdaf740501b3d603d0aa.

Related PRs and Issues

Related to sedaprotocol/seda-evm-contracts#13
Created new issue #65 because Hash (dr_binary_id and tally_binary_id) are currently Strings instead of fixed size byte arrays. Also requires the same update on the EVM side.

@jamesondh jamesondh marked this pull request as ready for review September 19, 2023 14:41
@jamesondh jamesondh changed the title refactor: update hashing function fix: update hashing function to latest spec Sep 19, 2023
@jamesondh jamesondh requested a review from a team September 20, 2023 19:03
@jamesondh jamesondh force-pushed the refactor/split-contract branch from 2ed2451 to c7a23d4 Compare September 20, 2023 19:15
@jamesondh jamesondh changed the base branch from refactor/split-contract to main September 25, 2023 13:26
@jamesondh jamesondh merged commit 39e8bf9 into main Sep 25, 2023
@jamesondh jamesondh deleted the fix/update-hashing branch September 25, 2023 13:47
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