Here we present the fourth part of the changes meant to implement RFC 12: Decentralized wallet coordination in the tBTC wallet client. This pull request focuses on the coordination result processing.
Result processor
Here we implement the processCoordinationResult function that receives coordination results, detects the proposal type, and triggers the appropriate proposal handler exposed by the node component. This function also sets up the proposal processing start block (i.e. coordination window end block) and the proposal expiry block.
Detach WalletCoordinator event handlers
Due to the above changes, from now on, the node component fires wallet actions based on incoming coordination results. The node component no longer listens for events coming from the WalletCoordinator contract. We are taking the opportunity and remove those handlers along with the auxiliary code (e.g. events deduplication).
Next steps
The next steps on the way towards RFC 12 implementation are:
Write WalletProposalValidator contract and integrate it with the client
Cleanup WalletCoordinator leftovers in the client
Modify the SPV maintainter to not rely on WalletCoordinator's events during unproven transactions lookup
Refs: https://github.com/keep-network/tbtc-v2/issues/737 Depends on: https://github.com/keep-network/keep-core/pull/3747
Here we present the fourth part of the changes meant to implement RFC 12: Decentralized wallet coordination in the tBTC wallet client. This pull request focuses on the coordination result processing.
Result processor
Here we implement the
processCoordinationResult
function that receives coordination results, detects the proposal type, and triggers the appropriate proposal handler exposed by thenode
component. This function also sets up the proposal processing start block (i.e. coordination window end block) and the proposal expiry block.Detach
WalletCoordinator
event handlersDue to the above changes, from now on, the
node
component fires wallet actions based on incoming coordination results. Thenode
component no longer listens for events coming from theWalletCoordinator
contract. We are taking the opportunity and remove those handlers along with the auxiliary code (e.g. events deduplication).Next steps
The next steps on the way towards RFC 12 implementation are:
WalletProposalValidator
contract and integrate it with the clientWalletCoordinator
leftovers in the clientWalletCoordinator
's events during unproven transactions lookup