EspressoSystems / cape

Configurable Asset Privacy for Ethereum
https://cape.docs.espressosys.com/
GNU General Public License v3.0
93 stars 16 forks source link

Rejects when the submitted block and the pending deposits queue are both empty #1207

Closed philippecamacho closed 2 years ago

philippecamacho commented 2 years ago

Closes #1206

sveitser commented 2 years ago

LGTM but I wonder why don't we check if there are no commitments instead of checking if there no pending deposits and no notes? It seems a bit simpler to me and since commitments are what go into the merkle tree I think it easier to understand why we reject the block.

In any event I think it would be good to add a comment somewhere about why we reject the block and what problem is caused by not doing that.

philippecamacho commented 2 years ago

LGTM but I wonder why don't we check if there are no commitments instead of checking if there no pending deposits and no notes? It seems a bit simpler to me and since commitments are what go into the merkle tree I think it easier to understand why we reject the block.

Yes, I agree. On the other side it seems to save a bit of gas to reject the block right away. WDYT?

In any event I think it would be good to add a comment somewhere about why we reject the block and what problem is caused by not doing that.

Yes, added in e963fc1

philippecamacho commented 2 years ago

I think we should add a comment as to why we reject empty blocks.

Yes, added in e963fc1.