Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RFC 12 Implementation: On-chain proposal validation #756

Merged
merged 8 commits into from
Dec 5, 2023
Merged

Conversation

lukasz-zimnoch
Copy link
Member

@lukasz-zimnoch lukasz-zimnoch commented Dec 4, 2023

Refs: #737

Here we present the fifth part of the changes meant to implement RFC 12: Decentralized wallet coordination in the tBTC wallet client. This pull request focuses on the on-chain proposal validation, i.e. the WalletProposalValidator contract described in RFC 12.

The WalletProposalValidator contract

Here we introduce the read-only, non-upgradeable, WalletProposalValidator contract that allows validating wallet action proposals. This contract exposes three functions:

  • validateDepositSweepProposal that allows validating deposit sweep proposals. This function was ported from the WalletCoordinator contract.
  • validateRedemptionProposal that allows validating redemption proposals. This function was ported from the WalletCoordinator contract.
  • validateHeartbeatProposal that allows validating heartbeat proposals.

Remove WalletCoordinator contract

We are also removing the WalletCoordinator contract. It is no longer needed with the new RFC-12-based coordination mechanism. The relevant view validation functions were ported to the aforementioned WalletProposalValidator contract.
By the way, we are also adjusting the deployment scripts to reflect contract changes made in this PR.

Next steps

The next steps on the way towards RFC 12 implementation are:

  • Integrate WalletProposalValidator contract with the client and cleanup WalletCoordinator leftovers there
  • Modify the SPV maintainer to not rely on WalletCoordinator's events during unproven transactions lookup

Copy link

github-actions bot commented Dec 4, 2023

Solidity API documentation preview available in the artifacts of the https://github.com/keep-network/tbtc-v2/actions/runs/7089700942 check.

Here we introduce the contract that will expose view functions allowing
to validate wallet action proposals using a single ETH call. This mechanism
was specified in the RFC 12.

The `WalletProposalValidator` contract will pick those features from the
existing `WalletCoordinator` but will not expose any write functions and
will be non-upgradeable.

This changeset introduces deposit sweep validation.
Copy link

github-actions bot commented Dec 4, 2023

Solidity API documentation preview available in the artifacts of the https://github.com/keep-network/tbtc-v2/actions/runs/7089742686 check.

Copy link

github-actions bot commented Dec 5, 2023

Solidity API documentation preview available in the artifacts of the https://github.com/keep-network/tbtc-v2/actions/runs/7099888992 check.

Copy link

github-actions bot commented Dec 5, 2023

Solidity API documentation preview available in the artifacts of the https://github.com/keep-network/tbtc-v2/actions/runs/7100235287 check.

Copy link

github-actions bot commented Dec 5, 2023

Solidity API documentation preview available in the artifacts of the https://github.com/keep-network/tbtc-v2/actions/runs/7100889765 check.

Copy link

github-actions bot commented Dec 5, 2023

Solidity API documentation preview available in the artifacts of the https://github.com/keep-network/tbtc-v2/actions/runs/7100966887 check.

Copy link

github-actions bot commented Dec 5, 2023

Solidity API documentation preview available in the artifacts of the https://github.com/keep-network/tbtc-v2/actions/runs/7101571877 check.

Copy link

github-actions bot commented Dec 5, 2023

Solidity API documentation preview available in the artifacts of the https://github.com/keep-network/tbtc-v2/actions/runs/7101616534 check.

Copy link

github-actions bot commented Dec 5, 2023

Solidity API documentation preview available in the artifacts of the https://github.com/keep-network/tbtc-v2/actions/runs/7101638167 check.

@lukasz-zimnoch lukasz-zimnoch marked this pull request as ready for review December 5, 2023 13:53
Copy link

github-actions bot commented Dec 5, 2023

Solidity API documentation preview available in the artifacts of the https://github.com/keep-network/tbtc-v2/actions/runs/7101723880 check.

tomaszslabon added a commit to keep-network/keep-core that referenced this pull request Dec 7, 2023
…or and final cleanup (#3751)

Refs: keep-network/tbtc-v2#737

Here we present the sixth part of the changes meant to implement [RFC
12: Decentralized wallet
coordination](https://github.com/keep-network/tbtc-v2/blob/main/docs/rfc/rfc-12.adoc)
in the tBTC wallet client. This pull request focuses on integrating with
the new `WalletProposalValidator` contract introduced in
keep-network/tbtc-v2#756. It also aims to clean
up all leftovers related to the old mechanism based on the
`WalletCoordinator` contract.

### Use `WalletProposalValidator` for on-chain proposal validation

We re-generated contract bindings to leverage the new
WalletProposalValidator contract for on-chain proposal validation.
Incoming deposit sweep, redemption, and heartbeat proposals are now
validated against this contract, and we no longer use
`WalletCoordinator` for that purpose.

### Cleanup `WalletCoordinator` leftovers

We completely removed the `WalletCoordinator` contract from the mix. The
client no longer uses it in any way. This pull request's scope includes
all necessary code cleanup and adjustments.

### Adjust SPV maintainer

The SPV maintainer was using recent proposals submitted to the
`WalletCoordinator` contract to determine a list of wallets that must be
checked as part of the SPV proof submission process. As
`WalletCoordinator` is no longer used, we modified that behavior. The
SPV maintainer now examines recent deposit revealed and redemption
requested events to build a list of wallets that likely have unproven
transactions.

### Adjust maintainer deployment manifests

As wallet coordination was removed from the Keep maintainer bot, we
adjusted Kubernetes manifests that are used to deploy the maintainer on
production and test clusters. Now, only SPV and Bitcoin difficulty
modules are in use.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⛓️ solidity Solidity contracts
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants