-
Notifications
You must be signed in to change notification settings - Fork 18
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
Add Authorization-related events to the IApplication interface #88
Comments
To be honest, I am happy they are so close to each other because we haven't looked at PRE repo when implementing this code 😆 tBTC (ECDSA) and Random Beacon has a concept of an operator address that is running the node and the operator is automatically updating sortition pool state, that's why we included indexed operator address in the event. I thought PRE also has a concept of an operator (worker)? |
We should add also a |
@pdyraga How can generalize this for all Threshold apps? I don't think it's fully established that the role of operator is general; even though both tBTC and PRE have an operator, it may be the case in the future that some new app has 0 or more than 1 operators. Also, from the point of view of what an authorization is and what it entails, the operator role doesn't seem relevant. Since |
Current divergences:
Other suggested additions:
|
I agree adding |
After thinking more about it, and even doing some experiments if the code, I think we should leave it as-is and don't care about what events are emitted by applications at all. Dashboard, subgraphs, and other tools should work with We have these events in the staking contract: solidity-contracts/contracts/staking/TokenStaking.sol Lines 130 to 154 in 4726890
If the staking contract says the authorization was increased for the application, it does not matter what the application says. The application may confirm by event that the internal state was indeed updated but I think we should not try to find a general semantic for that. Every application will handle it differently. One application may update the state immediately, and another may need to wait for some other conditions to switch (e.g. beacon waits for the sortition pool to be unlocked in case group creation is in progress). If the staking contract says the authorization decrease was approved, we are sure this is true because it's the staking contract state that just got updated. For every correctly functioning application, application-specific approval event would be emitted in the same transaction as The same logic applies to All these events do not have the operator or any other application-specific fields and they all expose In this model, staking contract is the only source of truth. And I think it makes sense because we are sure that what is in the staking contract is right. Even if a malfunctioning application says something else in the events it is emitting. What do you think @cygnusv? |
Generally I agree with using |
But for this use case we still can use |
True, but still possible desynchronization where events in apps can help. |
Now that there are drafts for real application contracts for Threshold, I just realized we never standardized some application-specific stuff like events for authorization operations. As an example, see the parallel evolution of
AuthorizationIncreased
in the PRE and tBTC app contracts, respectively:(https://github.com/nucypher/nucypher/pull/2834/files#diff-a0f8e2c70e7a79b504a33807c59291816a3e3ed820aa1d195f79e500da6c861fR51)
vs.
(https://github.com/keep-network/keep-core/blob/main/solidity/ecdsa/contracts/WalletRegistry.sol#L184)
This can be problematic from interoperability and integrations point of view, particularly for the Threshold dashboard (cc @Battenfield ). As a solution, we need to find what's common on both implementations (considering also potential future application contracts), and add these events to the
IApplication
interface.The text was updated successfully, but these errors were encountered: