anoma/anoma

Anoma is a sovereign, proof-of-stake blockchain protocol that enables private, asset-agnostic cash and private bartering...

Anoma is a sovereign, proof-of-stake blockchain protocol that enables private, asset-agnostic cash and private bartering among any number of parties

Anoma

Namada

This repo contains an early prototype of Anoma. A lot of current development is happening on Namada. Please go there to check out the latest status.

Overview

Anoma is an intent-centric, privacy-preserving protocol for decentralized counterparty discovery, solving, and multi-chain atomic settlement. To learn more about Anoma's vision, take a look at the Anoma Vision Paper.

This is an implementation of the Anoma protocol in Rust.

Warning

Here lay dragons: this codebase is still experimental, try at your own risk!

💾 Installing

There is a single command to build and install Anoma executables from source (the node, the client and the wallet). This command will also verify that a compatible version of Tendermint is available and if not, attempt to install it. Note that currently at least 16GB RAM is needed to build from source.

After installation, the main anoma executable will be available on path.

To find how to use it, check out the User Guide section of the docs.

If you have Nix, you may opt to build and install Anoma using Nix. The Nix integration also takes care of making a compatible version of Tendermint available.

For more detailed instructions and more install options, see the Install section of the User Guide.

⚙️ Development

Using Nix

You may opt to get all of the dependencies to develop Anoma by entering the development shell:

Inside the shell, all of the make targets work as usual:


It is also possible to use the Nix Rust infrastructure instead of Cargo to build the project crates. This method uses crate2nix to derive Nix expressions from Cargo.toml and Cargo.lock files. The workspace members are exposed as packages in flake.nix with a rust_ prefix. Variants where the ABCI-plus-plus feature flag is enabled are exposed with a :ABCI-plus-plus suffix.

Advantages:

  • Excellent build reproducibility (all dependencies pinned).
  • Individual crates are stored as Nix derivations and therefore cached in the Nix store.
  • Makes it possible to build Nix derivations of the binaries. Cargo build doesn't work in the Nix build environment because network access is not allowed, meaning that Cargo can't fetch dependencies; cargo vendor could be used to prefetch everything for Cargo, but cargo vendor does not work on our project at the moment.

Disadvantages:

  • Only works for Linux and Darwin targets. WASM builds in particular are not possible with this method. Although, while crate2nix doesn't support targeting WASM, we should be able to build the WASM modules via Cargo - if only cargo vendor worked.

Note: If you have modified the Cargo dependencies (changed Cargo.lock), it is necessary to recreate the Cargo.nix expressions with crate2nix. Helpers are provided as flake apps (Nix 2.4 and later):

Before submitting a PR, pls make sure to run the following

🧾 Logging

To change the log level, set ANOMA_LOG environment variable to one of:

  • error
  • warn
  • info
  • debug
  • trace

The default is set to info for all the modules, expect for Tendermint ABCI, which has a lot of debug logging.

For more fine-grained logging levels settings, please refer to the tracing subscriber docs for more information.

To switch on logging in tests that use #[test] macro from test_log::test, use RUST_LOG with e.g. RUST_LOG=info cargo test -- --nocapture.

How to contribute

Please see the contributing page.

Dependencies

The ledger currently requires that Tendermint version 0.34.x is installed and available on path. The pre-built binaries and the source for 0.34.8 are here, also directly available in some package managers.

This can be installed by make install command (which runs scripts/install/get_tendermint.sh script).

Issues

Collection of the latest Issues

tzemanovic

tzemanovic

testing
Comment Icon0

we can re-use some parts of state machine from #927, but instead of the manual storage manipulations, we can apply PoS transactions to also test them on a randomized state.

Note that transactions themselves have tests added in #1090, but there they only run over the initial state that's setup for the tests.

james-chf

james-chf

prio:low
Comment Icon0

Currently in the anoma CLIs we sometimes handle errors by calling eprintln! with a human-friendly error message, then exiting the process with status code 1, other times we just attempt an .unwrap() which panics and displays an output more helpful to developers.

We could consolidate how we're handling errors:

  • start returning Result<()> instead of safe exiting inside our functions; e.g. use .await? rather than await.unwrap() to return errors when they happen rather than panicking
  • change existing eprintln! calls to returning a Result<()>
  • at the top level, catch returned Err(error)s and always both eprintln! the Display trait output for users and log (i.e. tracing::error!) the Debug output for developers, as currently we may only get one or the other

