(t time.Time)
| 153 | } |
| 154 | |
| 155 | func (r *runtime) queryTimeIsExpired(t time.Time) bool { |
| 156 | // Checking query expiration for the pending block, whose height is c.rt.NextHeight: |
| 157 | // |
| 158 | // TimeLived = r.NextTurn - r.GetHeightFromTime(t) |
| 159 | // |
| 160 | // Return true if: QueryTTL < TimeLived. |
| 161 | // |
| 162 | // NOTE(leventeliu): as a result, a TTL=1 requires any query to be acknowledged and received |
| 163 | // immediately. |
| 164 | // Consider the case that a query has happened right before period h, which has height h. |
| 165 | // If its ACK+Roundtrip time>0, it will be seemed as acknowledged in period h+1, or even later. |
| 166 | // So, period h+1 has NextHeight h+2, and TimeLived of this query will be 2 at that time - it |
| 167 | // has expired. |
| 168 | // |
| 169 | return r.getHeightFromTime(t) < r.getMinValidHeight() |
| 170 | } |
| 171 | |
| 172 | // updateTime updates the current coodinated chain time. |
| 173 | func (r *runtime) updateTime(now time.Time) { |
no test coverage detected