Channel padding
This is the implementation of channel padding. The branch is rather large, but doing it all in one go like this has enabled me to see where things were going and adjust earlier parts of the work to suit.
The structure is as follows:
- Cleanups for things that wanted fixing beforehand:
arti-client: TorClient constructor: add a blank line
tor-proto: padding::Parameters: use impl_standard_builder
channel: Centralise Channel::send_control
chanmgr: tests: Introsuce new_test_abstract_chanmgr
chanmgr: tests: Introduce new_test_channel_map
- Documentaation comment with the overall plan
channel padding: Add doc commentary with the channel padding plan
- Improvements and additions to supporting code
chancell: PaddingNegotiate: Make Eq
chancell: PaddingNegotiate: Provide two constructors, not one
chancell: Introduce PaddingNegotiateCmd
chancell: PaddingNegotiate: Provide start_default and a Default impl
tor-proto: padding::Parameters: Provide default_reduced constructor
tor-proto: padding::Parameters::padding_negotiate_cell
tor-proto: padding::Parameters: Provide all_zeroes
channel params: Rename initial_update (from total_update)
channel params: Add a missing comma.
channel params: ChannelsParamssUpdates: provide combine()
- Preparatory refactoring in tor-chanmgr and its callers
chanmgr: reconfigure_general: Rename fn and change types
dormancy: tor-client: Break initial dormancy out into a variable
dormancy: Plumb through to chanmgr reconfigure_general
channel reparameterize: Change error type
chanmgr: Introduce get_or_launch_internal
Provide ChannelUsage and plumb it all the way down
- Provide configuration, and relate it to channel usage
channel: Provide somewhere for the frontend's mutable state
tor-config: Introduce ReconfigureError::Bug
tor-config: Introduce PaddingLevel
Introduce ChannelConfig
channel: Introduce padding config
channel: Use channel usage to control channel padding
chanmgr, testing: Provide config accessor for testing
arti-client: Prepare TorClientConfig::build for intervention
arti-client: Honour top-level `padding` key
- Properly compute padding parameters and send negotiation cells
chanmgr: Introduce NetDirExtract
chanmgr: Postpone padding parameters computation
chanmgr: Break out padding_parameters fn
chanmgr padding: Fix low vs high comparison
chanmgr padding: Support reduced and disabled padding (prep)
chanmgr configuration: Hadle lack of a NetDir
chanmgr configuration: Break out parameterize
chanmgr configuration: Initialise correctly
chanmgr configuration: Avoid sending needless initial update(s)
channel padding: Send padding iff required
tor-proto channel: Make arrangements to send PADDING_NEGOTIATE
channel padding: Send negotiation cells
- Preparatory support for new tests
tor-netdoc: NetParams: impl FromIterator
tor-netdir, testnet: Provide construct_custom_netdir_with_params
tor-cell, testing: Provide PaddingNegotiate::from_raw
tor-proto: Make "testing" feature that exports some things
tor-proto, testing: Make fake_channel_details available
tor-proto, testing: Provide new_fake_channel
tor-proto, testing: Provide accessors for ChannelsParamsUpdates
chanmgr testing: FakeChannel: retain the ChannelsParamsUpdates
- New top-to-bottom tests, to check the layers DTRT together
channel padding: Test through most of the layers
- A cleanup rename
channel channel padding: Rename low_ms and high_ms
Edited by Ian Jackson