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

Miguel/ava 363 proposals on nomad bridge security #4

Open
wants to merge 27 commits into
base: luke/nomad-dev-pallets
Choose a base branch
from

Conversation

MiguelDD1
Copy link

@MiguelDD1 MiguelDD1 commented Sep 22, 2022

Security

  • do_dispatch has been re-written to avoid modification on storage and failure, as it is not transactional.
  • do_update needs to be transactional to avoid inconsistency between storages if the internal loop fails.
  • update uses a max_index_witness to calculate the proper weight.

Benchmarks

  • Worst case on nomad-home::update is when Tree has TREE_DEPTH (=32) as depth. We use init_tree fn to generate that case on the update benchmark.
  • As Updater contains NON compatible WASM code, we use pre-images on benchmarks: fn expected_signed_update() and fn expected_longest_tree_signed_update(). There are UTs to ensure their values are correct.

Other changes

  • [Reduce fees] da-bridge::try_dispatch_data_root uses the block number & the data root instead the whole header.
  • Home crate has been renamed to Nomad-Home.

@luketchang luketchang force-pushed the luke/nomad-dev-pallets branch 2 times, most recently from 5a39730 to f37e290 Compare September 22, 2022 18:38
@MiguelDD1 MiguelDD1 marked this pull request as ready for review September 28, 2022 10:36
pallets/nomad/da-bridge/src/lib.rs Outdated Show resolved Hide resolved
pallets/nomad/home/src/lib.rs Outdated Show resolved Hide resolved
pallets/nomad/home/src/lib.rs Show resolved Hide resolved
pallets/nomad/da-bridge/src/lib.rs Outdated Show resolved Hide resolved
pallets/nomad/home/src/benchmarking.rs Outdated Show resolved Hide resolved
  - New Benchmarks for `nomad/da-bridge`
  - Add header hash to `try_dispatch_data_root`.
  - Add assertions to `verify` section in benchmarks.
@luketchang
Copy link
Collaborator

Also if you could update the subxt scripts to use the new metadata, that'd be great. Each time signature of method changes, we need to update this

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