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

feat(router-minor): support Message Id format for Aleo #689

Merged
merged 2 commits into from
Nov 29, 2024

Conversation

anstylian
Copy link
Contributor

Description

Support MessageIdFormat for Aleo

@anstylian anstylian requested a review from a team as a code owner November 12, 2024 20:45
Copy link
Contributor

@cjcobb23 cjcobb23 left a comment

Choose a reason for hiding this comment

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

this should be implemented like the other message ids, particularly with a regex. This is not very safe to use the aleo_types crate to do the parsing. For instance, what if that crate allows different representations of the same transaction id? like upper vs lowercase, 0x vs not, etc. What if it does not allow that today, but does in the future? This part of the code is very sensitive and needs to be extremely secure.

@anstylian
Copy link
Contributor Author

@cjcobb23 thanks for the review.
A regex to verify message ids has been added.

Please let me know if further changes are needed.

packages/aleo-types/src/address.rs Outdated Show resolved Hide resolved
packages/aleo-types/src/lib.rs Outdated Show resolved Hide resolved
contracts/voting-verifier/src/contract.rs Outdated Show resolved Hide resolved
packages/axelar-wasm-std/src/msg_id/mod.rs Outdated Show resolved Hide resolved
packages/aleo-types/src/address.rs Outdated Show resolved Hide resolved
packages/aleo-types/src/program.rs Outdated Show resolved Hide resolved
packages/aleo-types/src/transaction.rs Outdated Show resolved Hide resolved
@anstylian anstylian marked this pull request as draft November 18, 2024 22:11
@anstylian anstylian marked this pull request as ready for review November 18, 2024 22:55
@anstylian anstylian marked this pull request as draft November 19, 2024 08:41
@anstylian anstylian marked this pull request as ready for review November 19, 2024 13:04
@anstylian
Copy link
Contributor Author

anstylian commented Nov 19, 2024

@cjcobb23 @cgorenflo

About the verification of Aleo Address, Transaction, and Transition.
This verifies that the bytes follow the Bech32m.
They may follow the Bech32m format but are still invalid as Aleo Addresses, Transaction Id, or TransitionId.
We need to add some cryptographic staff to verify that are truly valid.

Do you need this part of the work at this stage?

@anstylian anstylian marked this pull request as draft November 20, 2024 07:21
@anstylian anstylian force-pushed the aleo-MessageIdFormat branch 6 times, most recently from e0f1370 to f164ff1 Compare November 20, 2024 13:28
@anstylian anstylian marked this pull request as ready for review November 20, 2024 18:18
packages/axelar-wasm-std/src/msg_id/mod.rs Outdated Show resolved Hide resolved
packages/axelar-wasm-std/src/msg_id/bech32m.rs Outdated Show resolved Hide resolved
packages/axelar-wasm-std/src/msg_id/bech32m.rs Outdated Show resolved Hide resolved
packages/axelar-wasm-std/src/msg_id/bech32m.rs Outdated Show resolved Hide resolved
@anstylian anstylian marked this pull request as draft November 25, 2024 13:37
@anstylian anstylian force-pushed the aleo-MessageIdFormat branch 2 times, most recently from 78429ee to d9ed2a4 Compare November 25, 2024 15:41
@anstylian anstylian marked this pull request as ready for review November 25, 2024 15:53
@anstylian anstylian force-pushed the aleo-MessageIdFormat branch 2 times, most recently from a802126 to 2851d1c Compare November 26, 2024 20:15
packages/axelar-wasm-std/src/msg_id/bech32m.rs Outdated Show resolved Hide resolved
packages/axelar-wasm-std/src/msg_id/mod.rs Outdated Show resolved Hide resolved
packages/axelar-wasm-std/src/msg_id/mod.rs Outdated Show resolved Hide resolved
@anstylian anstylian force-pushed the aleo-MessageIdFormat branch 2 times, most recently from 2db90cd to 090fdb5 Compare November 26, 2024 20:30
@anstylian anstylian marked this pull request as draft November 28, 2024 13:45
When trying to deploy the contract, it gives this error when the type of length is usize:

Error: rpc error: code = Unknown desc = rpc error: code = Unknown desc = failed to execute message; message index: 0: Error calling the VM: Error compiling Wasm: Could not compile: WebAssembly translation error: Error in middleware Gatekeeper: Float operator detected: F64Load { memarg: MemoryImmediate { align: 3, offset: 8, memory: 0 } }. The use of floats is not supported.: create wasm contract failed [CosmWasm/[email protected]/x/wasm/keeper/keeper.go:160] With gas wanted: '0' and gas used: '9525292' : unknown request
@anstylian anstylian marked this pull request as ready for review November 28, 2024 16:48
@cgorenflo cgorenflo changed the title support Message Id format for Aleo. feat(router-minor): support Message Id format for Aleo Nov 29, 2024
@cgorenflo cgorenflo merged commit 5c276fa into axelarnetwork:main Nov 29, 2024
5 of 6 checks passed
@anstylian anstylian deleted the aleo-MessageIdFormat branch November 29, 2024 18:44
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