zebra/zebra-chain/src/serialization
teor 1a57023eac
Security: Use canonical SocketAddrs to avoid duplicate peer connections, Feature: Send local listener to peers (#2276)
* Always send our local listener with the latest time

Previously, whenever there was an inbound request for peers, we would
clone the address book and update it with the local listener.

This had two impacts:
- the listener could conflict with an existing entry,
  rather than unconditionally replacing it, and
- the listener was briefly included in the address book metrics.

As a side-effect, this change also makes sanitization slightly faster,
because it avoids some useless peer filtering and sorting.

* Skip listeners that are not valid for outbound connections

* Filter sanitized addresses Zebra based on address state

This fix correctly prevents Zebra gossiping client addresses to peers,
but still keeps the client in the address book to avoid reconnections.

* Add a full set of DateTime32 and Duration32 calculation methods

* Refactor sanitize to use the new DateTime32/Duration32 methods

* Security: Use canonical SocketAddrs to avoid duplicate connections

If we allow multiple variants for each peer address, we can make multiple
connections to that peer.

Also make sure sanitized MetaAddrs are valid for outbound connections.

* Test that address books contain the local listener address

Co-authored-by: Janito Vaqueiro Ferreira Filho <janito.vff@gmail.com>
2021-06-22 02:16:59 +00:00
..
tests Orchard data in V5 parsing (#2116) 2021-05-21 00:42:06 +00:00
arbitrary.rs Security: Use canonical SocketAddrs to avoid duplicate peer connections, Feature: Send local listener to peers (#2276) 2021-06-22 02:16:59 +00:00
constraint.rs Further test new transaction consensus rules (#2246) 2021-06-07 12:02:18 +10:00
date_time.rs Security: Use canonical SocketAddrs to avoid duplicate peer connections, Feature: Send local listener to peers (#2276) 2021-06-22 02:16:59 +00:00
error.rs Move the check in `transaction::check::sapling_balances_match` to `V4` deserialization (#2234) 2021-06-04 08:53:00 +10:00
read_zcash.rs Security: Use canonical SocketAddrs to avoid duplicate peer connections, Feature: Send local listener to peers (#2276) 2021-06-22 02:16:59 +00:00
serde_helpers.rs Rebase tidies 2021-04-30 00:48:23 -04:00
sha256d.rs
tests.rs Orchard data in V5 parsing (#2116) 2021-05-21 00:42:06 +00:00
write_zcash.rs Security: reject compact sizes greater than the protocol message limit (#2155) 2021-05-17 18:23:06 -04:00
zcash_deserialize.rs Redesign Sapling data model for V5 shared anchor and spends (#2021) 2021-04-20 16:22:25 +10:00
zcash_serialize.rs Clippy: remove needless borrows 2021-06-07 18:33:58 -04:00