-
Notifications
You must be signed in to change notification settings - Fork 273
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
Use of TACoChildApplicationAgent for staking information and accommodate syncing issues between Root and Child #3237
Conversation
Codecov Report
@@ Coverage Diff @@
## development #3237 +/- ##
===============================================
+ Coverage 80.28% 80.38% +0.10%
===============================================
Files 112 113 +1
Lines 11253 11300 +47
===============================================
+ Hits 9034 9084 +50
+ Misses 2219 2216 -3
Flags with carried forward coverage won't be shown. Click here to find out more.
|
c4d2ff4
to
66d0f54
Compare
66d0f54
to
4ff674e
Compare
c21f6bc
to
de6f2ec
Compare
else "" | ||
) | ||
emitter.message( | ||
f"! Bonded staking provider address {truncate_checksum_address(taco_root_bonded_address)} on {taco_root_pretty_chain_name} not yet synced to child application on {taco_child_pretty_chain_name} {child_bonded_address_info}; waiting for sync", |
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.
love this 🚀
@@ -10,6 +10,7 @@ | |||
STAKING_ESCROW_STUB_CONTRACT_NAME = "StakingEscrowStub" | |||
ADJUDICATOR_CONTRACT_NAME = "Adjudicator" | |||
TACO_APPLICATION_CONTRACT_NAME = "TACoApplication" | |||
TACO_CHILD_APPLICATION_CONTRACT_NAME = "TACoChildApplication" |
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.
This PR is looking good overall! I do have one comment related to this line: To avoid needing to change this line depending on whether or not a node is running on testnet vs mainnet, I assert that we always use this contract name in the registry, which is the historical convention anyways.
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.
👍 I agree with that assertion. We'll need to modify some logic when deploying to lynx as part of the work for nucypher/nucypher-contracts#119
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.
I suppose even for Lynx still will be TACoChildApplication
abi, right?
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.
Yes, the ABI is the same, but we need to do some magic when generating the lynx registry since the contract names for root and child application contracts are different - https://github.com/derekpierre/nucypher-contracts/blob/lynx-deployment/contracts/contracts/testnet/LynxSet.sol.
…t contract function can only be called from the TACo child contract.
…ly determine the state of operator bonding on startup.
…ew logic to check bonding for cli tests.
…kingProviderInfo should be localized to TACoApplicationAgent which is the only user of it.
… for non-existent staking provider.
…hild application for respective bonded addresses.
…r bonding tracking.
de6f2ec
to
ea9b350
Compare
An assumption I'm making:
I assume the canonical spot for this information is indeed TACo root and NOT the child. Both are set on the root application, which subsequently updates the child application, so presumably, the root is the best place for that information. So I've left the above functions unchanged, i.e. they continue to use the cc @vicky.z , @dnunez |
Given that nodes are not permitted to start up without bonding state being synchronized with the child, this is a fair assumption. In this case, we want a node to become invalid as soon as it's unbonded, correct (no need to await state sync for unbonding)? We don't want to sample unqualified nodes after all, even before the unbonding state is bridged. Side question, does deauthorization of the TACo application on the staking-side result in a forced unbonding? |
👍 . Same thing for our
Looks that way - https://github.com/nucypher/nucypher-contracts/blob/main/contracts/contracts/TACoApplication.sol#L445. |
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.
In general I'd say that additional 30-60 minutes before getting synchronized info to child - for me would be ok, that can simplify things a lot. But yeah most fast way to get new information - read from both sides of bridge
Fix ruff type checking issue.
Type of PR:
Required reviews:
What this does:
Issues fixed/closed:
Closes #3235 .
Why it's needed:
Notes for reviewers: