2022-10-21 10:32:24 -07:00
|
|
|
package vaa
|
2020-10-28 14:41:33 -07:00
|
|
|
|
2020-10-29 02:13:15 -07:00
|
|
|
// CalculateQuorum returns the minimum number of guardians that need to sign a VAA for a given guardian set.
|
2020-10-28 14:41:33 -07:00
|
|
|
//
|
|
|
|
// The canonical source is the calculation in the contracts (solana/bridge/src/processor.rs and
|
|
|
|
// ethereum/contracts/Wormhole.sol), and this needs to match the implementation in the contracts.
|
|
|
|
func CalculateQuorum(numGuardians int) int {
|
2022-12-27 10:27:47 -08:00
|
|
|
return ((numGuardians * 2) / 3) + 1
|
2020-10-28 14:41:33 -07:00
|
|
|
}
|