You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The contracts instantiation logic is somewhat convoluted right now, in that the babylon-contract instantiates both the staking and finality contracts. This requires some back and forth messages between contracts, so that they know their addresses and can communicate.
Contracts dependencies / references details:
babylon-contract has to know both, staking and finality address, to properly route IBC messages to them.
btc-staking has to know the babylon-contract address, to validate that some privileged messages come from it. It also needs it to (in the future) query / mirror the BTC headers / tip information.
btc-finality needs to know both, the babylon address, to forward the slashing message, and to validate that privileged messages come from it. And the staking address, for membership / voting power queries.
Refactor this into a SDK instantiation, in which the SDK instantiates each of the contracts independently. The address of the other contracts can then be passed as instantiation params.
Proposed instantiation sequence:
Instantiate the babylon contract.
Instantiate the staking contract, passing the address of the babylon contract.
Instantiate the finality contract, passing the address of both the babylon and staking contracts.
Needless to say, this has to be done in conjunction with contract modifications.
Also, this will impact not only the SDK, but e2e tests in which the current instantiation logic is being used / relied upon.
Also, as part of this, or in a follow-up, the SDK can provide a convenience query endpoint that reports the addresses of the different contracts.
tgrade reference / example for the poe-contracts query:
The contracts instantiation logic is somewhat convoluted right now, in that the
babylon-contract
instantiates both the staking and finality contracts. This requires some back and forth messages between contracts, so that they know their addresses and can communicate.Contracts dependencies / references details:
babylon-contract
has to know both, staking and finality address, to properly route IBC messages to them.btc-staking
has to know thebabylon-contract
address, to validate that some privileged messages come from it. It also needs it to (in the future) query / mirror the BTC headers / tip information.btc-finality
needs to know both, the babylon address, to forward the slashing message, and to validate that privileged messages come from it. And the staking address, for membership / voting power queries.Refactor this into a SDK instantiation, in which the SDK instantiates each of the contracts independently. The address of the other contracts can then be passed as instantiation params.
Proposed instantiation sequence:
Needless to say, this has to be done in conjunction with contract modifications.
Also, this will impact not only the SDK, but e2e tests in which the current instantiation logic is being used / relied upon.
Also, as part of this, or in a follow-up, the SDK can provide a convenience query endpoint that reports the addresses of the different contracts.
tgrade reference / example for the
poe-contracts
query:https://github.com/confio/tgrade/blob/1bc8463f3760bf9549389a02a9e48eda482a59fe/x/poe/client/cli/query.go#L42
The text was updated successfully, but these errors were encountered: