0LNetworkCommunity / libra-legacy-v6

Apache License 2.0
248 stars 116 forks source link

v6: Merkle tree hashing #1223

Open corynthian opened 1 year ago

corynthian commented 1 year ago

Motivation

Implements Keccak (sha3-256) based Merkle Tree hashing.

Note: Also includes fixes to VoteTests.

Test Plan

cargo test --test move_unit_test

Related PRs

627

hemulin commented 1 year ago

@ashiiix note that this is addressing a ticket you were involved in before

corynthian commented 1 year ago

One issue with this PR is that it uses sha3-256 from tiny-keccak rather than the Ethereum Keccak256. So its not usable for an ETH bridge.

0o-de-lally commented 1 year ago

This is stellar Move code! Hat's off!

We have a user here @coin1111 that has implemented a early version of an eth bridge. For that he created a "native function" with keccak. Although, oddly I don't see it in V6, so I think it was ignored with the migration.

Anyhow. Perhaps you want to pull in the XHASH module from V5, see below. And secondly, you might want to review the bridge code. Although, where we are today, it seems more likely that axelar would be the first bridge on 0L.

https://github.com/0LNetworkCommunity/libra/blob/main/language/diem-framework/modules/0L/xhash.move