omgnetwork / plasma-mvp

OmiseGO's research implementation of Minimal Viable Plasma
MIT License
561 stars 158 forks source link

Change `exitIds` structure #71

Closed bun919tw closed 6 years ago

bun919tw commented 6 years ago

Modify exitIds structure from mapping(uint256 => uint256) to mapping(uint256 => uint256[]). Each exitIds[priority] will have a list of exit IDs. When finalizing exits, we clear all exits with same priority at once.

bun919tw commented 6 years ago

Note that I also found that the calculation of the priority could be changed to uint256 priority = max(childChain[blknum].created_at, now - 1 weeks); Setting the priority equals to the timestamp still follow the requirement that any exit needs to wait at least 7 days. By doing so, we could remove the modifier incrementOldBlocks.

bun919tw commented 6 years ago

David's solution is much better! Close this.