wormhole-foundation / wormhole

A reference implementation for the Wormhole blockchain interoperability protocol.
https://wormhole.com
Other
1.67k stars 690 forks source link

Implement eviction methods #7

Closed hendrikhofstadt closed 3 years ago

hendrikhofstadt commented 4 years ago

In order to reduce fees on Solana and reduce the storage usage of the bridge system, temporary accounts can be evicted.

Accounts that can be evicted:

The ClaimedVAA is created and paid for by the guardians, the TransferOutProposal is paid for by the user locking the tokens.

Account Size (byte) Rent Rent USD (3.4 $/SOL)
TransferOutProposal 1140 0.009 SOL 0.03$
ClaimedVAA 37 0.001 SOL 0.004$

In order to incentivize guardians and cover their SOL costs, all "rent refunds" go to the bridge program. The balance of the bridge is used to subsidize the creation of ClaimedVAAs (to reduce the cost that guardians have to cover). If there is any excess balance on the bridge, we can consider paying it out to the guardians.

To still guarantee data-availability and prevent replay attacks, we need to make sure that the ClaimedVAA and TransferOutProposal accounts live for at least the VAA validity period.

leoluk commented 3 years ago

Implemented via #17. For transfers to Solana, we evict signature state but not ClaimedVAA. For VAAs that are posted for data availability, we keep both signature state and the account because we can't know when it's actually executed.