Skip to content

🛠️ [TASK] : Remove unnecessary tokio dependency from Pallas when not doing any IO #463

@stevenj

Description

@stevenj

Summary

Fork Pallas and remove a dependency on tokio for types which are not performing IO.

Description

Pallas defines types and constants (such as Point) in the pallas-network crate.
This creates a direct and impossible to break dependency on tokio, which then makes the code unusable in WASM.
The fix here is to:

  1. Update our fork in https://github.com/input-output-hk/catalyst-pallas with latest upstream pallas code, (if it is not already).
  2. Create a feat/pallas-network-types branch
  3. In that branch move the Point type, and other constants from pallas-network/src/miniprotocols/common.rs into the palls-primitives crate.
  4. Recommended approach is to make a point.rs which has the point type, and a network-constants.rs which has all the constants.
  5. Alias the Point in the original pallas-network crate to point to the moved Point in pallas-primitives, and use the constants from the new network-constants.rs file to set the original constant values. (This should mean that there are no breaking changes because using the type from pallas-network can still work, but the true source is in pallas-primitives. However any use of Point or these constants within pallas should be changed to use the new definitions in pallas-primitives so that there is no unnecessary dependency on pallas-network.
  6. Ensure that the aliases are properly marked with #[deprecated] as they should not be the preferred place to use the type. Make sure to define a proper note in the deprecation advising where the type or constant should now be imported from.
  7. Update our libraries to use our fork, and this branch, and use Point from the new location.
  8. Ensure that the change is all thats required to prevent pallas-network needing to be used to compile our code to WASM.
  9. If it is not, keep extracting types and constants as described above until it is clean.
  10. Once we are sure everything builds OK, push a PR back to tx-pipe/palls upstream repo with this change.Note, this partially satisfies: De-dupe duplicated primitives structs from pallas-network (by switching to generics) txpipe/pallas#620
    Also See: https://github.com/txpipe/pallas/blob/6c1e0868e1d128733cf6bdb1638edb5915a00ab7/pallas-hardano/src/storage/immutable/mod.rs#L15 This comment should be cleaned up when the type is moved.

Metadata

Metadata

Assignees

Labels

fyi: gatekeepersFor information - Catalyst App Backend, System Development & Integration Teamfyi: hermeticsFor information - Hermes Backend, System Development & Integration TeamhermesTask could/should be picked up as work on Hermes.p: highThe issue or pull request is high priority and needs to be addressed soonrefactorCode refactoring taskrr: architectureRequired review - Architecture team must approve before mergerr: gatekeepersRequired review by gatekeepers teamsquad: hermeticsHermes Backend, System Development & Integration Team

Type

Projects

Status

New

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions