FourthState / plasma-mvp-rootchain

smart contract implementation according to the Plasma MVP spec.
Apache License 2.0
79 stars 24 forks source link

Withdrawal Delay on Deposits #86

Closed colin-axner closed 5 years ago

colin-axner commented 5 years ago

Deposits face the same issue transaction exits do when dealing with ordering of an exiting deposit. Currently we use the nonce as its priority, however earlier deposits could therefore delay exits since we pop from the top of the queue to see if pending a deposit exit is older than one week.

This can be fixed by making the priority value inserted into the priority queue be: block.time << 128 | nonce

We do not need to take into account a deposits "age" as we do with transactions because they cannot be faked since they are logged by the rootchain. They can only be invalid and therefore challenged.