@ -193,33 +193,34 @@ We consider the following set-up:
we will write ```totalVotingPower(V)``` for ```votingpower_in(V,V)```, which returns the total voting power in V.
We further use the function ```signers(Commit)``` that returns the set of validators that signed the Commit.
**CheckSupport.** The following function checks whether we can trust the header h2 based on header h1 following the trusting period method.
**CheckSupport.** The following function checks whether we can trust the header h2 based on header h1 following the trusting period method. Time constraint is
captured by the `hasExpired` function that depends on trusted period (`tp`) and a parameter `Delta` that denotes minimum duration of header so it is
not considered expired.
```go
func hasExpired(h) {
if h.Header.bfttime + tp - Delta <now{//Observation1
return true
}
// basic validation (function `verify`) has already been called on h2
func CheckSupport(h1,h2,trustlevel) bool {
if h1.Header.bfttime + tp <now{//Observation1
return false // old header was once trusted but it is expired
}
if hasExpired(h1) then return false //old header was once trusted but it is expired
vp_all := totalVotingPower(h1.Header.NextV)
// total sum of voting power of validators in h2
// total sum of voting power of validators in h1
if h2.Header.height == h1.Header.height + 1 {
// specific check for adjacent headers; everything must be
// properly signed.
// also check that h2.Header.V == h1.Header.NextV
// Plus the following check that 2/3 of the voting power