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!: add Metadata management #743

Closed
wants to merge 93 commits into from
Closed

feat!: add Metadata management #743

wants to merge 93 commits into from

Conversation

Slesarew
Copy link
Contributor

@Slesarew Slesarew commented Mar 26, 2021

This PR introduces following features:

Major features

  • Metadata is stored dynamically in secure storage database
  • Arbitrary transactions could be parsed and previewed based on stored metadata
  • Used metadata version is shown on network settings screen
  • Metadata could be changed in network settings
  • New metadata could be uploaded through animated series of fountain QR codes
  • Built-in metadata list is updated dynamically through automation
  • Metadata could be permanently deleted from the device (except built-in versions)
  • Add tests for new features
  • Rust code was moved back into this repo

Optional features:

  • Rust transaction parser
  • Pretty transaction payload rendering
  • Fix weird RN error messages on hook mixup
  • Add "wait for loading" notifications
  • Add notification upon successful metadata addition that asks to verify hash and confirms download
  • Fix CI
  • Integrate both scanners into one screen

This PR would probably address the following issues:

#407
#318 (patrially until paritytech/substrate#8615)
#408
#758
#457 (partially)
#713
#724
#736
#739
#767

Metadata version and name are parsed from metadata, thus networks that do not store it in system constants are not fully supported here - they are identified only by their hash and should be used with great care.

Metadata hashes

The metadata hashes are generated as 32 bytes blake2b with no password. They are used for 3 purposes:

  1. Metadata validation (through manual hash comparison now, some automatic tools and visualization should be developed, I'll open an issue soon)
  2. Identification of versionless metadata for storage
  3. Internal hashtables

Slesarew and others added 30 commits March 10, 2021 13:36
feat: metadata versions added to constants
removed som non-essential networks due to metadata loading issues
* feat: MWP fast Rust-processed QR scanner frontend

* build: temporarily switch dependency rust-native to side branch

* feat: implement rust code for fountain parsing. Saving point for partial dependencies upgrade attempts

* feat: add metadata through fountain QR codes! (go to network settings>"network name">ManageMetadata>Fast Qr Scanner)

* fix: lint and types

* fix: typo in constants

* fix: multiple minor bugs

* refactor: return rust native libs where they belong (#751)

* ref: return rust native libs where they belong

* docs: lost gitignore

* refactor: move reference animated qr code generator to external repository

* build: move header files in ios build part

* build: add more memory for ios node build

* build: add more memory for ios node build in a different way

* build: revert ios build changes, modify bitrise script to allocate less memory

* build: duplicate headers for ios

* fix: Transaction parser (#754)

* feat: parse generic transaction. Ugly but now works.

* test: increase e2e timeout

* fix: lint

* feat: automatically generate built-in metadata (#755)

* feat: add rust code to automatically fetch and generate built-in metadata constants

* test: add extra paths for linter to ignore

* feat: automatically update constants/networkSpecs.ts with new metadata info

* fix: add blake2 hash to metadata handles; use it as ID if no spec_name or spec_version is available

* fix: blake2 hash in networkSpecs constants

* fix: add hashes for centrifuge and edgeware

* fix: metadata autogeneration lint

* build: update failure_derive to 1.8.0

* build: convenience reminder in build script

* fix: multiple fixes to allow versionless metadata

* test: fix unit tests to recognize versioned metadata
* perf: moved metadata handle generator to rust

* refactor: lint and types

* build: try ti disable flipper

* fix: update metadata

* test: increase alert timeout

* test: typo in consts

* fix: merged last commit that was dropped from last squash for some reason
* build: bump polkadot/api version to latest

* fix: red boxes on registering networks

* build: mess with upgrades and lint

* feat: can delete unused metadata (except for built-in probably)
* upgrade polkadot and react-native

* test: disabled failing tests temporarily

* test: restore tests

* fix: lint

* test: fix ts-ignore updated rule

* fix: lint and types

* test: bump nodejs version

* test: bump wasm-crypto needed for tests

* fix: update metadata
@Slesarew Slesarew mentioned this pull request May 28, 2021
@novasamatech novasamatech deleted a comment from cla-bot-2021 bot Jun 3, 2021
@Slesarew
Copy link
Contributor Author

Redundant with #791
Forked into named legacy branch legacy-metadataRN

@Slesarew Slesarew closed this Aug 24, 2021
@Slesarew Slesarew deleted the metadata-management branch August 24, 2021 14:14
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.

4 participants