Deirdre Connolly
1b8b4d0fac
Encode and decode Filter* messages
...
Also remove stubs related to MerkleBlock and the catchall case for unknown types since we
are finally matching all variants of the Message enum.
2019-12-05 13:48:42 -05:00
Deirdre Connolly
72def27b78
Add FilterLoad, FilterAdd, FilterClear message variants
...
Also remove MerkleBlock stub, we are no longer supporting it (zcashd doesn't either).
2019-12-05 13:48:42 -05:00
Deirdre Connolly
f5aa5f3794
Add Tweak and Filter types
2019-12-05 13:48:42 -05:00
Deirdre Connolly
51b888c0ff
Impl custom Debug for TransactionHash
...
Resolves #104
2019-12-05 10:07:47 -08:00
dependabot-preview[bot]
762617b917
Bump thiserror from 1.0.8 to 1.0.9
...
Bumps [thiserror](https://github.com/dtolnay/thiserror ) from 1.0.8 to 1.0.9.
- [Release notes](https://github.com/dtolnay/thiserror/releases )
- [Commits](https://github.com/dtolnay/thiserror/compare/1.0.8...1.0.9 )
Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-12-04 09:15:06 -08:00
dependabot-preview[bot]
a97ece996f
Bump thiserror from 1.0.6 to 1.0.8
...
Bumps [thiserror](https://github.com/dtolnay/thiserror ) from 1.0.6 to 1.0.8.
- [Release notes](https://github.com/dtolnay/thiserror/releases )
- [Commits](https://github.com/dtolnay/thiserror/compare/1.0.6...1.0.8 )
Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-12-03 12:25:55 -08:00
Henry de Valence
36cd6d6e06
cargo fmt
2019-11-27 23:53:36 -05:00
Henry de Valence
f58aaac1ae
Privately re-export ErrorSlot, ClientRequest in peer.
...
This means that all sub-modules of `peer` can import everything they need from
the `peer` module itself, without having to be aware of the internal structure
of their sibling modules.
2019-11-27 23:53:36 -05:00
Henry de Valence
ad6525574b
Rename PeerConnector -> peer::Connector
2019-11-27 23:53:36 -05:00
Henry de Valence
778e49b127
Rename PeerHandshake -> peer::Handshake
2019-11-27 23:53:36 -05:00
Henry de Valence
9ff0fd90dc
Rename ServerState -> State.
...
There's no need to write `Server` every time because it's only used inside of
the server code, and when the handshake service constructs a Server.
2019-11-27 23:53:36 -05:00
Henry de Valence
d1b3e8fe6b
Rename PeerServer -> peer::Server
2019-11-27 23:53:36 -05:00
Henry de Valence
77191e62f6
Remove outdated fixup note.
2019-11-27 23:53:36 -05:00
Henry de Valence
da78603d3a
Rename `PeerClient` to `peer::Client`.
2019-11-27 23:53:36 -05:00
dependabot-preview[bot]
35d0ce3143
Bump tower-load from `52dbdda` to `51a374c`
...
Bumps [tower-load](https://github.com/tower-rs/tower ) from `52dbdda` to `51a374c`.
- [Release notes](https://github.com/tower-rs/tower/releases )
- [Commits](52dbdda23d...51a374c564
)
Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-11-27 11:17:37 -08:00
Henry de Valence
4fbc8270a2
Move PeerSet initialization into a submodule.
2019-11-27 05:06:01 -05:00
Henry de Valence
6db852fab2
Refactor protocol into internal, external modules.
...
This commit just moves things around and patches import paths.
2019-11-27 05:06:01 -05:00
Deirdre Connolly
8a9a5ba29b
Revert "Add some simple proptests using the Arbitray trait on Requests and Responses, gated to test only"
...
This reverts commit 5a123acf56
.
2019-11-26 19:35:49 -05:00
Deirdre Connolly
6f52fc7773
Add 'Other' opcode matching when parsing Reject messages
2019-11-26 19:35:49 -05:00
Deirdre Connolly
dd042cf4d8
Add some simple proptests using the Arbitray trait on Requests and Responses, gated to test only
2019-11-26 19:35:49 -05:00
Deirdre Connolly
6168cb51d7
Prefixed currently unused error variable with underscore
2019-11-26 19:35:49 -05:00
Deirdre Connolly
d78ead4a1a
Removed unused trait import
2019-11-26 19:35:49 -05:00
Deirdre Connolly
b9c27e5683
Handle Response::Error and send Message::Reject generated from a PeerError::Rejected
2019-11-26 19:35:49 -05:00
Deirdre Connolly
f5f1fe9bbc
Handle incoming Reject messages when we expect a response
2019-11-26 19:35:49 -05:00
Deirdre Connolly
efd37300b9
Impl From trait for Responses from generic Error impls
...
Also include new Response::Error variant.
2019-11-26 19:35:49 -05:00
Deirdre Connolly
9cdef4acf0
Implement From trait for generic Error impls
...
Also add 'Other' RejectCode variant.
2019-11-26 19:35:49 -05:00
Deirdre Connolly
49c5265d41
Add Rejected variant to PeerError enum, for now
2019-11-26 19:35:49 -05:00
Deirdre Connolly
bae9347f6e
Rustfmt
2019-11-26 19:35:49 -05:00
Deirdre Connolly
ed77aaacd9
Read and write Reject messages
...
Also change field type to as it's unclear if it actually has
to match the set of enum variants we care about.
2019-11-26 19:35:49 -05:00
dependabot-preview[bot]
4cd185e2ab
Bump serde from 1.0.102 to 1.0.103
...
Bumps [serde](https://github.com/serde-rs/serde ) from 1.0.102 to 1.0.103.
- [Release notes](https://github.com/serde-rs/serde/releases )
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.102...v1.0.103 )
Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-11-24 19:56:15 -08:00
dependabot-preview[bot]
18b83c59c2
Bump chrono from 0.4.9 to 0.4.10
...
Bumps [chrono](https://github.com/chronotope/chrono ) from 0.4.9 to 0.4.10.
- [Release notes](https://github.com/chronotope/chrono/releases )
- [Changelog](https://github.com/chronotope/chrono/blob/master/CHANGELOG.md )
- [Commits](https://github.com/chronotope/chrono/compare/v0.4.9...v0.4.10 )
Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-11-24 15:18:53 -05:00
dependabot-preview[bot]
c26bdd262c
Bump pin-project from 0.4.5 to 0.4.6
...
Bumps [pin-project](https://github.com/taiki-e/pin-project ) from 0.4.5 to 0.4.6.
- [Release notes](https://github.com/taiki-e/pin-project/releases )
- [Changelog](https://github.com/taiki-e/pin-project/blob/master/CHANGELOG.md )
- [Commits](https://github.com/taiki-e/pin-project/compare/v0.4.5...v0.4.6 )
Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-11-20 14:03:40 -05:00
Henry de Valence
f00c16a624
Require that compactsize encodings are canonical.
2019-11-20 11:59:54 -05:00
Henry de Valence
68a6837cc1
Add a bytes round-trip test for compactsize encoding.
2019-11-20 11:59:54 -05:00
Henry de Valence
986b5ee46b
Fix overlapping range in compactsize encoding.
2019-11-20 11:59:54 -05:00
Henry de Valence
ca24aaf58e
Add the seed for the failing proptest case.
2019-11-20 11:59:54 -05:00
Henry de Valence
2b9991e4e7
Add a basic proptest for compactsize encodings.
...
There's a compiler warning about overlapping ranges so this test should catch the bug.
2019-11-20 11:59:54 -05:00
dependabot-preview[bot]
5b1db18a4b
Bump thiserror from 1.0.5 to 1.0.6
...
Bumps [thiserror](https://github.com/dtolnay/thiserror ) from 1.0.5 to 1.0.6.
- [Release notes](https://github.com/dtolnay/thiserror/releases )
- [Commits](https://github.com/dtolnay/thiserror/compare/1.0.5...1.0.6 )
Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-11-19 10:39:57 -08:00
Deirdre Connolly
189d89a7fc
Handle 'mempool' messages as 'GetMempool' requests
...
With a 'Transactions' response that gets turned into an 'Inv(Vec<InventoryHash::Tx>)' message.
We don't yet handle a response from our peer for a 'mempool', which will have to be
a more generic 'Inv' type because we might receive transaction hashes we don't know about yet.
Pertains to #26
2019-11-18 15:55:25 -05:00
Deirdre Connolly
98079c9d77
Support Mempool message
...
This does not yet push requests into services that actually respond with transaction
hashes in our node's mempool, which doesn't exist yet.
Pertains to #26
2019-11-18 15:55:25 -05:00
Henry de Valence
6d79352fb6
Remove nightly toolchain pin since async/await is stable.
2019-11-16 00:11:14 -05:00
Deirdre Connolly
9133b87771
Add copyright marks on each license
2019-11-14 11:50:49 -08:00
Deirdre Connolly
bc2a4218ea
Update README.md
...
Co-Authored-By: Henry de Valence <hdevalence@hdevalence.ca>
2019-11-14 14:33:40 -05:00
Deirdre Connolly
ae67344268
Add LICENSE-MIT and LICENSE-APACHE and note in README.md
...
Resolves #96
2019-11-14 14:33:40 -05:00
Henry de Valence
e63f8b51b1
Fix default port setting.
2019-11-13 18:47:44 -05:00
Henry de Valence
3b02b40758
Simplify tracing output.
2019-11-13 18:43:18 -05:00
Henry de Valence
ec4f6bd9ea
Allow using the connect stub to test address messages.
2019-11-13 18:43:18 -05:00
Henry de Valence
2ac77ab704
fmt
2019-11-13 18:43:18 -05:00
Henry de Valence
d170608c13
Remove outdated note.
...
The MetaAddr type is used not just in the Bitcoin code so it doesn't make sense
to keep it in the Bitcoin protocol implementation.
2019-11-13 18:43:18 -05:00
Henry de Valence
9a0bffecb8
Sanitize outbound address responses.
...
This aims to prevent a remote peer from inspecting timings of all messages
received by this node.
2019-11-13 18:43:18 -05:00