Near-One / rainbow-token-connector

ERC-20/NEP-141 Token Connector for Rainbow Bridge
62 stars 18 forks source link

Fix min block acceptance height threshold #56

Closed mfornet closed 2 years ago

mfornet commented 3 years ago

In order to make upgrades to the Locker contract without requiring to move all used proofs from one contract to another, a height threshold is used, where only proofs that were created after this threshold (with higher heights) can be used, and others will be considered invalid.

For this end we have this check.

In this case proofBlockHeight refers to the height of the block used to build the proof, and not the height of the block where the transaction was included. Instead of using proofBlockHeight we should use height from the proof ( fullOutcomeProof...height).

There is no way to hack this bug at the moment, but it is critical to fix this in case the Locker is going to be upgraded.