Tezlink: remove tezlink impl record
What
Refacto to remove circular dependencies, and move as much as possible to the lib_dev/tezlink library.
depends on !17701 (merged)
Why
We want to isolate tezlink stuff depending on imports from the protocol (so types and services).
How
We can't have everything defined in Tezos_services. So types that are necessary in the backend need to be defined in Tezos_types, and Tezos_services needs to be removed from the dependencies of the service implementations.
We define a Tezlink_imports module that will be the top most dependency. It's should only contains import declaration and should be the only place where the protocol is mentionned.
Then we define a Tezlink_backend_sig and use the existing implementations to construct one in the Service_backend_sig.S. This allows us to cut dependencies between Tezos_service and the rest of the lib_dev. We can then move tezlink stuff in lib_dev/tezlink. We're left with the backend implementation in lib_dev next to the other backend implementations.
Alternatives:
- we could create a library declaring
Durable_storage.READER, and have bothlib_devandtezlinkdepend from it, which would allow us to move the backend implementation inTezlink. This would mean having backends defined inlib_devand intezlinkthough, and create a small library for stuff used in both (mostlyDurable_storageandDurable_storage_pathI think ?). - we could split
Tezos_servicebetween components that needEvm_directoryandService_backend_sig.S(namely, the final functions in charge of registering the services,build_dirand such). That would require making the services and their types public, or providing individual functions to register each services, intezlink. It doesn't prevent us from having from inserting our own module inService_backend_sig.Sin the end (see balance !17653 (merged)) so not sure what we gain. It would also mean that registering a service means importing it intezlink, creating a registering function intezlink, creating a backend inlib_dev, registering inlib_dev. AndTezos_servicesignature would be heavier, and verbose, complicating maintenance (and adding new stuff).
Manually testing the MR
It's refactoring, so green CI should be enough.
Checklist
-
Document the interface of any function added or modified (see the coding guidelines) -
Document any change to the user interface, including configuration parameters (see node configuration) -
Provide automatic testing (see the testing guide). -
For new features and bug fixes, add an item in the appropriate changelog ( docs/protocols/alpha.rstfor the protocol and the environment,CHANGES.rstat the root of the repository for everything else). -
Select suitable reviewers using the Reviewersfield below. -
Select as Assigneethe next person who should take action on that MR