cartesi / rollups-contracts

Smart Contracts for Cartesi Rollups
https://cartesi.github.io/rollups-contracts/
Apache License 2.0
18 stars 38 forks source link

Improve `IConsensus` for node developers #152

Closed guidanoli closed 8 months ago

guidanoli commented 9 months ago

📚 Context

Currently, the node only knows how to control Authority contracts, but not any contract that implements the IConsensus interface.

Furthermore, the node calls the getClaim function to check if a claim has been submitted yet. This method, however, is unstable, because the error message depends on the Ethereum node implementation.

Finally, the consensus contract does not emit any event when a claim is submitted successfully. This, again, makes it harder for the node to keep track of which claims have been submitted already.

We should, therefore, improve the IConsensus interface with node developers in mind.

✔️ Solution

After discussing with @gligneul, @pedroargento and @torives, we agreed that the IConsensus interface should:

As a result, we may remove the following contracts:

We can define a contract that deals with claim storage and make Authority (and Quorum in the future) inherit it. We can name it ClaimStorage. Other names are welcome!