-
Notifications
You must be signed in to change notification settings - Fork 26
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
Bonding manager MVP #316
Bonding manager MVP #316
Conversation
Codecov ReportBase: 33.69382% // Head: 33.81478% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## master #316 +/- ##
===================================================
+ Coverage 33.69382% 33.81478% +0.12095%
===================================================
Files 418 423 +5
Lines 42073 42026 -47
Branches 158 174 +16
===================================================
+ Hits 14176 14211 +35
+ Misses 26128 26046 -82
Partials 1769 1769
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
Left to do:
Good for review otherwise. |
Will reopen once a proper mvp for syncing between BondingPrimary and BondingSecondary is implemented |
Updated the PR description. The solidity part of the PR should be finished, awaiting the Go changes. |
For the time being, the |
This pull request has been deployed to Vercel.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks ready to me.
Description
MVP for Bonding Manager: a contract, that is supposed to keep track of all bonded actors.
BondingManager
will have two types of deployments:BondingPrimary
: to be deployed on Synapse Chain. This is where Notaries and Guards are supposed to stake/unstake their bonds. Open question: merge withAttestationCollector
?BondingSecondary
: to be deployed on chains other than Synapse Chain.Keeps track of active Notaries and Guards, relevant to the chain where the contract is deployed.Doesn't keep track of any agents, but rather enables communication between local contracts andBondingPrimary
to keep them in sync.Changes
NotaryManager
is deprecated.BondingManager
. The parent contract forBondingPrimary
andBondingSecondary
: everything they have in common.BondingPrimary
. To be deployed on Synapse Chain, agents are staking and unstaking their bonds there, the information is then passed toBondingSecondary
on other chains (actual forwarding of data is out of scope of this PR).BondingSecondary
. To be deployed on chains other than Synapse Chain. Forwards updates about agents betweenBondingPrimary
and system registries (system contracts tracking the agents).SystemRegistry
. It keeps track of the required agents (guards/notaries), which are added or removed by receiving a system call from a localBondingManager
.AgentInfo
. Allows to unify bond/unbond Guard/Notary into a single functionsyncAgents
.sanguine/packages/contracts-core/contracts/system/SystemContract.sol
Lines 15 to 33 in ee56e10
slashAgent
. To be used for forwarding information, that an agent has been slashed.sanguine/packages/contracts-core/contracts/system/SystemContract.sol
Lines 175 to 187 in ee56e10
syncAgents
. To be used for forwarding information about agents staking/unstaking their bond.sanguine/packages/contracts-core/contracts/system/SystemContract.sol
Lines 189 to 205 in ee56e10
Actors workflow
Bonding
BondingPrimary
(in the MVP version there would be no actual token staking involved for simplicity, just a record in storage).BondingPrimary
forwards this information toBondingSecondary
on other chains (ping).BondingSecondary
informs local system contracts (Origin, Destination) that a new actor is active (eventually, with some kind of delay).BondingSecondary
informsBondingPrimary
that new actor was added successfully (pong).BondingPrimary
, the actor is considered active.Unbonding
BondingPrimary
.BondingPrimary
forwards this information toBondingSecondary
on other chains (ping).BondingSecondary
informs local system contracts (Origin, Destination) that the actor is no longer active.BondingSecondary
informsBondingPrimary
that new actor was removed successfully (pong).BondingPrimary
, actor is removed everywhere, and their bond is available for unstaking (eventually, with some kind of delay to make sure the unstaking actor could be reported for fraud in time).Slashing
Origin
by presenting a verifiable proof of their fraud.Origin
informs a localBondingSecondary
that the actor has been slashed.BondingSecondary
notifies the remaining local contracts about the slashed actor.BondingSecondary
notifiesBondingPrimary
about the slashed actor (this step is skipped if actor is slashed on SynChain).BondingPrimary
marks actor's bond as slashed, and notifiesBondingSecondary
on the remaining chains about the slashed actors.BondingSecondary
contracts notify local system contract about the slashed actor.Metadata