Closed wischli closed 3 weeks ago
Just a NIT thought. Seems like an entity called forwarder is not the entity in charge of serializing / deserializing, could be weird to find those methods here? π€
Could make sense a super thing wrapper as a type runtime that makes that serialization?
// To send
gateway -> forwarder -> serializer -> router-dispatcher -> router
// To receive
router -> serializer -> forwarder -> gateway
The serializer could be just a MessageSerializer
implementing MessageSender
and MessageReceiver
type who calls msg.serialize() and deserialize().
Just a thought, and maybe being a paranoic organizer π
Just a NIT thought. Seems like an entity called forwarder is not the entity in charge of serializing / deserializing, could be weird to find those methods here? π€
Could make sense a super thing wrapper as a type runtime that makes that serialization?
// To send gateway -> forwarder -> serializer -> router-dispatcher -> router // To receive router -> serializer -> forwarder -> gateway
The serializer could be just a
MessageSerializer
implementingMessageSender
andMessageReceiver
type who calls msg.serialize() and deserialize().Just a thought, and maybe being a paranoic organizer π
I agree that your proposal would be the preferred design. Will look into it later after finishing the mandatory tasks for this feature.
Great! but please, it is not mandatory at all for Monday ππ»
Great! but please, it is not mandatory at all for Monday ππ»
Much cleaner now: b39fa47
Only a couple of minor nits, I'm happy we got to slay this one as well, thank you @wischli!
Attention: Patch coverage is 56.00000%
with 33 lines
in your changes missing coverage. Please review.
Project coverage is 49.01%. Comparing base (
03262c5
) to head (5cf3752
).
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Thanks @wischli for bringing this super PR along with documentation chains so fast!! π I really like the result.
Just few NITs, some questions, and just one think that I would simplify about mocking the Message in both pallets.
But the code looks super great! Thanks
Absolutely agree! Sorry I didn't initiate like that but prio was to get it done. If you think, you can still fit something in, great, but entirely optional. Whatever we change might have to be updated/added to the docs.
Description
Adds feature to handle forwarding inbound and outbound messages
pallet-liquidity-pools-forwarder
which implementsMessageReceiver
andMessageSender
MessageSerializer
which acts as entity to serialize and deserialze all incoming and outgoing messagesrouter
mockreceive_message
from Gateway since this was only used by the axelar routerIn order to set up forwarding for some
Domain::Evm(123)
pallet-liquidity-pools-forwarder
storageRouterForwarding
: Store thesource_domain
and forwarding contract address for somerouter_id
pallet-liquidity-pools-gateway
storageAllowlist
: Store the(source_domain, DomainAddress::Evm(source_somain, forwarding_contract_address)
Sending messages
Before this PR
After this PR
Receiving messages
Before this PR*
After this PR
TODO
RefactorMessageEntry
andInboundEntry
to useDomain
instead ofDomainAddress
Domain
andSerializableDomain
ATs ofLpMessage
MessageSerializer
Checklist: