interlock-network / interlock-smartcontracts-solidity

Solidity smartcontracts for Interlock Network
MIT License
0 stars 1 forks source link

Interface: add ARB ILOCK reward functionality to `blockchain_interface` API #2

Open blairmunroakusa opened 6 months ago

blairmunroakusa commented 6 months ago

Pattern for ARB, the AZ ILOCK reward functionality established in blockchain_interface.

blairmunroakusa commented 6 months ago

I am unsure as to whether or not the substrate interface should be the same as the evm interface. From the blockchain_interface perspective, it would be simpler, I believe. For one, it would make error handling easier simpler. The job of the interface is not to interpret errors, so it should pass errors on directly to galactus. However, the errors are very different between evm and substrate chains: there is no immediately obvious way to 'generalize', then pass that generalized error type along from a single interface.

Thinking in terms of scaling to more chains however, I think it would make most sense to bundle into single interface. I wonder if it might be most appropriate to 'wrap' each blockchain interface with an 'error translator' shell that either translates incoming errors into a generalized type, or forwards raw error data for those errors that cannot be generalized:

image