cartesi / rollups

Cartesi Rollups
30 stars 12 forks source link

Extinguish `ConsensusCreated` emitted by `Authority` #155

Closed guidanoli closed 1 year ago

guidanoli commented 1 year ago

📚 Context

As soon as one deploys an Authority contract, it emits an event called ConsensusCreated which contains the following parameters:

We argue that the ConsensusCreated event can be extinguished by showing that each parameter can already be retrieved in another way, or doesn't capture well how the Authority works in practice.

✔️ Solution

We may remove the ConsensusCreated event from the Authority contract. We need to make sure this is not a breaking change for the off-chain.

As a result, the IInputBox argument passed to the constructor of the Authority contract can be removed. This change will have cascading effects in cartesi/rollups#64, cartesi/rollups#99, and cartesi/rollups#85.

📈 Subtasks

gligneul commented 1 year ago

I couldn't find any mention of ConsensusCreated in the node code. So I believe we don't use it.

guidanoli commented 1 year ago

I couldn't find any mention of ConsensusCreated in the node code. So I believe we don't use it.

Great news, then! :-)

xdaniortega commented 1 year ago

I've one concern about removing it. How can dApp will known which Consensus exists? I thought that with this event we can manage to know when a Consensus is created. What are the options for a dApp to subscribe or change consensus? it should've some way to know the existing ones.

tuler commented 1 year ago

How can dApp will known which Consensus exists?

Through a factory.

xdaniortega commented 1 year ago

How can dApp will known which Consensus exists?

Through a factory.

Seems to be a good approach. We have to define this new feature and the set of contracts before removing all the information related with the creation of a new consenus, right? Or just have something decided to cover this.

guidanoli commented 1 year ago

Seems to be a good approach. We have to define this new feature and the set of contracts before removing all the information related with the creation of a new consenus, right? Or just have something decided to cover this.

This feature is defined by cartesi/rollups-contracts#25 and implemented by cartesi/rollups#64. As explained here, by removing this event, we don't lose any information, even if the contract is deployed by an EOA.