Skip to content

Add (skeleton) ArtiLocalNodeController and ArtiLocalNodeBuilder

This is part of arti#1683.

The idea is to add a place where we can start adding arti implementations of the various functionality that is currently c-tor-specific.

I think adding ArtiLocalNodeController and ArtiLocalNodeBuilder classes that implement the current (intended-to-be)-abstract base classes NodeBuilder and NodeController seems like a fairly sensible approach.

It's a little weird in that the only current implementations of these base classes are LocalNodeController and LocalNodeBuilder, implying possible future implementations along the lines of RemoteNode*, which could indeed be useful; meanwhile adding arti here adds an extra "dimension" so that we could later end up with e.g. 4 implementations of each: [Arti|Tor][Local|Remote]Node*. I think in practice that might actually be what we want, though, since the implementations of the base classes will indeed look substantially different for all 4 variants. If and when we do add Remote variants we can also put code that would be common between Local and Remote into some utility function, mixin, intermediate base class, etc.

The intended plan and scope of this issue is roughly:

  • Turn NodeBuilder and NodeController into true PEP 3119 abstract base classes for clarity and better static type checking. !48 (merged)
  • Have Node.getBuilder return a NodeBuilder instead of a LocalNodeBuilder. For type-checking to pass, this requires not calling LocalNodeBuilder methods that don't also exist on NodeBuilder. !47 (merged)
  • Have Node.getController return a NodeController instead of a LocalNodeController. Similar to above. !49 (merged)
  • Move LocalNodeController, LocalNodeBuilder, and other tor-specific code from chutney.TorNet to a a new subpackage chutney.tor. chutney.TorNet is already large enough to warrant splitting up, and we want to establish a pattern such that the new arti-specific code will likewise go in a new subpackage instead of into chutney.TorNet. !51 (merged)
  • Add ArtiNodeController and ArtiNodeBuilder classes, with implementations for all of the abstract methods on the base classes NodeBuilder and NodeController. (More methods will have been added while cleaning up other code to not assume these objects are actually Local*). Within the scope of this issue, these implementations may just raise NotImplemented exceptions. !55 (merged)
  • Add a use-arti node configuration flag. When set, a Node creates the Arti* variants of NodeBuilder and NodeController !55 (merged)
Edited by Jim Newsome
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information