polymerdao / monomer

Build Cosmos SDK applications on the OP Stack.
http://monomer.nethermind.io/
Apache License 2.0
21 stars 15 forks source link

Enforce `L1AttributesTx` in adapters #164

Open NiloCK opened 2 months ago

NiloCK commented 2 months ago

In #148, AdaptCosmosTxsToEthTxs was altered to return an error if deposit tx bytes fail to unmarshal as an ethtypes.Transaction.

We should follow up with a specific check that an L1AttributesTx exists, and this check should apply on each adapter (eth->cosmos, cosmos->eth).

NiloCK commented 2 months ago

Each adapter currently errors if there are no deposit txs:

(PayloadTxToCosmosTx) https://github.com/polymerdao/monomer/blob/bd24e9a0262176404dacd820d95b2e048c65d541/adapters.go#L38-L40

(CosmosTxsToEthTxs) https://github.com/polymerdao/monomer/blob/bd24e9a0262176404dacd820d95b2e048c65d541/adapters.go#L107-L109

But these checks implicitly assume that any collection of deposit txs will have an L1AttributesTx at the first position.