hermeznetwork / hermez-node

Hermez node Go implementation
GNU Affero General Public License v3.0
61 stars 33 forks source link

Wrong `zkInput` generation #808

Open krlosMata opened 3 years ago

krlosMata commented 3 years ago

Summary of Bug

zkInputs are not properly generated when there is an exit transaction in L2 with 0 amount.

Expected Behavior

correct zkInputs generation

Additional Information:

When the exit tree is empty and a L2 exit transaction with amount 0 is performed, we do not create a new leaf in the exit tree. Thus, receiver leaf processor is not used and associated zkInputs fields should not matter expect for the tokenID2 that should match sender leaf unless the transaction is an L1 transaction or newExit (insert operation into the exit tree) transaction.

The suggested change to fix this issue would be:

jeffprestes commented 3 years ago

@Mikelle , could you please review it? I guess you have done this when you solved the issue related to "double exits"