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

major: Ios native port #791

Merged
merged 209 commits into from
Sep 22, 2021
Merged

major: Ios native port #791

merged 209 commits into from
Sep 22, 2021

Conversation

Slesarew
Copy link
Contributor

@Slesarew Slesarew commented Aug 4, 2021

This is a major re-write of the app.

Pure Rust backend

  • All logic was moved to Rust native code; this includes key storage, transaction parsing, signing, history, etc.
  • sled is used as database engine
  • metadata and networc specifications could be imported with fountain QR videos
  • support message signing and legacy multiframe transactions
  • cryptography imported directly from Substrate code

iOS frontend

  • iOS frontend written with modern SwiftUI framework
  • QR scanner is multithreaded and thus works at rates of at least 30fps
  • Seed phrases are stored with SecureEnclave
  • General UI/UX changes to improve usability and simplify things

Ethereum

is not supported anymore; to return support - either fork old RN branch or implement everything in pure Rust

Legacy code

Almost nothing remains from version 4.5*

Most of Rust code is inherited from https://github.com/paritytech/parity-signer/tree/payload-parser-rust

This PR would address the following issues:

#407
#318
#408
#758
#457
#713
#724
#736
#739
#767

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 requested review from vas3k, s3krit and kirushik August 27, 2021 17:50
@kirushik
Copy link

I'm OK with the general direciton of this — but am not currenlty available for a thorough code review of a +33,174 −32,944 pull request in a language I'm not too fluent with.
This only leaves me with an opportunity to do a sprt of QA/acceptance testing of the app itself — and this PR has no info on how I can get a pre-release version built from this branch for testing.

@Slesarew
Copy link
Contributor Author

how I can get a pre-release version built from this branch for testing.

That's what I meant really, I don't thing plowing through all this code is feasible now.

To build, first run
./scripts/build.sh ios
Then just build the workspace from ios directory in Xcode. It's already in the readme, but I'll need to improve that documentation further once this goes into more stable state.

@s3krit
Copy link
Contributor

s3krit commented Sep 3, 2021

As an update to this; there is now a build available in TestFlight. Given an Apple ID, I can add whomever for QA/testing.

@TriplEight
Copy link
Contributor

Please don't do such huge PRs, it's unreal to review it.
Now, unfortunately, I do not have the iOS device for testing, but think it's worth getting one.

Copy link
Contributor

@vas3k vas3k left a comment

Choose a reason for hiding this comment

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

Same as for #793: tested the last build from TestFlight: seed creation, metadata update, exporting, transaction parsing, transaction signing, extension integration

UI looks way better than in Android version but still need improvements

@Slesarew Slesarew merged commit b9fa369 into master Sep 22, 2021
@Slesarew Slesarew deleted the ios-native-port branch September 22, 2021 11:11
@blockchainunchained
Copy link

blockchainunchained commented Sep 22, 2021

You awesome beast @Slesarew can I please buy you a beer?

@nuke-web3
Copy link
Contributor

Congratulations on this @Slesarew 🍻

@kianenigma
Copy link

Congratulations! 🥂

@mcdonagg
Copy link

This is awesome, thank you for your hard work on this, how do I get my hands on it?

@Slesarew
Copy link
Contributor Author

This is awesome, thank you for your hard work on this, how do I get my hands on it?

There won't be ant app store releases until we are done with testing (and hopefully audits!), but it is really trivial to build (at your own risk, as usual, the frontend does not even have any tests as it is not in final state), you need rust and xcode or android studio depending on target. So, first it is ./scripts/build.sh iosor ./scripts/build.sh android and then open corresponding IDE and build. Android studio might need to be properly upgraded though and you'll need NDK obviously. And there is effectively no light color mode in android at the moment, as the Signer was always black, I've started with it - so switch to dark mode in the phone first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment