Tendermint in Rust!

Overview

tendermint.rs

Crate Docs Build Status Audit Status Apache 2.0 Licensed Rust Stable

Tendermint in Rust with TLA+ specifications.

Tendermint is a high-performance blockchain consensus engine for Byzantine fault tolerant applications written in any programming language.

Requirements

Tested against the latest stable version of Rust. May work with older versions.

Compatible with the v0.34 series of Tendermint Core.

Documentation

See each component for the relevant documentation.

Libraries:

  • tendermint - Tendermint data structures and serialization
  • tendermint-rpc - Tendermint RPC client and response types
  • light-client - Tendermint light client library for verifying signed headers, tracking validator set changes, and detecting forks

Binaries:

  • light-node - Tendermint light node to synchronize with a blockchain using the light client

Releases

Release tags can be found on Github.

Crates are released on crates.io.

Contributing

The Tendermint protocols are specified in English in the tendermint/spec repo. Any protocol changes or clarifications should be contributed there.

This repo contains the TLA+ specifications and Rust implementations for various components of Tendermint. See the CONTRIBUTING.md to start contributing.

Versioning

We follow Semantic Versioning. However, as we are pre-v1.0.0, we use the MINOR version to refer to breaking changes and the PATCH version for features, improvements, and fixes.

Only the following crates are covered by SemVer guarantees:

  • tendermint
  • tendermint-rpc

Other crates may change arbitrarily with every release for now.

We use the same version for all crates and release them collectively.

Resources

Software, Specs, and Documentation

Papers

License

Copyright © 2020 Informal Systems

Licensed under the Apache License, Version 2.0 (the "License"); you may not use the files in this repository except in compliance with the License. You may obtain a copy of the License at