This could be done nearer Namada release as part of polishing up if there is time

batconjurer

batconjurer

enhancement
Comment Icon0

We would like a separate RPC for issuing commands to one's own running node from the Anoma client. This should be a secure endpoint intended for issuing commands to a single node and that are not to be gossiped around and seen by other nodes.

This is needed e.g. for telling a validator that you want it to update its DKG session keypair.

tzemanovic

tzemanovic

matchmaker
Comment Icon0

Follow-up to #763

Add re-try (probably with exponential backoff) logic to matchmaker connection to intent gossiper node's RPC:

  • on matchmaker start-up, if the connection has not been established
  • on matchmaker disconnect

┆Issue is synchronized with this Asana task by Unito

tzemanovic

tzemanovic

matchmaker
Comment Icon0

Currently, the matchmaker config only allows a single matchmaker. We should allow to configure any number of matchmakers, perhaps under a user selected alias that can be used to run the pre-configured matchmaker

┆Issue is synchronized with this Asana task by Unito

Versions

Find the latest versions by id

v0.6.1 - Jun 30, 2022

Anoma 0.6.1 is a patch release updating the Rust toolchain and various libraries.

BUG FIXES

  • Fixed PoS votes_per_token parameter update validation (#1181)

IMPROVEMENTS

  • Ledger: Updated the version of Tendermint used for ABCI++ (#1088)
    • Add full support for ProcessProposal and FinalizeBlock
    • Updated the shims
    • Updated tendermint-rs, ibc-rs, and tower-abci deps
    • Updated the proto definitions
    • Added Tendermint's new method of a BFT timestamping
    • Updated the format of Tendermint's new config
    • Fixed booting up the tendermint node in the ledger with correct settings
    • Refactored storage to account for the fact that tendermint no longer passes in block headers
  • Client: Configured Tendermints new event log and JSON RPC API for events querying (#1088)
    • Added necessary config parameters to our tendermint node's configuration
    • Wrote a jsonrpc client for querying tendermint's event logs
    • Refactored how txs are submitted in the client when the ABCI-plus-plus feature is set to use jsonrpc calls instead of websockets.

MISCELLANEOUS

  • Updated RocksDB dependency version to v0.18.0 (#1135)

v0.6.0 - Jun 10, 2022

v0.6.0

Anoma 0.6.0 is a scheduled minor release.

BUG FIXES

  • Ledger: Set the counterparty connection ID when the connection ack (#968)
  • Ledger: Set the counterparty channel ID when the ack (#980)
  • Ledger: Encode a commitment with Protobuf (#988)
  • Client: Fix Tendermint node ID derivation from ed25519 keys in "utils init- network" command (#992)
  • Ledger: Reuse IBC port (#1011)
  • Ledger: Fix to write the initial value of IBC sequence (#1014)
  • Fixes installation of Tendermint on M1 Macs (#1018)
  • Ledger: Fix IBC VP for packet timeout (#1029)
  • Ledger: Fix vp read_pre to read from write_log for the previous txs updates (#1032)
  • Ledger: Fix IBC token VP (#1040)
  • Fix loading of validator VP during chain initialization (#1054)
  • Fix possible overflow when formatting token amount to a string. (#1087)

DOCS

  • Add docs for internal testnet for MASP (#1013)
  • Applied various fixes to MASP internal testnet guide (#1017)
  • Added docs page for testnet launch procedure. (#1028)
  • Add links to doc pages sources on Github. (#1030)
  • User guide and testnets documentation has been separated and moved to https://github.com/anoma/docs (#1080)
  • Updated whitepaper and vision paper links (#1116)
  • Install mdbook-admonish plugin (#1132)
  • Include Rust nightly version from root file (#1133)

FEATURES

  • Client: Add raw bytes query command "query-bytes" from the storage. (#836)
  • Added on-chain and off-chain governance validity predicate with client support for submitting proposal transaction, proposal queries and for creating off- chain proposals. (#954)
  • Ledger: Change the storage hasher to SHA256 (#968)
  • Governance: Added proposal vote transaction and validity predicate support. Also improved the proposal query command. (#975)
  • Ledger: Query with the specified height (#987)
  • Add stub EthBridge internal address (#1066)

IMPROVEMENTS

  • Ledger: The validity predicate checks rule has been simplified so that every validity predicate triggered by a transaction receives all the storage keys touched by the transaction. (#955)
  • Ledger: write/get block header to get an old consensus state (#974)
  • Ledger: Use non-validator full node Tendermint mode by default. (#978)
  • Client: Updated the utils commands init-genesis-validator and join- network to be able to automatically configure a genesis validator node. (#997)
  • Show an error when calling anomac utils join-network if trying to download a file and it is missing (#1044)
  • Wallet: various store and API changes and additions for genesis setup. (#1063)

MISCELLANEOUS

  • Fixed Nix build and updated Nix dependencies. (#994)
  • Update make install command to respect the Cargo.lock file (#1118)

TESTING

  • Replaced E2E tests command runner library with expectrl (#686)
  • Added state-machine property-based tests for PoS validity predicate. (#927)
  • WASM host environment testing helpers are now pinned to a stable memory location to avoid issues in state machine test runner. (#947)
  • More logging in end-to-end tests (#1071)

v0.5.0 - Mar 15, 2022

Anoma 0.5.0 is a regularly scheduled minor release.

BUG FIXES

  • WASM: Fix WASM cache exponential backoff (#834)
  • Ledger: Temporarily downgrade back to wasmer v1.0.2 until the leak that is affecting Linux is found and fixed. (#870)
  • Ledger: Upgrade to wasmer v2.2.0 and fix memory leak caused by a circular reference in the WASM memory (#871)
  • Change the validity predicate main entry-point function to receive changed_keys and verifiers arguments in a deterministic order. (#891)
  • Dependency: Backport libp2p-noise patch that fixes a compilation issue from https://github.com/libp2p/rust-libp2p/pull/2264 (#908)
  • Wasm: Re-add accidentaly removed tx_ibc WASM and vm_env::ibc module (#916)
  • Ledger & Matchmaker: In "dev" chain with "dev" build, load WASM directly from the root wasm directory. (#933)
  • Ledger: Decode signed data in IBC VPs (#938)
  • Ledger: Fixed handling of the Tendermint mode global argument. (#943)
  • Ledger: Set IBC event besides tx_result (#944)
  • Ledger: Fix IBC ClientReader functions (#949)
  • Ledger: Set 0 as IBC height revision number (#950)
  • Ledger: Fix the path via ABCI query (#958)

CI

  • Move cron pipeline script externally, fix cron scripts dependencies (#906)
  • Fix cron scripts execution (#912)
  • Build docs without attempting to merge master (#924)

DOCS

  • Added specifications for ledger, RPC, default transactions and encoding, which is partially derived from code. (#887)

FEATURES

  • Added IBC transaction (#411)

  • Ledger: Added validity predicate whitelist configurable for a network to limit which validity predicates are permitted (#875)

  • Ledger: Added transaction whitelist configurable for a network to limit which transactions are permitted (#876)

  • Added transactions and vp to create and mint nfts. (#882)

  • Supports a new type of transaction intended to be sent by validators, so called protocol transactions.

    • New transaction type
    • Generation of keys for validators to sign protocol txs
    • A service to broadcast protocol txs from the ledger
    • Improved client tx broadcasting

    (#913)

IMPROVEMENTS

  • Added a common signing schemes interface to ease additions/removals of signing schemes to the ledger. (#225)
  • Canonicalize all wallet aliases to lowercase in the CLI. (#564)
  • Ledger: Handle spurious errors on user initiated shutdown. (#716)
  • Dependency: Replace ed22519-dalek with ed22519-consensus. (#753)
  • Network config: Make the WASM checksums optional in network source, as it is filled in by init-network utils command. (#777)
  • Network config: The WASM dir were moved inside chain directories. (#838)
  • Ledger: added support for transactions to write temporary data that can be read by any VP that is checking the validity of the transaction. This is being used in IBC native VP for fungible token transfer. (#848)
  • Ledger: Update tendermint-rs and ibc-rs (#863)
  • Ledger: Sign transaction hash of bytes instead of the bytes themselves. (#886)
  • Update the Rust toolchain to 1.58.1. (#902)
  • Implemented BorshSchema for ledger's the public types. (#907)
  • Updated the tx result from an undecryptable tx to give an error code and message stating message was not decryptable (#910)
  • Ledger: Update ibc-rs to v0.12.0 (#926)
  • WASM: Use tx/VP specific preludes. (#948)
  • WASM: Split up tx and VP modules into files. (#952)

v0.4.0 - Jan 31, 2022

Anoma 0.4.0 is a scheduled minor release, released 31 January 2022.

BUG FIXES

  • Matchmaker: Fix a matchmaker's state management via a raw pointer that was causing segfaults in the matchmaker in release build. (#806)

CI

  • Build Linux package directly from tagged releases, and upload wasm from tags. (#801)

FEATURES

  • Client/Ledger: Added a flag to allow to indicate that client should exit once the transaction is in mempool without waiting for it to be applied in a block. (#403)
  • Ledger: Emit and validate IBC events from transactions. (#480)
  • Add anomac tx-result command to query the result of a transaction given a transaction hash. (#634)
  • Ledger: Use IBC messages from ibc-rs crate to be used in the relayer. (#699)
  • Ledger: Added fungible token transfer support to IBC validity predicate. (#823)

IMPROVEMENTS

  • Ledger: Add IbcActions trait to execute IBC operations (#411)
  • Matchmaker has been separated from intent gossiper node. Multiple matchmakers can connect to an intent gossiper node over WebSocket. (#579)
  • Wallet: Ask for encryption password confirmation when generating a new key. (#625)
  • Ledger: Two-layer merkle tree for the IBC proof verification (#671)
  • Testing: Increments network configuration ports used for E2E tests and ABCI++ enabled E2E tests to avoid sharing resources. (#717)
  • Matchmaker: compiling and loading matchmakers to and from dylib instead of WASM (#718)
  • Ledger: Coding IBC-related data without Borsh (#734)
  • Matchmaker: re-purpose the matchmaker macro to manage state of a custom matchmaker implementation (#746)
  • Testing: Update to a new branch of property-based state machine testing with initial state shrinking. (#765)
  • Port the Nix build to the new Flakes system. (#770)
  • Client/Utils: Respect wasm directory, when specified and non-default in the command. The command now doesn't unpack the network config archive into its default directories, if any of them are specified with non-default values. (#813)
  • Install the default token exchange matchmaker implemenetation into ~/.cargo/lib directory when building from source. When not absolute, the matchmaker will attempt to load the matchmaker from the same path as where the binary is being ran from, from ~/.cargo/lib or the current working directory. (#816)

MISCELLANEOUS

  • Force non-dev build for make build-release, check-release & package (#791)

v0.3.1 - Jan 11, 2022

First maintenance release in the 0.3.x series. Protocol compatible with 0.3.0, but changes the on-disk storage format - nodes will need to resync from scratch.

BUG FIXES

  • Fix the anoma client utils join-network to respect --base-dir argument, if specified (#723)
  • Ledger: Fix an issue in the default thread count usage calculation that was previously causing it to crash for a target with a single logical core. (#726)
  • Ledger: write storage diffs from the correct current block height and ignore these on loading last known block's state from persisted state on disk. (#732)
  • Ledger: Handle Unix and Windows interrupt and termination signals to shut down cleanly. (#768)

IMPROVEMENTS

  • Ledger: enable atomic commits in RocksDB and explicitly flush blocks without waiting (#372)
  • Fix the anoma client utils join-network to respect --base-dir argument, if specified (#711)
  • Ledger: Write predecessor block's values to be able to integrate Tendermint's rollback helper command. (#729)
  • Include a more accurate build version from git describe in help output version strings. (#733)
  • Ledger: Updated wasmer dependency to v2.1.1. (#756)
  • Config: Enable setting config values via environment variables, add variables for configuring Tendermint instrumentation and allow missing values in the config file (filled in with defaults defined in the code) (#774)
  • Gossip: Enable peer discovery with libp2p Kademlia and Identify protocol and allow to keep the established peer connections open. (#775)

MISCELLANEOUS

  • Adds missing nix-shell openssl dependency. (#694)
  • Don't include wasm checksums in the package, since the network configuration mechanisms now handle this. (#731)
  • Force non-dev build for make clippy. (#783)

v0.3.0 - Dec 20, 2021

Anoma 0.3.0

BUG FIXES

  • Ledger: Using fixes in tower-abci crate that improve shutdown and error handling. (#614)
  • Ledger: Fix rlimit breaking build on non-unix target. (#615)
  • Ledger/client: Fixed an issue with obtaining a result of a transaction. (#668)
  • Ledger: Fixed Windows build. (#684)
  • Use at least one thread for rocksdb compaction. (#704)
  • Downgrade to an older version of wasmer (1.0.2) to avoid runaway memory usage. (#708)
  • Process ABCI requests in order in the shell. (#713)

CI

  • Added jobs for ABCI++ feature enabled builds (#661)

DOCS

  • Fix broken links (#605)
  • Improved user guide installation section. Improved development scripts. (#613)
  • Updated Anoma prototypes pages. (#642)
  • Fix broken links to WASM sources. (#660)

FEATURES

  • Ledger: Added storage query (non-)membership proofs (#498)
  • Ledger: Make all transactions encrypted, add in ABCI++, support commit and reveal scheme for txs in a block. This feature is disabled by default because it requires a custom Tendermint build. The Tendermint version required with default features remains unchanged (currently 0.34.x). (#622)
  • Cache compiled wasm modules on disk. (#697)

IMPROVEMENTS

  • Improve how the anoma binary launches a sub-process by replacing itself with it. (#609)
  • Ledger/client: Add archives for release-able networks from init-network utils command. (#616)
  • Ledger: Open the default P2P address for non-localhost networks (#617)
  • Tooling (switched to Rust 1.56.1 and nightly to 2021-11-01. Many Cargo dependencies updates. (#618)
  • Ledger: Join Anoma networks from GitHub released network configurations. (#619)
  • Ledger/storage: Write values from references. (#627)
  • Build: Avoid build context in Docker image builds. (#629)
  • Ledger: Add the WASM checksums file for the pre-built transactions and validity predicates to network releases. (#644)
  • Ledger: Simplified gas addition code. (#648)
  • Ledger: Improved the "wrapper" transaction type data structures and encoding. (#653)
  • Ledger: Follow-up to the improved "wrapper" transaction type data structures and encoding. (#655)
  • Ledger: Refactored ledger threads usage and made them configurable. (#658)
  • Ledger: Updated dependencies names to nix friendly format. (#664)
  • Ledger: Follow-up to the updated crate names to nix friendly format. (#666)
  • Ledger/client: Set a default fee amount, token, and gas limit for txs. (#667)
  • Remove intent gossiper key from configuration file, storing it separately. (#673)
  • Refactor historical data storage in rocksdb to store diffs of key changes, and additional database performance changes. (#683)
  • Improved nix integration. (#685)
  • Ledger/client: Fix the confirmation dialog for using an existing alias and allow to select a new one. (#690)
  • Refactor debug printouts in wasm modules to use conditional compilation. (#693)
  • Ledger: Updated to wasmer 2.0.1. (#698)
  • Allow zero-balance transactions pending proper gas fee deduction. (#700)
  • Emit more CPU thread usage information. (#705)

TESTING

  • Tests/E2E: Added PoS tests for bonding and initialization of a validator account on-chain. (#463)

v0.2.0 - Oct 29, 2021

Feigenbaum

Anoma 0.2.0 is the first release in the 0.2.x series, developed alongside the Feigenbaum public testnet series.

For more information, see the launch article.

v0.1.6 - Oct 15, 2021

An internal prerelease.

v0.1.3 - Oct 08, 2021

An internal testnet release.

Information - Updated Sep 20, 2022

Stars: 263
Forks: 85
Issues: 97

Repositories & Extras

Read JSON values quickly - Rust JSON Parser

AJSON get json value with specified path, such as project

Read JSON values quickly - Rust JSON Parser

Rust WebAssembly A* Pathfinding Demo

This is a port of an A* implementation of mine from an old Unity maze project

Rust WebAssembly A* Pathfinding Demo

Rust port of my CHIP-8 Emulator (interpreted)

cargo run &lt;path-to-ROM-file&gt;

Rust port of my CHIP-8 Emulator (interpreted)

A path tracer written in rust

Inspired by the amazing

A path tracer written in rust

Semantic filesystem implemented in Rust

Rather than files being stored by path, they are stored by ID with associated metadata

Semantic filesystem implemented in Rust

Learn Rust by Building Real Applications (UDEMY)

PUBLIC_PATH=$(pwd)/public cargo run

Learn Rust by Building Real Applications (UDEMY)

Console Maze game written in Rust

Visited path tracker toggle

Console Maze game written in Rust

A Rust library providing methods for accessing standard paths on the local filesystem (config, cache,...

A Rust library providing methods for accessing standard paths on the local filesystem (config, cache, user directories and etc

A Rust library providing methods for accessing standard paths on the local filesystem (config, cache,...
Facebook Instagram Twitter GitHub Dribbble
Privacy