-
Notifications
You must be signed in to change notification settings - Fork 0
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
Cross chain restaking system #18
Draft
drewstone
wants to merge
18
commits into
main
Choose a base branch
from
xc-restaking
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…ng and synthetic restake asset.
drewstone
force-pushed
the
xc-restaking
branch
from
December 1, 2024 05:56
4631c52
to
c100ca8
Compare
Todos:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
This adds a cross chain restaking system for Tangle.
Asset depositing and delegation flow
Adapters
, such asHyperlaneAdapter
orRouterAdapter
or another bridge adapter eventually. This event containsICrossChainDepositMessage.AssetMessage
.CrossChainAssetVault
which processes theAssetMessage
. The protocol for handling is to mint aSyntheticRestakeAsset
which contains metadata about the asset locked on the remote chain. It acts like a soulbound ERC20 (it doesn't ever leave theCrossChainAssetVault
, it simply changes owners).CrossChainAssetVault
implements theAssetDelegationBase
which allows the vault to interact with theMultiAssetDelegation
precompile, the foundational precompile for interacting with the runtime's restaking infrastructure.Slashing and Blueprint development flow
The reason for cross-chain functionality is allowing any asset to restake on operators and in turn blueprints. The cross-chain information relevant for Blueprints is many fold. We need to deal with slashing, rewards, job results, and maybe even more.
XCBlueprintServiceManager
is a cross-chain enabled Blueprint. The idea is to relay the calls for slashing, rewards, and job results to remote chains. This contract uses theCrossChainBridgeManager
to dispatch messages to remote chains. The bridge stores bridges which each have an implemented messsenger usingICrossChainMessenger
interface.BlueprintReceiver
contracts, notablyHyperlaneBlueprintReceiver
andRouterBlueprintReceiver
contracts which receive the messages containing information about slashes, rewards, and job results. Each contract implementsBaseBlueprintReceiver
which handles cross-chain messages in a standard format so we don't have to care which bridge is used. The intention is that a user who uses Hyperlane to bridge their data should receive notifications of slashes/rewards over Hyperlane too.BlueprintReceiver
contracts actually trigger the slash handler on theRemoteAssetVault
(this hasn't been created yet).Interacting with the precompile on Tangle
AssetDelegationBase
is the contract we will want to standardize as a way for contracts with assets to interact with the delegation system. This should be our way for LRTs to integrate with Tangle, simply implement this contract system. CC @1xstjDiagram