Skip to content

Better RawNewtorkMessage deserealization from IO stream#231

Merged
dongcarl merged 27 commits intorust-bitcoin:masterfrom
datagnition:network-streaming
Feb 27, 2019
Merged

Better RawNewtorkMessage deserealization from IO stream#231
dongcarl merged 27 commits intorust-bitcoin:masterfrom
datagnition:network-streaming

Conversation

@dr-orlovsky
Copy link
Copy Markdown
Collaborator

@dr-orlovsky dr-orlovsky commented Feb 2, 2019

Follow-up to #229

While working with remote peers over the network it is required to deserealize RawNetworkMessage from TCPStream to read the incoming messages. These messages can be partial – or one TCP packet can contain few of them. To make the library usable for such use cases, I have implemented the required functionality and covered it with unit tests.

Sample usage:

fn run() -> Result<(), Error> {
    // Opening stream to the remote bitcoind peer
    let mut stream = TcpStream::connect(SocketAddr::from(([37, 187, 0, 47], 8333));
    let start = SystemTime::now();

    // Constructing and sending `version` message to get some messages back from the remote peer
    let since_the_epoch = start.duration_since(UNIX_EPOCH)
        .expect("Time went backwards");
    let version_msg = message::RawNetworkMessage {
        magic: constants::Network::Bitcoin.magic(),
        payload: message::NetworkMessage::Version(message_network::VersionMessage::new(
            0,
            since_the_epoch.as_secs() as i64,
            address::Address::new(receiver, 0),
            address::Address::new(receiver, 0),
            0,
            String::from("macx0r"),
            0
        ))
    };
    stream.write(encode::serialize(&version_msg).as_slice())?;

    // Receiving incoming messages
    let mut buffer = vec![];
    loop {
        let result = StreamReader::new(&mut stream, None).read_messages();
        if let Err(err) = result {
            stream.shutdown(Shutdown::Both)?;
            return Err(Error::DataError(err))
        }
        for msg in result.unwrap() {
            println!("Received message: {:?}", msg.payload);
        }
    }
}

Sample output is the following:

Received message: Version(VersionMessage { version: 70015, services: 1037, timestamp: 1548637162, receiver: Address {services: 0, address: [0, 0, 0, 0, 0, 65535, 23536, 35968], port: 33716}, sender: Address {services: 1037, address: [0, 0, 0, 0, 0, 0, 0, 0], port: 0}, nonce: 1370726880972892633, user_agent: "/Satoshi:0.17.99/", start_height: 560412, relay: true })
Received message: Verack
Received message: Alert([1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 127, 0, 0, 0, 0, 255, 255, 255, 127, 254, 255, 255, 127, 1, 255, 255, 255, 127, 0, 0, 0, 0, 255, 255, 255, 127, 0, 255, 255, 255, 127, 0, 47, 85, 82, 71, 69, 78, 84, 58, 32, 65, 108, 101, 114, 116, 32, 107, 101, 121, 32, 99, 111, 109, 112, 114, 111, 109, 105, 115, 101, 100, 44, 32, 117, 112, 103, 114, 97, 100, 101, 32, 114, 101, 113, 117, 105, 114, 101, 100, 0])

Working sample code can be found here: https://github.com/dr-orlovsky/bitcoinbigdata-netlistener

dr-orlovsky added a commit to datagnition/rust-bitcoin that referenced this pull request Feb 3, 2019
dr-orlovsky added a commit to datagnition/rust-bitcoin that referenced this pull request Feb 3, 2019
@dr-orlovsky
Copy link
Copy Markdown
Collaborator Author

@tamasblummer I have commented on the reason why it's impossible to implement the suggestion - see the comments in the code above pls

@tamasblummer
Copy link
Copy Markdown
Contributor

How about this: b8bd1d9
You might change the loop to a for if you want to have retries. I would not as that can be left to the app.

@dr-orlovsky
Copy link
Copy Markdown
Collaborator Author

@tamasblummer this looks very nice, I do agree with the solution and that for is better then loop. Thanks for fixing. Unfortunately I would not be able to check the lib against my code communicating with the real bitcoind peers till the Saturday, but since it passes all unit tests I think you can proceed with thus edition.

@tamasblummer
Copy link
Copy Markdown
Contributor

Then please pick the commit b8bd1d9 into your branch and squash all commits.

@dr-orlovsky
Copy link
Copy Markdown
Collaborator Author

There is no such functionality on GitHub - I just can't pick this commit since it is not a part of any existing branch - neither via GitHub web interface or from a command line

@tamasblummer
Copy link
Copy Markdown
Contributor

you do not do it in github but on your own git.
https://stackoverflow.com/questions/5189560/squash-my-last-x-commits-together-using-git
git push -f

@tamasblummer
Copy link
Copy Markdown
Contributor

tamasblummer commented Feb 9, 2019

may work pull -ing my branch into yours. like
git checkout network-streaming
git pull https://github.com/tamasblummer/rust-bitcoin.git dr-orlovsky-network-streaming

if not:

git checkout master
git checkout -b tamas_patch master
git pull https://github.com/tamasblummer/rust-bitcoin.git dr-orlovsky-network-streaming
git checkout network-streaming
git cherry-pick b8bd1d9

@dr-orlovsky
Copy link
Copy Markdown
Collaborator Author

@tamasblummer done, thank you. The problem was that I can't reference your changes, but with the given remote branch name (dr-orlovsky-network-streaming) it all went smoothly.

@tamasblummer
Copy link
Copy Markdown
Contributor

now please squash all commits into one and force push to have a review by someone else too.

@tamasblummer
Copy link
Copy Markdown
Contributor

You also squashed in changes of master since your branch started, your branch should have been rebased before squashing, sorry for not warning. Its part of this business to get the workflow of contributing to OS right.

@tamasblummer
Copy link
Copy Markdown
Contributor

actually the problem is you merged in master just before squashing.

@tamasblummer
Copy link
Copy Markdown
Contributor

If you still have the history then revert that merge of master into your branch and squash again.

@dr-orlovsky dr-orlovsky force-pushed the network-streaming branch 2 times, most recently from 3562b49 to 07eabf0 Compare February 9, 2019 13:37
dr-orlovsky added a commit to datagnition/rust-bitcoin that referenced this pull request Feb 9, 2019
commit 3562b494f3e25e6a88e5c696d150e4a74948dbd5
Author: Tamas Blummer <tamas.blummer@gmail.com>
Date:   Thu Feb 7 03:37:49 2019 +0100

    return a single message

commit f509fc1
Author: Dr. Maxim Orlovsky <dr.orlovsky@gmail.com>
Date:   Tue Feb 5 03:27:10 2019 +0200

    Verbose comments explaining the workflow for stream parsing in `StreamReader`

commit ff85da8
Author: Dr. Maxim Orlovsky <dr.orlovsky@gmail.com>
Date:   Mon Feb 4 03:37:29 2019 +0200

    Fixed tests failure in StreamReader

    caused by parallel-runned tests opening two simultaneuos TCP sockets on the same port

commit 50bb68d
Author: Dr. Maxim Orlovsky <dr.orlovsky@gmail.com>
Date:   Mon Feb 4 02:31:58 2019 +0200

    Additional complex unit test for StreamReader from real-world case of Bitcoin Core communications

    grabbed with Wireshark

commit d590101
Author: Dr. Maxim Orlovsky <dr.orlovsky@gmail.com>
Date:   Mon Feb 4 02:03:56 2019 +0200

    Improved & more detailed unit tests for StreamReader

    using both file & TcpStream IO, covering private methods

commit e68c186
Author: Dr. Maxim Orlovsky <dr.orlovsky@gmail.com>
Date:   Sun Feb 3 23:04:14 2019 +0200

    Making tests passing

commit 4ed9fd8
Author: Dr. Maxim Orlovsky <dr.orlovsky@gmail.com>
Date:   Sun Feb 3 22:31:06 2019 +0200

    Initial unit tests for new StreamReader

commit 150f00a
Author: Dr. Maxim Orlovsky <dr.orlovsky@gmail.com>
Date:   Sun Feb 3 22:29:57 2019 +0200

    Fixing compuler warning on the order of trait methods implementation

commit 27f8ed7
Author: Dr. Maxim Orlovsky <dr.orlovsky@gmail.com>
Date:   Sun Feb 3 22:29:30 2019 +0200

    Moving StreamReader to a separate file and abstracting its functionality out of RawNetworkMessage scope

    as suggested at rust-bitcoin#231 (comment)

commit cd1a170
Author: Dr. Maxim Orlovsky <dr.orlovsky@gmail.com>
Date:   Sun Feb 3 18:38:13 2019 +0200

    Fixing rust-bitcoin#231 (comment)

commit 48021db
Author: Dr. Maxim Orlovsky <dr.orlovsky@gmail.com>
Date:   Sat Feb 2 21:17:53 2019 +0200

    Configuring network::message::RawNetworkMessage.from_stream buffer size and iterations with special struct

commit 4426a14
Author: Dr. Maxim Orlovsky <dr.orlovsky@gmail.com>
Date:   Sat Feb 2 20:42:33 2019 +0200

    Improved consensus.encode.deserealize_partial function signature

    Now function communicateds back to the caller the amount of consumed data by adding Cursor part to the Result value tuple – instead of using &mut argument.
    This have led to simplified and more straightforward logic of the function and its callers.

commit f5587cd
Author: Dr. Maxim Orlovsky <dr.orlovsky@gmail.com>
Date:   Mon Jan 28 03:23:22 2019 +0200

    Documented `deserialize_partial` function

commit 4d464fa
Author: Dr. Maxim Orlovsky <dr.orlovsky@gmail.com>
Date:   Mon Jan 28 02:59:02 2019 +0200

    Fixed error reporting on incomplete message deserealization from a stream

commit 365facc
Author: Dr. Maxim Orlovsky <dr.orlovsky@gmail.com>
Date:   Mon Jan 28 02:35:57 2019 +0200

    Stream reading unit test updated with more complex case

commit 34a00e8
Author: Dr. Maxim Orlovsky <dr.orlovsky@gmail.com>
Date:   Mon Jan 28 02:35:34 2019 +0200

    Improved stream reading algorithm

commit 4410af8
Author: Dr. Maxim Orlovsky <dr.orlovsky@gmail.com>
Date:   Mon Jan 28 01:54:25 2019 +0200

    Stream deserealization unit test case

commit d3afdc4
Author: Dr. Maxim Orlovsky <dr.orlovsky@gmail.com>
Date:   Mon Jan 28 01:54:02 2019 +0200

    Generalizing stream deserialization (from TcpStream to any IO stream)

commit 28a1ffa
Author: Dr. Maxim Orlovsky <dr.orlovsky@gmail.com>
Date:   Mon Jan 28 01:29:38 2019 +0200

    Improving buffering while deserializing from TcpStream

commit e382886
Author: Dr. Maxim Orlovsky <dr.orlovsky@gmail.com>
Date:   Mon Jan 28 01:23:52 2019 +0200

    Trying reading TcpStream with BufRead

commit 6abbd15
Author: Dr. Maxim Orlovsky <dr.orlovsky@gmail.com>
Date:   Mon Jan 28 00:31:12 2019 +0200

    Hiding network::Error conversion trait from docs

commit 940d63d
Author: Dr. Maxim Orlovsky <dr.orlovsky@gmail.com>
Date:   Sun Jan 27 23:52:16 2019 +0200

    Support for automatic IO errors in ? syntax

commit afcc7c8
Author: Dr. Maxim Orlovsky <dr.orlovsky@gmail.com>
Date:   Sun Jan 27 23:10:05 2019 +0200

    Function that parses TcpStream and creates RawNetworkMessage out of it: `RawNetworkMessage::from_tcpstream`

commit e6ee7e5
Author: Dr. Maxim Orlovsky <dr.orlovsky@gmail.com>
Date:   Sun Jan 27 19:44:12 2019 +0200

    Improved unit tests for message peyload deserialization

commit 83acf9a
Author: Dr. Maxim Orlovsky <dr.orlovsky@gmail.com>
Date:   Sun Jan 27 19:39:03 2019 +0200

    Desearilizing partial message content, which will be required lately for reading TcpStream partial content

commit 4a16bcc
Author: Dr. Maxim Orlovsky <dr.orlovsky@gmail.com>
Date:   Sun Jan 27 19:37:49 2019 +0200

    Support for debug mode formattin in RawNetworkMessage
@dr-orlovsky
Copy link
Copy Markdown
Collaborator Author

dr-orlovsky commented Feb 9, 2019

I didn't have the history, but I was able to reconstruct it and get rid of all merges from origin/master - and then squashed in again. Pls check if everything is correct for now

tamasblummer
tamasblummer previously approved these changes Feb 9, 2019
@tamasblummer tamasblummer requested a review from dongcarl February 9, 2019 21:18
dongcarl
dongcarl previously approved these changes Feb 15, 2019
Copy link
Copy Markdown
Member

@dongcarl dongcarl left a comment

Choose a reason for hiding this comment

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

I'm inclined to approve this change, especially because of the illustrative tests. Thank you for your contribution! Just need to resolve the conflict and I'd be more than happy to reACK. ☺️

dr-orlovsky and others added 14 commits February 27, 2019 00:04
Now function communicateds back to the caller the amount of consumed data by adding Cursor part to the Result value tuple – instead of using &mut argument.
This have led to simplified and more straightforward logic of the function and its callers.
using both file & TcpStream IO, covering private methods
… Bitcoin Core communications

grabbed with Wireshark
caused by parallel-runned tests opening two simultaneuos TCP sockets on the same port
@dr-orlovsky
Copy link
Copy Markdown
Collaborator Author

@dongcarl rebased. Not sure if this is the thing you have asked me for, so pls let me know if I've done something wrong

@tamasblummer
Copy link
Copy Markdown
Contributor

This looks good. It does no longer contain changes from master. It would be perfect if squashed.

@tamasblummer
Copy link
Copy Markdown
Contributor

Since this was already reviewed I approve it. Next time please do it like here (rebase + squash).

@tamasblummer tamasblummer self-requested a review February 27, 2019 14:25
@tamasblummer
Copy link
Copy Markdown
Contributor

@dongcarl please "Squash and merge" if ok.

@dongcarl dongcarl merged commit 3c21e30 into rust-bitcoin:master Feb 27, 2019
apoelstra added a commit to apoelstra/rust-bitcoin that referenced this pull request Mar 1, 2019
kyluke pushed a commit to kyluke/rust-bitcoin that referenced this pull request Jul 10, 2019
newtype implementation of opcodes::All

Removes unsafety when converting u8 -> All

safe implementation of All -> Ordinary

squashme: work around lack of associated constants

make opcode PR work with 1.14.0

add some opcode tests

Fix indentation in opcodes.rs

Fix comment on transaction version

Internalize unnecessarily exported macros

Bump secp to 0.12

Replace slow hex decoding function with optimized version

Fixes rust-bitcoin#207.

Remove unused Pair iterator and util::iter module

Add feature gated hex decode benchmark

bump version to 0.16

Bump rustc version to 1.22.0

it is annoying to have a difference between debug and print for hash

Fix typos

Run cargo bench on rustc nightly in travis, remote useless move

Add bitcoin_hashes dependency, rename some features

Because features and dependencies share the same namespace, and we want
to pass down the optional dependence on serde to bitcoin_hashes, we need
to rename the feature to something other than serde. Right now only
features can be passed down to dependencies.

Note that we could have also renamed the dependency to something like
serde-dep and kept the same feature name, however, dependency renaming
has only been available since cargo 0.27.0

Features that represent optional dependencies have been prefixed with
'use-'. The travis file has also been modified to conform to this
change.

Implement En/Decodable for sha256d::Hash

Convert codebase from util::hash to bitcoin_hashes

Also replace unsafe transmute with call to read_u64_into

Remove code deprecated by bitcoin_hashes from util::hash

Remove unused internal macro

Remove fuzz_util module

Not needed anymore as the bitcoin_hashes crate handles this.

Remove rust-crypto dependency

We no longer need rust-crypto after integrating bitcoin_hashes.

Fix typos and clarify some comment in blockdata, block, address (rust-bitcoin#230)

Remove Address::p2pk

There is no address format for p2pk.

add BIP157 (Client Side Block Filtering) Messages (rust-bitcoin#225)

* add BIP57 (Client Side Block Filtering) Messages

* rabased after rust-bitcoin#215

Cleanup util::privkey in preparation for PublicKey

- Rename privkey::PrivKey to privkey::PrivateKey
- Remove unnecessary methods for privkey::PrivateKey
- Modify tests to work with above changes

Add PublicKey struct encapsulating compressedness

- Move util::privkey to util::key
- Add PublicKey struct to util::key
- Implement de/serialization methods for util::key::PublicKey

Integrate newly-added PublicKey with Address

- Switch util::address::Payload::Pubkey variant to wrap
  util::key::PublicKey
- Switch util::address::Address::p*k* constructors to use
  util::key::PublicKey
- Fix tests for aforementioned switch
- Add convenience methods for util::key::PublicKey to
  util::key::PrivateKey conversion
- Switch BIP143 tests to use util::key::PublicKey

key: Reword and clarify comments

key: Use correct error for decoding

This change also moves the secp256k1::Error wrapper from util::Error to
consensus::encode::Error, since we do not use it anywhere else. We can
add it back to util::Error once we have instances of secp256k1::Error
that are not related to consensus::encode.

Extract travis testing into locally-runnable script

Extract the Script assembly creator from fmt::Debug

Added contributing part to README

point to IRC

bip32: ChildNumber constructors return Result

They can produce an error if the index is out of range.

bip32: Introduce DerivationPath type

Implements Display and FromStr for easy usage with serialized types.

bip32: Change test vectors to use DerivationPath

bip32: Add additional methods and traits to DerivationPath

- From<&[ChildNumber]> (cloning)
- AsRef<[ChildNumber]>
- std::iter::FromIterator<ChildNumber>
- std::iter::IntoIterator<ChildNumber>
- std::ops::Index (returning &[ChildNumber])

Also add two methods:
- child(&self, ChildNumber) -> DerivationPath
- into_child(self, ChildNumber) -> DerivationPath

Implement Witness commitment check for Block. Remove MerkleRoot implementations for types implementing BitcoinHash as
it is misleading. MerkleRoot is defined instead for a Block.

Forbid unsafe code

Remove extraneous clones in consensus::params

Remove unused Option en/decoding

Better RawNewtorkMessage deserealization from IO stream (rust-bitcoin#231)

Follow-up to rust-bitcoin#229

While working with remote peers over the network it is required to deserealize RawNetworkMessage from `TCPStream` to read the incoming messages. These messages can be partial – or one TCP packet can contain few of them. To make the library usable for such use cases, I have implemented the required functionality and covered it with unit tests.

Sample usage:
```rust
fn run() -> Result<(), Error> {
    // Opening stream to the remote bitcoind peer
    let mut stream = TcpStream::connect(SocketAddr::from(([37, 187, 0, 47], 8333));
    let start = SystemTime::now();

    // Constructing and sending `version` message to get some messages back from the remote peer
    let since_the_epoch = start.duration_since(UNIX_EPOCH)
        .expect("Time went backwards");
    let version_msg = message::RawNetworkMessage {
        magic: constants::Network::Bitcoin.magic(),
        payload: message::NetworkMessage::Version(message_network::VersionMessage::new(
            0,
            since_the_epoch.as_secs() as i64,
            address::Address::new(receiver, 0),
            address::Address::new(receiver, 0),
            0,
            String::from("macx0r"),
            0
        ))
    };
    stream.write(encode::serialize(&version_msg).as_slice())?;

    // Receiving incoming messages
    let mut buffer = vec![];
    loop {
        let result = StreamReader::new(&mut stream, None).read_messages();
        if let Err(err) = result {
            stream.shutdown(Shutdown::Both)?;
            return Err(Error::DataError(err))
        }
        for msg in result.unwrap() {
            println!("Received message: {:?}", msg.payload);
        }
    }
}
```

Sample output is the following:
```
Received message: Version(VersionMessage { version: 70015, services: 1037, timestamp: 1548637162, receiver: Address {services: 0, address: [0, 0, 0, 0, 0, 65535, 23536, 35968], port: 33716}, sender: Address {services: 1037, address: [0, 0, 0, 0, 0, 0, 0, 0], port: 0}, nonce: 1370726880972892633, user_agent: "/Satoshi:0.17.99/", start_height: 560412, relay: true })
Received message: Verack
Received message: Alert([1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 127, 0, 0, 0, 0, 255, 255, 255, 127, 254, 255, 255, 127, 1, 255, 255, 255, 127, 0, 0, 0, 0, 255, 255, 255, 127, 0, 255, 255, 255, 127, 0, 47, 85, 82, 71, 69, 78, 84, 58, 32, 65, 108, 101, 114, 116, 32, 107, 101, 121, 32, 99, 111, 109, 112, 114, 111, 109, 105, 115, 101, 100, 44, 32, 117, 112, 103, 114, 97, 100, 101, 32, 114, 101, 113, 117, 105, 114, 101, 100, 0])
```

Working sample code can be found here: https://github.com/dr-orlovsky/bitcoinbigdata-netlistener

key: add some missing functionality

bip32: replace rust-secp key types with rust-bitcoin key types

We continue to support only compressed keys when doing key derivation,
but de/serialization of uncompressed keys will now work, and it will
be easier/more consistent to implement PSBT on top of this.

Add PSBT-specific Error data type

- Implement psbt::Error data type
- Implement conversion from psbt::Error to util::Error
- Create util::psbt module
- Create non-public util::psbt::error module

Add data types for raw PSBT key-value pairs

- Add (en)decoding logic for said data types

Add trait for PSBT key-value maps

Add PSBT global data key-value map type

- Implement psbt::Map trait for psbt::Global
- Add converting constructor logic from Transaction for psbt::Global
- Add (en)decoding logic for psbt::Global
  - Always deserialize unsigned_tx as non-witness

- Add trait for PSBT (de)serialization
- Implement PSBT (de)serialization trait for relevant psbt::Global types

- Add macros for consensus::encode-backed PSBT (de)serialization
  implementations
- Add macro for implementing encoding logic for PSBT key-value maps

Add PSBT output data key-value map type

- Implement psbt::Map trait for psbt::Output
- Add (en)decoding logic for psbt::Output

- Implement PSBT (de)serialization trait for relevant psbt::Output types

- Add macro for merging fields for PSBT key-value maps
- Add macro for implementing decoding logic for PSBT key-value maps
- Add convenience macro for implementing both encoding and decoding
  logic for PSBT key-value maps
- Add macro for inserting raw PSBT key-value pairs into PSBT key-value
  maps
- Add macro for getting raw PSBT key-value pairs from PSBT key-value
  maps

Add PSBT input data key-value map type

- Implement psbt::Map trait for psbt::Input
- Add (en)decoding logic for psbt::Input

- Implement PSBT (de)serialization trait for relevant psbt::Input types

Add Partially Signed Transaction type

- Add merging logic for PartiallySignedTransactions
- Add (en)decoding logic for PartiallySignedTransaction
- Add converting constructor logic from Transaction for
  PartiallySignedTransaction
- Add extracting constructor logic from PartiallySignedTransaction for
  Transaction

Squashed in fixes from stevenroose <stevenroose@gmail.com>

- Prevent PSBT::extract_tx from panicking
- Make PartiallySignedTransaction fields public

Add test vectors from BIP174 specification

- Add macro for decoding and unwrapping PartiallySignedTransaction from
  hex string

Add fuzz testing for PartiallySignedTransaction

Add copyright notice to PSBT-related files

bump version to 0.17.0

add rust-bitcoin#231 to CHANGELOG for 0.17.0

key: implement ToString and FromStr for PublicKey

script: add `push_key` function to Builder to allow serializing public keys more easily

bump version to 0.17.1

Bump bitcoin-bech32 dependency

This makes the Address::Payload::WitnessProgram inner type compatible
with rust-lightning-invoice's Fallback::SegWitProgram's inner type.
This allows specifying fallbacks from addresses.

util::key: Provide to_bytes() methods for key types

These are mainly utility methods around the existing way to serialize
the key types.

util::key add serde de/serialization

contracthash: add fixed test vector

contracthash: use `PublicKey` and `PrivateKey` types; minor cleanups

contracthash: more cleanups

bump version to 0.18

Fix nit in CHANGELOG.md

bip32: Add DerivationPathIterator and related methods

Adds methods
- ChildNumber::increment
- DerivationPath::children_from
- DerivationPath::normal_children
- DerivationPath::hardened_children

Drop LoneHeaders and just use BlockHeader

The protocol has a bug where a 0u8 is pushed at the end of each
block header on the wire in headers messages. WHy this bug came
about is unrealted and shouldn't impact API design.

Implement util::misc::signed_msg_hash()

Add slice consensus encode/decode functions and use for short arrays

Swap a few more [d]encoders to slice emit/read functions

Support sendheaders network message decode

Drop some unused/not-needed Encodable impls

Speed up Vec<u8> [d]e[n]code operations by dropping the generic

Decrease travis-fuzz iterations to fix hangs

Two serde quirks from switching dependencies

Add Amount and SignedAmount types

Add fuzz target for Amount parsing

Fix trivial DoS when deserializing messages from the network

fuzz: Add fuzzer for RawNetworkMessage.

Rename deserialize_raw_network_message to make my afl scripts happy

Switch Travis fuzzing to 30 seconds per target from an iter count.

Rename BlockHeader::spv_validate to validate_pow

Remove confusing mentions of SPV

Rename OP_NOP2 and OP_NOP3 to OP_CLTV and OP_CSV

Add OutPoint::new() for one-liner construction (rust-bitcoin#285)

Remove Decimal and replace strason with serde_json

Slightly update README
yancyribbens pushed a commit to yancyribbens/rust-bitcoin that referenced this pull request Mar 23, 2024
PastaPastaPasta pushed a commit to PastaPastaPasta/rust-dashcore that referenced this pull request Feb 2, 2026
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.

3 participants