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

Integrate ain-grpc and metachain #1598

Closed
wants to merge 15 commits into from
Closed

Integrate ain-grpc and metachain #1598

wants to merge 15 commits into from

Conversation

wafflespeanut
Copy link
Contributor

@defichain-bot
Copy link
Member

@wafflespeanut: There are no 'kind' label on this PR. You need a 'kind' label to generate the release automatically.

  • /kind feature
  • /kind fix
  • /kind chore
  • /kind docs
  • /kind refactor
  • /kind dependencies
Details

I am a bot created to help the DeFiCh developers manage community feedback and contributions. You can check out my manifest file to understand my behavior and what I can do. If you want to use this for your project, you can check out the DeFiCh/oss-governance-bot repository.

@Bushstar
Copy link
Member

Bushstar commented Nov 29, 2022

On Ubuntu 22.04 when running make in the depends folder I get the following error...

error: failed to run custom build command for `librocksdb-sys v0.6.1+6.28.2`

Caused by:
  process didn't exit successfully: `/mnt/dev/github/ain-rust/depends/work/build/x86_64-pc-linux-gnu/libmc/master-d13f67aaa7f/target/release/build/librocksdb-sys-94bcc4f8f7e621a0/build-script-build` (exit status: 101)
  --- stderr
  thread 'main' panicked at 'Unable to find libclang: "couldn't find any valid shared libraries matching: ['libclang.so', 'libclang-*.so', 'libclang.so.*', 'libclang-*.so.*'], set the `LIBCLANG_PATH` environment variable to a path where one of these files can be found (invalid: [])"', /home/user/.cargo/registry/src/github.com-1ecc6299db9ec823/bindgen-0.59.2/src/lib.rs:2144:31

Needs clang to be installed.

* Import libain work

* Prioritize aarch64 for M1 Mac

* CI build changes

* Add customtx and visitor impl

* Invoke metachain in defid

* Cross-compilation fixes for OSX and Windows

* Local path for depends builds

* DMC handler for FFI and RPC

* Test framework update

* Fix MC startup and lambda return

* Support moving funds back and forth
@wafflespeanut
Copy link
Contributor Author

wafflespeanut commented Nov 30, 2022

Things that require attention and must be addressed as part of this PR:

  1. Both Intel and M-series macOS matches x86_64-apple-darwin18, but we're picking M-series (which has target aarch64-apple-darwin), we have to somehow differentiate so that we can support all Mac editions.
  2. Git clone command in libmc.mk should point to master branch after FFI support for ain integration metachain#167 gets merged.
  3. Update build documentation in ain repo to include Rust toolchain and protobuf compiler.
  4. With this PR, we'll exclusively depend on make.sh script as we move things around from depends directory.
  5. Introduces lockAddress for holding on to funds that are moved to metachain. Mainnet, testnet and devnet addresses need to be set in chain params.
  6. ConnectDmcBlock and AddNativeTx functions rely on WIP work from metachain. Once the functionality has been implemented, glueing code can be added fairly easily.
  7. dmc_payload field has been added to CBlock - it impacts consensus because that field is being written to disk but not being shared across network (there's a commented out assertion in python test).
  8. Failures need to be audited - runtime errors are being thrown in miner.cpp. Also need to address whether it'll affect something if DMC's ConnectBlock succeeds but defichain's ConnectBlock fails.
  9. Add test for getting funds back from metachain once AddNativeTx has been implemented.
  10. Metachain RPC test has to be added once we add jsonrpcserver dependency to the test framework (I've written more about this in the metachain test).

Building: (could add this to docs as well?)

Typically, we only have to run ./make.sh build from ain root. The first time we do it, depends will pull metachain and libain-rs, build them and cache the builds inside depends directory. This is fine if we don't wanna make changes to either of those repositories, but if you're making changes to metachain or libain-rs and need to quickly test them with defichain, then instead of pushing to a git branch and let depends pull it back, the easiest way would be to use env variables.

Assuming metachain and libain-rs directories are siblings to your local ain repo, the following command can be used for building from local changes:

rm -rf depends/built/x86_64-pc-linux-gnu/libmc/ depends/built/x86_64-pc-linux-gnu/libain/; LIBAIN_PATH=$(pwd)/../libain-rs LIBMC_PATH=$(pwd)/../metachain ./make.sh build

x86_64-pc-linux-gnu varies depending on your target arch

Jouzo
Jouzo previously approved these changes Feb 9, 2023
@prasannavl
Copy link
Member

prasannavl commented Jun 14, 2023

Superseded by #2037 and #1815

@prasannavl prasannavl closed this Jun 14, 2023
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.

None yet

7 participants