https://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Comments
  • Wrong validation of LightBlock's commits

    Wrong validation of LightBlock's commits

    I have a failing MBT test for the LightClient verifier, with an empty commit in the LightBlock.

    This is how the test fails:

        > step 2, expecting Invalid
          > lite: NotEnoughTrust(NotEnoughTrust(VotingPowerTally { total: 100, tallied: 0, trust_threshold: TrustThresholdFraction { numerator: 1, denominator: 3 } }))
    

    The relevant test part is this:

    [current |->
        [Commits |-> {},
          header |->
            [NextVS |-> { "n1", "n2", "n3", "n4" },
              VS |-> { "n2", "n3" },
              height |-> 5,
              lastCommit |-> { "n1", "n3" },
              time |-> 6]],
      now |-> 1401,
      verdict |-> "INVALID",
      verified |->
        [Commits |-> { "n1", "n2", "n4" },
          header |->
            [NextVS |-> { "n2", "n3" },
              VS |-> { "n1", "n2", "n4" },
              height |-> 2,
              lastCommit |-> { "n1", "n2", "n3", "n4" },
              time |-> 3]]]
    

    current here is the untrusted header, and verified is the trusted header, which are submitted to the verifier.verify() function. From the point of view of the spec, and also from my personal understanding, an untrusted signed header with an empty commit should be rejected as invalid. The implementation, on the other hand, returns the NotEnoughTrust verdict. My understanding is that this comes from the specific order of executing checks in this code, probably for performance reasons, as verifying the signatures is costly.

    We could address this from different angles:

    • Change the spec, to allow more behaviors in this case. While this is doable, in my view a signed header with an empty commit still should be under the Invalid category, and not under NotEnoughTrust.
    • Change the order of checks in the code; don't know whether this is doable or acceptable from the performance point of view.
    • Add some lightweight checks that would verify, e.g., that the commit contains more than 1/3 of votes from the validator set, without actually verifying the signatures. This is going to be lightweight from the performance point of view, but would make the code a bit more complicated.

    I think @romac should probably decide here; I am open for discussions.

    P.S. The English spec (see especially the text below under "Details of the Functions") is also not very precise about how this is computed (e.g. in multiple places it talks about the number of validators instead of their voting power), so, probably, it should be also improved. (cc. @josef-widder?)

    bug light-client verification tests tla+ 
    opened by andrey-kuprianov 25
  • Cleaner directory structure

    Cleaner directory structure

    Right now we have a ton of diverse functionality directly under src. Might be better to organize this a bit better, for instance, at a high level:

    src/
      abci/
        abci/
        abci.rs
      amino/
        amino_types/
        amino_types.rs
      types/
        block/
        block.rs
        chain/
        chain.rs
        consensus
        consensus.rs
        evidence.rs
        genesis.rs
        hash.rs
        time.rs
        timeout.rs
        validator.rs
        version.rs
        vote/
        vote.rs
      config/
        config/
        config.rs
      crypto/
        merkle.rs
        private_key.rs
        public_key.rs
        signature.rs
      error.rs
      lib.rs
      p2p/
        channel/
        channel.rs
        moniker.rs
        net.rs
        node
        node.rs
        secret_connection/
        secret_connection.rs
      rpc/
        rpc/
        rpc.rs
      serializers.rs
    

    Then for things like

      amino/
        amino_types/
        amino_types.rs
    

    and

      abci/
        abci/
        abci.rs
    

    we can probably consolidate further.

    structure 
    opened by ebuchman 24
  • light-client: wasm compilation

    light-client: wasm compilation

    Edited due to summarize the discussion bellow

    Context

    The light client core verification algorithm can verify an application state using only a sequence of headers. This has uses in the light-node where it can perform IO and fetch headers from full nodes. Another use for the light client verification is within the context of IBC where a full node will verify data from foreign chains before including it in local transactions. In this way the light client verification works as a pure function without IO but instead relies on the relayer to feed it data.

    Goal

    We want to be able to compile our light-client verification to WASM such that it can be used by other chains to verify foreign data. This requires a build target that is independent from WASM incompatible libraries such as net2/socket2 or other IO operations.

    Status

    • [x] The tendermint crate successfully builds for both wasm32-unknown-unknown and wasm32-wasi targets (#553)
    • [x] The light-client crate successfully builds for both wasm32-unknown-unknown and wasm32-wasi targets (#553)
    • [x] The rpc crate successfully builds for both wasm32-unknown-unknown and wasm32-wasi targets if its client feature is disabled.
    • [ ] Implement a WASM-compatible RPC client in the rpc crate using the fetch API exposed by web-sys
    • [ ] npm package which exports the light client API to JavaScript via wasm-pack
    light-client structure wasm 
    opened by brapse 23
  • Replace chrono with time 0.3

    Replace chrono with time 0.3

    Fixes: #1012, #1007, #1008

    Important or breaking changes:

    • Removed chrono from dependencies and public API, replaced by time.

    • The inner value of the Time tuple struct is made private.

    • Renamed Time::as_rfc3339 to to_rfc3339 to follow Rust naming conventions (somehow clippy got it wrong at the time of #910, but it no longer does).

    • Instead of From<chrono::DateTime<Utc>>, Time now implements TryFrom<time::OffsetDateTime>. The reason is that OffsetDateTime supports a wider range of dates than is supported by RFC 3339, and tendermint::Time needs its string conversion to be standard-compliant and infallible.

    • Added Time methods checked_add/checked_sub, to follow the pattern set by SystemTime and time::OffsetDateTime. In a later change, these could replace use of the Add/Sub operator impls, whose Result output types make for poor ergonomics in operator overloading.

    • rpc uses time types OffsetDateTime and Date in query operands instead of their chrono counterparts.

    • [x] Referenced an issue explaining the need for the change

    • [x] Updated all relevant documentation in docs

    • [x] Updated all code comments where relevant

    • [x] Wrote tests

    • [x] Added entry in .changelog/

    dependencies serialization breaking code-quality 
    opened by mzabaluev 20
  • Current `master` fails Ed25519 test vectors

    Current `master` fails Ed25519 test vectors

    Steps to reproduce

    Checked out current master, b99c9373790732bbce9b267b558c1796fc90e20d

    ~/c/p/tendermint-rs (master|_) $ cargo test
        Finished test [unoptimized + debuginfo] target(s) in 0.10s
         Running unittests (target/debug/deps/tendermint-99ad5c52f3717b64)
    
    running 56 tests
    test abci::transaction::tests::upper_hex_serialization ... ok
    [SNIPPED]
    test validator::tests::test_validator_set ... ok
    test public_key::tests::ed25519_test_vectors ... FAILED
    test trust_threshold::test::undefined ... ok
    [SNIPPED]
    test time::tests::serde_of_rfc3339_timestamps_is_safe ... ok
    
    failures:
    
    ---- public_key::tests::ed25519_test_vectors stdout ----
    thread 'public_key::tests::ed25519_test_vectors' panicked at 'signature should be valid for test vector 3', tendermint/src/public_key.rs:655:37
    note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
    
    
    failures:
        public_key::tests::ed25519_test_vectors
    
    test result: FAILED. 55 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.05s
    
    error: test failed, to rerun pass '-p tendermint --lib'
    
    Full Output
    ~/c/p/tendermint-rs ((b99c9373…)|_) $ cargo test
       Compiling tendermint-proto v0.21.0 (/home/hdevalence/code/penumbra/tendermint-rs/proto)
       Compiling tendermint-abci v0.21.0 (/home/hdevalence/code/penumbra/tendermint-rs/abci)
       Compiling tendermint v0.21.0 (/home/hdevalence/code/penumbra/tendermint-rs/tendermint)
       Compiling tendermint-rpc v0.21.0 (/home/hdevalence/code/penumbra/tendermint-rs/rpc)
       Compiling tendermint-testgen v0.21.0 (/home/hdevalence/code/penumbra/tendermint-rs/testgen)
       Compiling tendermint-p2p v0.21.0 (/home/hdevalence/code/penumbra/tendermint-rs/p2p)
       Compiling tendermint-test v0.21.0 (/home/hdevalence/code/penumbra/tendermint-rs/test)
       Compiling tendermint-light-client v0.21.0 (/home/hdevalence/code/penumbra/tendermint-rs/light-client)
       Compiling tendermint-light-client-js v0.21.0 (/home/hdevalence/code/penumbra/tendermint-rs/light-client-js)
        Finished test [unoptimized + debuginfo] target(s) in 25.03s
         Running unittests (target/debug/deps/tendermint-99ad5c52f3717b64)
    
    running 56 tests
    test abci::tag::test::tag_serde ... ok
    test abci::data::tests::test_serialization ... ok
    test abci::data::tests::test_deserialization ... ok
    test abci::transaction::tests::upper_hex_serialization ... ok
    test block::height::tests::avoid_try_unwrap_dance ... ok
    test block::height::tests::increment_by_one ... ok
    test block::id::tests::parses_hex_strings ... ok
    test account::tests::test_ed25519_id ... ok
    test block::round::tests::avoid_try_unwrap_dance ... ok
    test block::id::tests::serializes_hex_strings ... ok
    test block::round::tests::increment_by_one ... ok
    test chain::id::tests::parses_valid_chain_ids ... ok
    test chain::id::tests::rejects_empty_chain_ids ... ok
    test chain::id::tests::rejects_overlength_chain_ids ... ok
    test consensus::state::tests::state_deser_update_null_test ... ok
    test consensus::state::tests::state_deser_update_total_test ... ok
    test consensus::state::tests::state_ord_test ... ok
    test block::header::tests::header_hashing ... ok
    test block::header::tests::serialization_roundtrip ... ok
    test merkle::tests::test_get_split_point ... ok
    test merkle::tests::test_rfc6962_empty_leaf ... ok
    test merkle::tests::test_rfc6962_empty_tree ... ok
    test merkle::tests::test_rfc6962_leaf ... ok
    test merkle::tests::test_rfc6962_node ... ok
    test net::tests::parse_unix_addr ... ok
    test proposal::canonical_proposal::tests::canonical_proposal_domain_checks ... ok
    test net::tests::parse_tcp_addr_without_id ... ok
    test merkle::proof::test::serialization_roundtrip ... ok
    test net::tests::parse_tcp_ipv6_addr ... ok
    test proposal::tests::test_encoding_with_empty_block_id ... ok
    test public_key::pub_key_request::tests::test_empty_pubkey_msg ... ok
    test net::tests::parse_tcp_addr ... ok
    test proposal::tests::test_deserialization ... ok
    test proposal::tests::test_serialization ... ok
    test public_key::tests::json_parsing ... ok
    test public_key::tests::test_consensus_serialization ... ok
    test public_key::tests::test_ed25519_pubkey_msg ... ok
    test timeout::tests::parse_seconds ... ok
    test timeout::tests::parse_milliseconds ... ok
    test timeout::tests::reject_no_units ... ok
    test vote::canonical_vote::tests::canonical_vote_domain_checks ... ok
    test vote::sign_vote::tests::test_deserialization ... ok
    test vote::sign_vote::tests::test_sign_bytes_compatibility ... ok
    test vote::sign_vote::tests::test_vote_encoding_with_empty_block_id ... ok
    test validator::tests::test_validator_set ... ok
    test vote::sign_vote::tests::test_vote_rountrip_with_sig ... ok
    test vote::sign_vote::tests::test_vote_serialization ... ok
    test public_key::tests::ed25519_test_vectors ... FAILED
    test trust_threshold::test::just_right ... ok
    test trust_threshold::test::too_small ... ok
    test trust_threshold::test::too_large ... ok
    test trust_threshold::test::cannot_be_one ... ok
    test trust_threshold::test::undefined ... ok
    test time::tests::serde_from_value_is_the_inverse_of_to_value_within_reasonable_time_range ... ok
    test time::tests::serde_of_rfc3339_timestamps_is_safe ... ok
    test time::tests::can_parse_rfc3339_timestamps ... ok
    
    failures:
    
    ---- public_key::tests::ed25519_test_vectors stdout ----
    thread 'public_key::tests::ed25519_test_vectors' panicked at 'signature should be valid for test vector 3', tendermint/src/public_key.rs:655:37
    note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
    
    
    failures:
        public_key::tests::ed25519_test_vectors
    
    test result: FAILED. 55 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.04s
    
    error: test failed, to rerun pass '-p tendermint --lib'
    ~/c/p/tendermint-rs ((b99c9373…)|_) [101]$ cargo tree
    tendermint v0.21.0 (/home/hdevalence/code/penumbra/tendermint-rs/tendermint)
    ├── async-trait v0.1.51 (proc-macro)
    │   ├── proc-macro2 v1.0.29
    │   │   └── unicode-xid v0.2.2
    │   ├── quote v1.0.9
    │   │   └── proc-macro2 v1.0.29 (*)
    │   └── syn v1.0.65
    │       ├── proc-macro2 v1.0.29 (*)
    │       ├── quote v1.0.9 (*)
    │       └── unicode-xid v0.2.2
    ├── bytes v1.1.0
    ├── chrono v0.4.19
    │   ├── libc v0.2.101
    │   ├── num-integer v0.1.44
    │   │   └── num-traits v0.2.14
    │   │       [build-dependencies]
    │   │       └── autocfg v1.0.1
    │   │   [build-dependencies]
    │   │   └── autocfg v1.0.1
    │   ├── num-traits v0.2.14 (*)
    │   ├── serde v1.0.130
    │   │   └── serde_derive v1.0.130 (proc-macro)
    │   │       ├── proc-macro2 v1.0.29 (*)
    │   │       ├── quote v1.0.9 (*)
    │   │       └── syn v1.0.65 (*)
    │   └── time v0.1.44
    │       └── libc v0.2.101
    ├── ed25519 v1.2.0
    │   ├── serde v1.0.130 (*)
    │   └── signature v1.3.1
    ├── ed25519-dalek v1.0.1
    │   ├── curve25519-dalek v3.2.0
    │   │   ├── byteorder v1.4.3
    │   │   ├── digest v0.9.0
    │   │   │   └── generic-array v0.14.4
    │   │   │       └── typenum v1.14.0
    │   │   │       [build-dependencies]
    │   │   │       └── version_check v0.9.3
    │   │   ├── rand_core v0.5.1
    │   │   │   └── getrandom v0.1.16
    │   │   │       ├── cfg-if v1.0.0
    │   │   │       └── libc v0.2.101
    │   │   ├── subtle v2.4.1
    │   │   └── zeroize v1.3.0
    │   │       └── zeroize_derive v1.1.0 (proc-macro)
    │   │           ├── proc-macro2 v1.0.29 (*)
    │   │           ├── quote v1.0.9 (*)
    │   │           ├── syn v1.0.65 (*)
    │   │           └── synstructure v0.12.5
    │   │               ├── proc-macro2 v1.0.29 (*)
    │   │               ├── quote v1.0.9 (*)
    │   │               ├── syn v1.0.65 (*)
    │   │               └── unicode-xid v0.2.2
    │   ├── ed25519 v1.2.0 (*)
    │   ├── rand v0.7.3
    │   │   ├── getrandom v0.1.16 (*)
    │   │   ├── libc v0.2.101
    │   │   ├── rand_chacha v0.2.2
    │   │   │   ├── ppv-lite86 v0.2.10
    │   │   │   └── rand_core v0.5.1 (*)
    │   │   └── rand_core v0.5.1 (*)
    │   ├── serde v1.0.130 (*)
    │   ├── serde_bytes v0.11.5
    │   │   └── serde v1.0.130 (*)
    │   ├── sha2 v0.9.7
    │   │   ├── block-buffer v0.9.0
    │   │   │   └── generic-array v0.14.4 (*)
    │   │   ├── cfg-if v1.0.0
    │   │   ├── cpufeatures v0.2.1
    │   │   ├── digest v0.9.0 (*)
    │   │   └── opaque-debug v0.3.0
    │   └── zeroize v1.3.0 (*)
    ├── flex-error v0.4.2
    │   ├── anyhow v1.0.43
    │   ├── eyre v0.6.5
    │   │   ├── indenter v0.3.3
    │   │   └── once_cell v1.8.0
    │   └── paste v1.0.5 (proc-macro)
    ├── futures v0.3.17
    │   ├── futures-channel v0.3.17
    │   │   ├── futures-core v0.3.17
    │   │   └── futures-sink v0.3.17
    │   ├── futures-core v0.3.17
    │   ├── futures-executor v0.3.17
    │   │   ├── futures-core v0.3.17
    │   │   ├── futures-task v0.3.17
    │   │   └── futures-util v0.3.17
    │   │       ├── futures-channel v0.3.17 (*)
    │   │       ├── futures-core v0.3.17
    │   │       ├── futures-io v0.3.17
    │   │       ├── futures-macro v0.3.17 (proc-macro)
    │   │       │   ├── proc-macro-hack v0.5.19 (proc-macro)
    │   │       │   ├── proc-macro2 v1.0.29 (*)
    │   │       │   ├── quote v1.0.9 (*)
    │   │       │   └── syn v1.0.65 (*)
    │   │       │   [build-dependencies]
    │   │       │   └── autocfg v1.0.1
    │   │       ├── futures-sink v0.3.17
    │   │       ├── futures-task v0.3.17
    │   │       ├── memchr v2.4.1
    │   │       ├── pin-project-lite v0.2.7
    │   │       ├── pin-utils v0.1.0
    │   │       ├── proc-macro-hack v0.5.19 (proc-macro)
    │   │       ├── proc-macro-nested v0.1.7
    │   │       └── slab v0.4.4
    │   │       [build-dependencies]
    │   │       └── autocfg v1.0.1
    │   ├── futures-io v0.3.17
    │   ├── futures-sink v0.3.17
    │   ├── futures-task v0.3.17
    │   └── futures-util v0.3.17 (*)
    ├── num-traits v0.2.14 (*)
    ├── once_cell v1.8.0
    ├── prost v0.7.0
    │   ├── bytes v1.1.0
    │   └── prost-derive v0.7.0 (proc-macro)
    │       ├── anyhow v1.0.43
    │       ├── itertools v0.9.0
    │       │   └── either v1.6.1
    │       ├── proc-macro2 v1.0.29 (*)
    │       ├── quote v1.0.9 (*)
    │       └── syn v1.0.65 (*)
    ├── prost-types v0.7.0
    │   ├── bytes v1.1.0
    │   └── prost v0.7.0 (*)
    ├── serde v1.0.130 (*)
    ├── serde_bytes v0.11.5 (*)
    ├── serde_json v1.0.67
    │   ├── itoa v0.4.8
    │   ├── ryu v1.0.5
    │   └── serde v1.0.130 (*)
    ├── serde_repr v0.1.7 (proc-macro)
    │   ├── proc-macro2 v1.0.29 (*)
    │   ├── quote v1.0.9 (*)
    │   └── syn v1.0.65 (*)
    ├── sha2 v0.9.7 (*)
    ├── signature v1.3.1
    ├── subtle v2.4.1
    ├── subtle-encoding v0.5.1
    │   └── zeroize v1.3.0 (*)
    ├── tendermint-proto v0.21.0 (/home/hdevalence/code/penumbra/tendermint-rs/proto)
    │   ├── bytes v1.1.0
    │   ├── chrono v0.4.19 (*)
    │   ├── flex-error v0.4.2 (*)
    │   ├── num-derive v0.3.3 (proc-macro)
    │   │   ├── proc-macro2 v1.0.29 (*)
    │   │   ├── quote v1.0.9 (*)
    │   │   └── syn v1.0.65 (*)
    │   ├── num-traits v0.2.14 (*)
    │   ├── prost v0.7.0 (*)
    │   ├── prost-types v0.7.0 (*)
    │   ├── serde v1.0.130 (*)
    │   ├── serde_bytes v0.11.5 (*)
    │   └── subtle-encoding v0.5.1 (*)
    │   [dev-dependencies]
    │   └── serde_json v1.0.67 (*)
    ├── time v0.1.44 (*)
    ├── toml v0.5.8
    │   └── serde v1.0.130 (*)
    ├── url v2.2.2
    │   ├── form_urlencoded v1.0.1
    │   │   ├── matches v0.1.9
    │   │   └── percent-encoding v2.1.0
    │   ├── idna v0.2.3
    │   │   ├── matches v0.1.9
    │   │   ├── unicode-bidi v0.3.6
    │   │   └── unicode-normalization v0.1.19
    │   │       └── tinyvec v1.3.1
    │   │           └── tinyvec_macros v0.1.0
    │   ├── matches v0.1.9
    │   └── percent-encoding v2.1.0
    └── zeroize v1.3.0 (*)
    [dev-dependencies]
    ├── pretty_assertions v0.7.2
    │   ├── ansi_term v0.12.1
    │   └── diff v0.1.12
    ├── proptest v0.10.1
    │   ├── bit-set v0.5.2
    │   │   └── bit-vec v0.6.3
    │   ├── bitflags v1.3.2
    │   ├── byteorder v1.4.3
    │   ├── lazy_static v1.4.0
    │   ├── num-traits v0.2.14 (*)
    │   ├── quick-error v1.2.3
    │   ├── rand v0.7.3 (*)
    │   ├── rand_chacha v0.2.2 (*)
    │   ├── rand_xorshift v0.2.0
    │   │   └── rand_core v0.5.1 (*)
    │   ├── regex-syntax v0.6.25
    │   ├── rusty-fork v0.3.0
    │   │   ├── fnv v1.0.7
    │   │   ├── quick-error v1.2.3
    │   │   ├── tempfile v3.2.0
    │   │   │   ├── cfg-if v1.0.0
    │   │   │   ├── libc v0.2.101
    │   │   │   ├── rand v0.8.4
    │   │   │   │   ├── libc v0.2.101
    │   │   │   │   ├── rand_chacha v0.3.1
    │   │   │   │   │   ├── ppv-lite86 v0.2.10
    │   │   │   │   │   └── rand_core v0.6.3
    │   │   │   │   │       └── getrandom v0.2.3
    │   │   │   │   │           ├── cfg-if v1.0.0
    │   │   │   │   │           └── libc v0.2.101
    │   │   │   │   └── rand_core v0.6.3 (*)
    │   │   │   └── remove_dir_all v0.5.3
    │   │   └── wait-timeout v0.2.0
    │   │       └── libc v0.2.101
    │   └── tempfile v3.2.0 (*)
    └── tendermint-pbt-gen v0.21.0 (/home/hdevalence/code/penumbra/tendermint-rs/pbt-gen)
        ├── chrono v0.4.19 (*)
        └── proptest v0.10.1 (*)
    
    tendermint-abci v0.21.0 (/home/hdevalence/code/penumbra/tendermint-rs/abci)
    ├── bytes v1.1.0
    ├── flex-error v0.4.2 (*)
    ├── prost v0.7.0 (*)
    ├── tendermint-proto v0.21.0 (/home/hdevalence/code/penumbra/tendermint-rs/proto) (*)
    └── tracing v0.1.26
        ├── cfg-if v1.0.0
        ├── pin-project-lite v0.2.7
        ├── tracing-attributes v0.1.15 (proc-macro)
        │   ├── proc-macro2 v1.0.29 (*)
        │   ├── quote v1.0.9 (*)
        │   └── syn v1.0.65 (*)
        └── tracing-core v0.1.19
            └── lazy_static v1.4.0
    
    tendermint-light-client v0.21.0 (/home/hdevalence/code/penumbra/tendermint-rs/light-client)
    ├── contracts v0.4.0 (proc-macro)
    │   ├── proc-macro2 v1.0.29 (*)
    │   ├── quote v1.0.9 (*)
    │   └── syn v1.0.65 (*)
    ├── crossbeam-channel v0.4.4
    │   ├── crossbeam-utils v0.7.2
    │   │   ├── cfg-if v0.1.10
    │   │   └── lazy_static v1.4.0
    │   │   [build-dependencies]
    │   │   └── autocfg v1.0.1
    │   └── maybe-uninit v2.0.0
    ├── derive_more v0.99.16 (proc-macro)
    │   ├── convert_case v0.4.0
    │   ├── proc-macro2 v1.0.29 (*)
    │   ├── quote v1.0.9 (*)
    │   └── syn v1.0.65 (*)
    │   [build-dependencies]
    │   └── rustc_version v0.3.3
    │       └── semver v0.11.0
    │           └── semver-parser v0.10.2
    │               └── pest v2.1.3
    │                   └── ucd-trie v0.1.3
    ├── flex-error v0.4.2 (*)
    ├── futures v0.3.17 (*)
    ├── serde v1.0.130 (*)
    ├── serde_cbor v0.11.2
    │   ├── half v1.7.1
    │   └── serde v1.0.130 (*)
    ├── serde_derive v1.0.130 (proc-macro) (*)
    ├── sled v0.34.6
    │   ├── crc32fast v1.2.1
    │   │   └── cfg-if v1.0.0
    │   ├── crossbeam-epoch v0.9.5
    │   │   ├── cfg-if v1.0.0
    │   │   ├── crossbeam-utils v0.8.5
    │   │   │   ├── cfg-if v1.0.0
    │   │   │   └── lazy_static v1.4.0
    │   │   ├── lazy_static v1.4.0
    │   │   ├── memoffset v0.6.4
    │   │   │   [build-dependencies]
    │   │   │   └── autocfg v1.0.1
    │   │   └── scopeguard v1.1.0
    │   ├── crossbeam-utils v0.8.5 (*)
    │   ├── fs2 v0.4.3
    │   │   └── libc v0.2.101
    │   ├── fxhash v0.2.1
    │   │   └── byteorder v1.4.3
    │   ├── libc v0.2.101
    │   ├── log v0.4.14
    │   │   └── cfg-if v1.0.0
    │   └── parking_lot v0.11.2
    │       ├── instant v0.1.10
    │       │   └── cfg-if v1.0.0
    │       ├── lock_api v0.4.5
    │       │   └── scopeguard v1.1.0
    │       └── parking_lot_core v0.8.5
    │           ├── cfg-if v1.0.0
    │           ├── instant v0.1.10 (*)
    │           ├── libc v0.2.101
    │           └── smallvec v1.6.1
    ├── static_assertions v1.1.0
    ├── tendermint v0.21.0 (/home/hdevalence/code/penumbra/tendermint-rs/tendermint) (*)
    ├── tendermint-rpc v0.21.0 (/home/hdevalence/code/penumbra/tendermint-rs/rpc)
    │   ├── async-trait v0.1.51 (proc-macro) (*)
    │   ├── bytes v1.1.0
    │   ├── chrono v0.4.19 (*)
    │   ├── flex-error v0.4.2 (*)
    │   ├── futures v0.3.17 (*)
    │   ├── getrandom v0.1.16 (*)
    │   ├── http v0.2.4
    │   │   ├── bytes v1.1.0
    │   │   ├── fnv v1.0.7
    │   │   └── itoa v0.4.8
    │   ├── hyper v0.14.12
    │   │   ├── bytes v1.1.0
    │   │   ├── futures-channel v0.3.17 (*)
    │   │   ├── futures-core v0.3.17
    │   │   ├── futures-util v0.3.17 (*)
    │   │   ├── h2 v0.3.4
    │   │   │   ├── bytes v1.1.0
    │   │   │   ├── fnv v1.0.7
    │   │   │   ├── futures-core v0.3.17
    │   │   │   ├── futures-sink v0.3.17
    │   │   │   ├── futures-util v0.3.17 (*)
    │   │   │   ├── http v0.2.4 (*)
    │   │   │   ├── indexmap v1.7.0
    │   │   │   │   └── hashbrown v0.11.2
    │   │   │   │   [build-dependencies]
    │   │   │   │   └── autocfg v1.0.1
    │   │   │   ├── slab v0.4.4
    │   │   │   ├── tokio v1.11.0
    │   │   │   │   ├── bytes v1.1.0
    │   │   │   │   ├── libc v0.2.101
    │   │   │   │   ├── memchr v2.4.1
    │   │   │   │   ├── mio v0.7.13
    │   │   │   │   │   ├── libc v0.2.101
    │   │   │   │   │   └── log v0.4.14 (*)
    │   │   │   │   ├── pin-project-lite v0.2.7
    │   │   │   │   └── tokio-macros v1.3.0 (proc-macro)
    │   │   │   │       ├── proc-macro2 v1.0.29 (*)
    │   │   │   │       ├── quote v1.0.9 (*)
    │   │   │   │       └── syn v1.0.65 (*)
    │   │   │   │   [build-dependencies]
    │   │   │   │   └── autocfg v1.0.1
    │   │   │   ├── tokio-util v0.6.8
    │   │   │   │   ├── bytes v1.1.0
    │   │   │   │   ├── futures-core v0.3.17
    │   │   │   │   ├── futures-sink v0.3.17
    │   │   │   │   ├── log v0.4.14 (*)
    │   │   │   │   ├── pin-project-lite v0.2.7
    │   │   │   │   └── tokio v1.11.0 (*)
    │   │   │   └── tracing v0.1.26 (*)
    │   │   ├── http v0.2.4 (*)
    │   │   ├── http-body v0.4.3
    │   │   │   ├── bytes v1.1.0
    │   │   │   ├── http v0.2.4 (*)
    │   │   │   └── pin-project-lite v0.2.7
    │   │   ├── httparse v1.5.1
    │   │   ├── httpdate v1.0.1
    │   │   ├── itoa v0.4.8
    │   │   ├── pin-project-lite v0.2.7
    │   │   ├── socket2 v0.4.1
    │   │   │   └── libc v0.2.101
    │   │   ├── tokio v1.11.0 (*)
    │   │   ├── tower-service v0.3.1
    │   │   ├── tracing v0.1.26 (*)
    │   │   └── want v0.3.0
    │   │       ├── log v0.4.14 (*)
    │   │       └── try-lock v0.2.3
    │   ├── hyper-proxy v0.9.1
    │   │   ├── bytes v1.1.0
    │   │   ├── futures v0.3.17 (*)
    │   │   ├── headers v0.3.4
    │   │   │   ├── base64 v0.13.0
    │   │   │   ├── bitflags v1.3.2
    │   │   │   ├── bytes v1.1.0
    │   │   │   ├── headers-core v0.2.0
    │   │   │   │   └── http v0.2.4 (*)
    │   │   │   ├── http v0.2.4 (*)
    │   │   │   ├── mime v0.3.16
    │   │   │   ├── sha-1 v0.9.8
    │   │   │   │   ├── block-buffer v0.9.0 (*)
    │   │   │   │   ├── cfg-if v1.0.0
    │   │   │   │   ├── cpufeatures v0.2.1
    │   │   │   │   ├── digest v0.9.0 (*)
    │   │   │   │   └── opaque-debug v0.3.0
    │   │   │   └── time v0.1.44 (*)
    │   │   ├── http v0.2.4 (*)
    │   │   ├── hyper v0.14.12 (*)
    │   │   ├── hyper-tls v0.5.0
    │   │   │   ├── bytes v1.1.0
    │   │   │   ├── hyper v0.14.12 (*)
    │   │   │   ├── native-tls v0.2.8
    │   │   │   │   ├── log v0.4.14 (*)
    │   │   │   │   ├── openssl v0.10.36
    │   │   │   │   │   ├── bitflags v1.3.2
    │   │   │   │   │   ├── cfg-if v1.0.0
    │   │   │   │   │   ├── foreign-types v0.3.2
    │   │   │   │   │   │   └── foreign-types-shared v0.1.1
    │   │   │   │   │   ├── libc v0.2.101
    │   │   │   │   │   ├── once_cell v1.8.0
    │   │   │   │   │   └── openssl-sys v0.9.66
    │   │   │   │   │       └── libc v0.2.101
    │   │   │   │   │       [build-dependencies]
    │   │   │   │   │       ├── autocfg v1.0.1
    │   │   │   │   │       ├── cc v1.0.70
    │   │   │   │   │       └── pkg-config v0.3.19
    │   │   │   │   ├── openssl-probe v0.1.4
    │   │   │   │   └── openssl-sys v0.9.66 (*)
    │   │   │   ├── tokio v1.11.0 (*)
    │   │   │   └── tokio-native-tls v0.3.0
    │   │   │       ├── native-tls v0.2.8 (*)
    │   │   │       └── tokio v1.11.0 (*)
    │   │   ├── native-tls v0.2.8 (*)
    │   │   ├── tokio v1.11.0 (*)
    │   │   ├── tokio-native-tls v0.3.0 (*)
    │   │   └── tower-service v0.3.1
    │   ├── hyper-rustls v0.22.1
    │   │   ├── ct-logs v0.8.0
    │   │   │   └── sct v0.6.1
    │   │   │       ├── ring v0.16.20
    │   │   │       │   ├── libc v0.2.101
    │   │   │       │   ├── once_cell v1.8.0
    │   │   │       │   ├── spin v0.5.2
    │   │   │       │   └── untrusted v0.7.1
    │   │   │       │   [build-dependencies]
    │   │   │       │   └── cc v1.0.70
    │   │   │       └── untrusted v0.7.1
    │   │   ├── futures-util v0.3.17 (*)
    │   │   ├── hyper v0.14.12 (*)
    │   │   ├── log v0.4.14 (*)
    │   │   ├── rustls v0.19.1
    │   │   │   ├── base64 v0.13.0
    │   │   │   ├── log v0.4.14 (*)
    │   │   │   ├── ring v0.16.20 (*)
    │   │   │   ├── sct v0.6.1 (*)
    │   │   │   └── webpki v0.21.4
    │   │   │       ├── ring v0.16.20 (*)
    │   │   │       └── untrusted v0.7.1
    │   │   ├── rustls-native-certs v0.5.0
    │   │   │   ├── openssl-probe v0.1.4
    │   │   │   └── rustls v0.19.1 (*)
    │   │   ├── tokio v1.11.0 (*)
    │   │   ├── tokio-rustls v0.22.0
    │   │   │   ├── rustls v0.19.1 (*)
    │   │   │   ├── tokio v1.11.0 (*)
    │   │   │   └── webpki v0.21.4 (*)
    │   │   └── webpki v0.21.4 (*)
    │   ├── peg v0.7.0
    │   │   ├── peg-macros v0.7.0 (proc-macro)
    │   │   │   ├── peg-runtime v0.7.0
    │   │   │   ├── proc-macro2 v1.0.29 (*)
    │   │   │   └── quote v1.0.9 (*)
    │   │   └── peg-runtime v0.7.0
    │   ├── pin-project v1.0.8
    │   │   └── pin-project-internal v1.0.8 (proc-macro)
    │   │       ├── proc-macro2 v1.0.29 (*)
    │   │       ├── quote v1.0.9 (*)
    │   │       └── syn v1.0.65 (*)
    │   ├── serde v1.0.130 (*)
    │   ├── serde_bytes v0.11.5 (*)
    │   ├── serde_json v1.0.67 (*)
    │   ├── subtle-encoding v0.5.1 (*)
    │   ├── tendermint v0.21.0 (/home/hdevalence/code/penumbra/tendermint-rs/tendermint) (*)
    │   ├── tendermint-proto v0.21.0 (/home/hdevalence/code/penumbra/tendermint-rs/proto) (*)
    │   ├── thiserror v1.0.29
    │   │   └── thiserror-impl v1.0.29 (proc-macro)
    │   │       ├── proc-macro2 v1.0.29 (*)
    │   │       ├── quote v1.0.9 (*)
    │   │       └── syn v1.0.65 (*)
    │   ├── tokio v1.11.0 (*)
    │   ├── tracing v0.1.26 (*)
    │   ├── url v2.2.2 (*)
    │   ├── uuid v0.8.2
    │   └── walkdir v2.3.2
    │       └── same-file v1.0.6
    │   [dev-dependencies]
    │   └── lazy_static v1.4.0
    └── tokio v1.11.0 (*)
    [dev-dependencies]
    ├── gumdrop v0.8.0
    │   └── gumdrop_derive v0.8.0 (proc-macro)
    │       ├── proc-macro2 v1.0.29 (*)
    │       ├── quote v1.0.9 (*)
    │       └── syn v1.0.65 (*)
    ├── proptest v0.10.1 (*)
    ├── rand v0.7.3 (*)
    ├── serde_json v1.0.67 (*)
    ├── tempfile v3.2.0 (*)
    └── tendermint-testgen v0.21.0 (/home/hdevalence/code/penumbra/tendermint-rs/testgen)
        ├── ed25519-dalek v1.0.1 (*)
        ├── gumdrop v0.8.0 (*)
        ├── serde v1.0.130 (*)
        ├── serde_json v1.0.67 (*)
        ├── simple-error v0.2.3
        ├── tempfile v3.2.0 (*)
        └── tendermint v0.21.0 (/home/hdevalence/code/penumbra/tendermint-rs/tendermint) (*)
    
    tendermint-light-client-js v0.21.0 (/home/hdevalence/code/penumbra/tendermint-rs/light-client-js)
    ├── console_error_panic_hook v0.1.6
    │   ├── cfg-if v0.1.10
    │   └── wasm-bindgen v0.2.72
    │       ├── cfg-if v1.0.0
    │       ├── serde v1.0.130 (*)
    │       ├── serde_json v1.0.67 (*)
    │       └── wasm-bindgen-macro v0.2.72 (proc-macro)
    │           ├── quote v1.0.9 (*)
    │           └── wasm-bindgen-macro-support v0.2.72
    │               ├── proc-macro2 v1.0.29 (*)
    │               ├── quote v1.0.9 (*)
    │               ├── syn v1.0.65 (*)
    │               ├── wasm-bindgen-backend v0.2.72
    │               │   ├── bumpalo v3.7.0
    │               │   ├── lazy_static v1.4.0
    │               │   ├── log v0.4.14 (*)
    │               │   ├── proc-macro2 v1.0.29 (*)
    │               │   ├── quote v1.0.9 (*)
    │               │   ├── syn v1.0.65 (*)
    │               │   └── wasm-bindgen-shared v0.2.72
    │               └── wasm-bindgen-shared v0.2.72
    ├── serde v1.0.130 (*)
    ├── serde_json v1.0.67 (*)
    ├── syn v1.0.65 (*)
    ├── tendermint v0.21.0 (/home/hdevalence/code/penumbra/tendermint-rs/tendermint) (*)
    ├── tendermint-light-client v0.21.0 (/home/hdevalence/code/penumbra/tendermint-rs/light-client) (*)
    └── wasm-bindgen v0.2.72 (*)
    [dev-dependencies]
    └── wasm-bindgen-test v0.3.22
        ├── console_error_panic_hook v0.1.6 (*)
        ├── js-sys v0.3.49
        │   └── wasm-bindgen v0.2.72 (*)
        ├── scoped-tls v1.0.0
        ├── wasm-bindgen v0.2.72 (*)
        ├── wasm-bindgen-futures v0.4.22
        │   ├── cfg-if v1.0.0
        │   ├── js-sys v0.3.49 (*)
        │   └── wasm-bindgen v0.2.72 (*)
        └── wasm-bindgen-test-macro v0.3.22 (proc-macro)
            ├── proc-macro2 v1.0.29 (*)
            └── quote v1.0.9 (*)
    
    tendermint-p2p v0.21.0 (/home/hdevalence/code/penumbra/tendermint-rs/p2p)
    ├── aead v0.4.3
    │   └── generic-array v0.14.4 (*)
    ├── chacha20poly1305 v0.8.2
    │   ├── aead v0.4.3 (*)
    │   ├── chacha20 v0.7.3
    │   │   ├── cfg-if v1.0.0
    │   │   ├── cipher v0.3.0
    │   │   │   └── generic-array v0.14.4 (*)
    │   │   ├── cpufeatures v0.2.1
    │   │   └── zeroize v1.3.0 (*)
    │   ├── cipher v0.3.0 (*)
    │   ├── poly1305 v0.7.2
    │   │   ├── cpufeatures v0.2.1
    │   │   ├── opaque-debug v0.3.0
    │   │   └── universal-hash v0.4.1
    │   │       ├── generic-array v0.14.4 (*)
    │   │       └── subtle v2.4.1
    │   └── zeroize v1.3.0 (*)
    ├── ed25519-dalek v1.0.1 (*)
    ├── eyre v0.6.5 (*)
    ├── flex-error v0.4.2 (*)
    ├── flume v0.10.9
    │   ├── futures-core v0.3.17
    │   ├── futures-sink v0.3.17
    │   ├── nanorand v0.6.1
    │   │   └── getrandom v0.2.3 (*)
    │   ├── pin-project v1.0.8 (*)
    │   └── spin v0.9.2
    │       └── lock_api v0.4.5 (*)
    ├── hkdf v0.10.0
    │   ├── digest v0.9.0 (*)
    │   └── hmac v0.10.1
    │       ├── crypto-mac v0.10.1
    │       │   ├── generic-array v0.14.4 (*)
    │       │   └── subtle v2.4.1
    │       └── digest v0.9.0 (*)
    ├── merlin v2.0.1
    │   ├── byteorder v1.4.3
    │   ├── keccak v0.1.0
    │   ├── rand_core v0.5.1 (*)
    │   └── zeroize v1.3.0 (*)
    ├── prost v0.7.0 (*)
    ├── rand_core v0.5.1 (*)
    ├── sha2 v0.9.7 (*)
    ├── signature v1.3.1
    ├── subtle v2.4.1
    ├── tendermint v0.21.0 (/home/hdevalence/code/penumbra/tendermint-rs/tendermint) (*)
    ├── tendermint-proto v0.21.0 (/home/hdevalence/code/penumbra/tendermint-rs/proto) (*)
    ├── tendermint-std-ext v0.21.0 (/home/hdevalence/code/penumbra/tendermint-rs/std-ext)
    ├── x25519-dalek v1.1.1
    │   ├── curve25519-dalek v3.2.0 (*)
    │   ├── rand_core v0.5.1 (*)
    │   └── zeroize v1.3.0 (*)
    └── zeroize v1.3.0 (*)
    
    tendermint-pbt-gen v0.21.0 (/home/hdevalence/code/penumbra/tendermint-rs/pbt-gen) (*)
    
    tendermint-proto v0.21.0 (/home/hdevalence/code/penumbra/tendermint-rs/proto) (*)
    
    tendermint-rpc v0.21.0 (/home/hdevalence/code/penumbra/tendermint-rs/rpc) (*)
    
    tendermint-std-ext v0.21.0 (/home/hdevalence/code/penumbra/tendermint-rs/std-ext)
    
    tendermint-test v0.21.0 (/home/hdevalence/code/penumbra/tendermint-rs/test)
    [dev-dependencies]
    ├── ed25519-dalek v1.0.1 (*)
    ├── flex-error v0.4.2 (*)
    ├── flume v0.10.9 (*)
    ├── rand_core v0.5.1 (*)
    ├── readwrite v0.1.2
    ├── subtle-encoding v0.5.1 (*)
    ├── tendermint v0.21.0 (/home/hdevalence/code/penumbra/tendermint-rs/tendermint) (*)
    ├── tendermint-p2p v0.21.0 (/home/hdevalence/code/penumbra/tendermint-rs/p2p) (*)
    ├── tendermint-proto v0.21.0 (/home/hdevalence/code/penumbra/tendermint-rs/proto) (*)
    └── x25519-dalek v1.1.1 (*)
    
    tendermint-testgen v0.21.0 (/home/hdevalence/code/penumbra/tendermint-rs/testgen) (*)
    ~/c/p/tendermint-rs ((b99c9373…)|_) $ git status
    HEAD detached at b99c937
    nothing to commit, working tree clean
    

    What's the definition of "done" for this issue?

    cargo test should succeed

    bug 
    opened by hdevalence 20
  • Remove secret_connection and ring dependency

    Remove secret_connection and ring dependency

    I just upgraded the ring dependency, changed secret_connection.rs accordingly, hope you like it. We are using tendermint-rs in our project, there are probably a few PRs following this one ;D

    opened by yihuang 20
  • abci: Add domain types

    abci: Add domain types

    Incomplete implementation of #856

    Still to do:

    • [x] Referenced an issue explaining the need for the change
    • [x] Updated all relevant documentation in docs
    • [x] Updated all code comments where relevant
    • [ ] Wrote tests
    • [ ] Updated CHANGELOG.md
    opened by hdevalence 19
  • Retiring `anomaly`

    Retiring `anomaly`

    FYI, I'm planning on deprecating the anomaly error handling crate, which tendermint-rs presently uses.

    There have been a number of error handling crates that have surpassed it coming out of the error handling working group.

    I would suggest eyre as a replacement.

    opened by tarcieri 18
  • light-node: run against a Tendermint image fails with clock drift

    light-node: run against a Tendermint image fails with clock drift

    After spawning a light node in a Docker container with:

    $ docker run \
        -p 26656:26656 \
        -p 26657:26657 \
        -p 26660:26660 \
        tendermint/tendermint:v0.33.6
    

    If we fetch the latest block height, hash and time via RPC, we get:

    $ curl -X GET "http://localhost:26657/status" -H  "accept: application/json" | jq '.result.sync_info | {latest_block_hash,latest_block_height,latest_block_time}'
    
    {
      "latest_block_hash": "CCFF1A6907DB9DC08E7C58D9C590088D1522069FFDFF7ABD3E6D62DCD083DBC4",
      "latest_block_height": "2469",
      "latest_block_time": "2020-08-11T10:30:13.352595649Z"
    }
    

    Here we see that the block was committed at 10:30 UTC, whereas both on my machine and within the Docker container, the time is reported as 10:20 UTC, meaning that the block has been committed 10 minutes "in the future".

    So if we initialize the light-node with the block above, by running:

    $ cargo run -- initialize 2469 CCFF1A6907DB9DC08E7C58D9C590088D1522069FFDFF7ABD3E6D62DCD083DBC4
    

    and then start the light node with:

    $ cargo run -- start
    

    we get:

    started RPC server: 127.0.0.1:8888
    error: sync failed: no witness left: no initial trusted state
    error: sync failed: no witness left: no initial trusted state
    
    etc.
    

    After sprinkling some dbg! statements in the supervisor, we indeed see that verification fails because the headers pulled from the node are "from the future":

    [light-client/src/supervisor.rs:221] &verdict = Err(
        Error(
            Context {
                kind: InvalidLightBlock(
                    HeaderFromTheFuture {
                        header_time: Time(
                            2020-08-11T10:32:44.352595649Z,
                        ),
                        now: Time(
                            2020-08-11T10:22:58.589649Z,
                        ),
                    },
                ),
    

    Again, a 10 minutes clock drift.

    What is weird here, is that the reported time on both my machine and within the Docker container actually do match, which may point to a configuration issue in the Docker image.

    The very same behavior has been observed by @brapse on his machine.


    If we do the same operations above against a full node started with tendermint node --proxyapp=kvstore, things work out just fine and the light node continuously syncs to the latest block without issues:

    started RPC server: 127.0.0.1:8888
    synced to block: 5006
    synced to block: 5007
    synced to block: 5008
    
    etc.
    
    bug help wanted light-client 
    opened by romac 18
  • Feature guard the networking stuff

    Feature guard the networking stuff

    • since we already implemented the networking stuff ourselves, so it would be good for us to cut some dependencies.
    • we can even try to make it no_std, after separating out networking features.
    structure rpc 
    opened by yihuang 18
  • Serialization improvements

    Serialization improvements

    #247 - Serialization refactor #246 - CommitSig bug fix

    • [X] Referenced an issue explaining the need for the change
    • [ ] Updated all relevant documentation in docs
    • [X] Updated all code comments where relevant
    • [X] Wrote tests
    • [X] Updated CHANGES.md
    opened by greg-szabo 16
  • `tendermint-testgen`: add support for `no_std`

    `tendermint-testgen`: add support for `no_std`

    Description

    It would be great if the tendermint-testgen crate supported no_std. This is currently a blocker in ibc-rs for making our mocks feature no_std.

    Definition of "done"

    tendermint-testgen = {version = "0.x", default-features = false }
    

    doesn't link std.

    enhancement 
    opened by plafer 2
  • Proto decoding of ValidatorSet in tendermint-rs does not match tendermint encoding

    Proto decoding of ValidatorSet in tendermint-rs does not match tendermint encoding

    HI 👋🏼

    What went wrong?

    When trying to decode (in tendermint-rs) a proto encoded ValidatorSet (encoded in tendermint) you get the following error:

    StringTracer: error converting message type into domain type: StringTracer: mismatch between raw voting (Power(0)) and computed one (Power(10))
    

    I believe that the problem is strictly encoding in tendermint -> decoding in tendermint-rs. The opposite path should work if I understand correctly.

    This issue originates from a difference in behavior in encoding/decoding between tendermint and tendermint-rs. Specifically here you can notice that ValidatorSet.ToProto() will always result in ValidatorSet.TotalVotingPower = 0 (changed in this PR). However, in tendermint-rs, you require (here) for the raw voting power to match the computed one.

    You can also see that in tendermint this is not getting checked in decoding here. vals.TotalVotingPower() recalculates the voting power based on the validator set, and ignores the received raw one.

    Steps to reproduce

    In tendermint:

    nextValSetProto, err := state.NextValidators.ToProto()
    if err != nil {
    	return state, 0, fmt.Errorf("%v", err)
    }
    nextValSetBytes, err := nextValSetProto.Marshal()
    if err != nil {
    	return state, 0, fmt.Errorf("%v", err)
    }
    

    <--- ffi magic (or copy-paste raw bytes 🙃) --->

    Then in tendermint-rs:

    match Set::decode(val_set_slice) {
        Ok(vs) => println!("{:?}", vs),
        Err(e) => println!("{:?}", e),
    };
    

    Definition of "done"

    The encoding/decoding in tendermint and tendermint-rs should match. I guess the easy way would be to remove the said assertion in ValidatorSet's try_from() (Set::new() recalculates total_voting_power anyway), But I'm not sure if this is the desired behavior.

    bug 
    opened by toml01 0
  • Investigate some design tweaks over Crypto Implementation

    Investigate some design tweaks over Crypto Implementation

    As a reference for suggestion made in #1238

    • [ ] Referenced an issue explaining the need for the change
    • [ ] Updated all relevant documentation in docs
    • [ ] Updated all code comments where relevant
    • [ ] Wrote tests
    • [ ] Added entry in .changelog/
    opened by Farhad-Shabani 4
  • `Bytes` base64 deserialization

    `Bytes` base64 deserialization

    Using tendermint-rs v0.28.0

    Base64 deserialization on Bytes, e.g.,

    // rpc/src/endpoint/broadcast/tx_sync.rs
    pub struct Response {
    ...
      #[serde(with = "serializers::bytes::base64string")]
      pub data: Bytes,
    ...
    }
    

    doesn't work properly.

    The following transaction is being executed.

    ResponseDeliverTx { 
      code: 0, 
      data: b"\xd9'\x12\xa3\x02\xd9'\x10X\x1d\x01J\x10\x1dR\x1d\x81\x02\x11\xa0\xc64k\xa8\x9b\xd1\xcc\x1f\x82\x1c\x03\xb9i\xff\x9d\\\x8b/Y\x04A\xf6\x05\xc1\0", 
    ...
    }
    

    where the hexadecimal string corresponding to data is d92712a302d92710581d014a101d521d810211a0c6346ba89bd1cc1f821c03b969ff9d5c8b2f590441f605c100.

    However, I get the following response when executing self.client.tx(tendermint::Hash::Sha256(hash), false).await

    Response { 
      hash: Hash::Sha256(E35B544830279AE45AD4D5225C67C2BD2AECDCE25B1685CEA3767F0E8331882D), 
      ...
      tx_result: DeliverTx { 
        code: Ok, 
        data: b"2ScSowLZJxBYHQFKEB1SHYECEaDGNGuom9HMH4IcA7lp/51ciy9ZBEH2BcEA", 
        ...
      }
      ...
    }
    

    The data field is still base64-encoded.

    echo 2ScSowLZJxBYHQFKEB1SHYECEaDGNGuom9HMH4IcA7lp/51ciy9ZBEH2BcEA | base64 -d | xxd -p
    d92712a302d92710581d014a101d521d810211a0c6346ba89bd1cc1f821c03b969ff9d5c8b2f590441f605c100
    
    opened by fmorency 1
  • Implement PartialEq for rpc::Error

    Implement PartialEq for rpc::Error

    Description

    I'm trying to use the Error type from tendermint_rpc in an error type of my own using thiserror and would like to derive PartialEq on my error type, but this is currently not possible since the tendermint_rpc Error does not implement PartialEq. It does have a derive attribute for PartialEq, but according to the doc comments in flex_error these are not added to the main error struct. So either flex_error needs to be updated to implement PartialEq for all error types created with the define_error! macro, or PartialEq needs to be specifically implemented for the tendermint_rpc Error.

    Definition of "done"

    PartialEq is implemented for rpc::Error.

    enhancement 
    opened by apollo-sturdy 2
  • Add a script to execute all CI checks locally

    Add a script to execute all CI checks locally

    Description

    At present, it's possible to run all CI checks locally, but this requires manually executing each command separately. We should automate this.

    Definition of "done"

    1. When we have a script somewhere easily accessible in the repo that executes all the same checks that our CI does.
    2. When we have comments in every workflow under the .github directory that acts as reminders to update the local CI test script whenever updating/adding workflows, as well as in the contributing guidelines.
    enhancement tests ci 
    opened by thanethomson 0
Releases(v0.28.0)
Owner
Informal Systems
Informal Systems
Implementation of zero-knowledge proof circuits for Tendermint.

Tendermint X Implementation of zero-knowledge proof circuits for Tendermint. Overview Tendermint X's core contract is TendermintX, which stores the he

Succinct 3 Nov 8, 2023
Package used by the cosmos-rust-interface. Makes direct use of cosmos-rust.

Package used by the cosmos-rust-interface. Makes direct use of cosmos-rust (cosmos‑sdk‑proto, osmosis-proto, cosmrs).

Philipp 4 Dec 26, 2022
Rust project for working with ETH - Ethereum transactions with Rust on Ganache and also deploy smart contracts :)

Just a test project to work with Ethereum but using Rust. I'm using plain Rust here, not Foundry. In future we will use Foundry. Hope you're already f

Akhil Sharma 2 Dec 20, 2022
An open source Rust high performance cryptocurrency trading API with support for multiple exchanges and language wrappers. written in rust(🦀) with ❤️

Les.rs - Rust Cryptocurrency Exchange Library An open source Rust high performance cryptocurrency trading API with support for multiple exchanges and

Crabby AI 4 Jan 9, 2023
Simple node and rust script to achieve an easy to use bridge between rust and node.js

Node-Rust Bridge Simple rust and node.js script to achieve a bridge between them. Only 1 bridge can be initialized per rust program. But node.js can h

Pure 5 Apr 30, 2023
Marvin-Blockchain-Rust: A Rust-based blockchain implementation, part of the Marvin blockchain project.

Marvin Blockchain - Rust Implementation Welcome to the Rust implementation of the Marvin Blockchain. This project is part of a comparative study on bu

João Henrique Machado Silva 3 Sep 6, 2024
A Rust library for working with Bitcoin SV

Rust-SV A library to build Bitcoin SV applications in Rust. Documentation Features P2P protocol messages (construction and serialization) Address enco

Brenton Gunning 51 Oct 13, 2022
Coinbase pro client for Rust

Coinbase pro client for Rust Supports SYNC/ASYNC/Websocket-feed data support Features private and public API sync and async support websocket-feed sup

null 126 Dec 30, 2022
Custom Ethereum vanity address generator made in Rust

ethaddrgen Custom Ethereum address generator Get a shiny ethereum address and stand out from the crowd! Disclaimer: Do not use the private key shown i

Jakub Hlusička 153 Dec 27, 2022
The new, performant, and simplified version of Holochain on Rust (sometimes called Holochain RSM for Refactored State Model)

Holochain License: This repository contains the core Holochain libraries and binaries. This is the most recent and well maintained version of Holochai

Holochain 741 Jan 5, 2023
IBC modules and relayer - Formal specifications and Rust implementation

ibc-rs Rust implementation of the Inter-Blockchain Communication (IBC) protocol. This project comprises primarily four crates: The ibc crate defines t

Informal Systems 296 Dec 31, 2022
A Rust implementation of BIP-0039

bip39-rs A Rust implementation of BIP0039 Changes See the changelog file, or the Github releases for specific tags. Documentation Add bip39 to your Ca

Infincia LLC 49 Dec 9, 2022
Rust Ethereum 2.0 Client

Lighthouse: Ethereum 2.0 An open-source Ethereum 2.0 client, written in Rust and maintained by Sigma Prime. Documentation Overview Lighthouse is: Read

Sigma Prime 2.1k Jan 6, 2023
Official Rust implementation of the Nimiq protocol

Nimiq Core implementation in Rust (core-rs) Rust implementation of the Nimiq Blockchain Core Nimiq is a frictionless payment protocol for the web. Thi

Nimiq 72 Sep 23, 2022
Rust implementation of Zcash protocol

The Parity Zcash client. Gitter Blog: Parity teams up with Zcash Foundation for Parity Zcash client Installing from source Installing the snap Running

Parity Technologies 183 Sep 8, 2022
rust client libraries to deal with the current cardano mainnet (byron / cardano-sl)

Rust implementation of Cardano primitives, helpers, and related applications Cardano Rust is a modular toolbox of Cardano’s cryptographic primitives,

Input Output 275 Oct 9, 2022
A Rust library for generating cryptocurrency wallets

Table of Contents 1. Overview 2. Build Guide 2.1 Install Rust 2.2a Build from Homebrew 2.2b Build from Crates.io 2.2c Build from Source Code 3. Usage

Aleo 552 Dec 29, 2022
Safe, fast, small crypto using Rust

THE SOFTWARE IS PROVIDED "AS IS" AND BRIAN SMITH AND THE AUTHORS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES

Brian Smith 3k Jan 2, 2023
WebPKI X.509 Certificate Validation in Rust

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHORS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABIL

Brian Smith 408 Dec 16, 2022