-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
665 additions
and
182 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
"chainlink": major | ||
--- | ||
|
||
Upgrade LLO protocol to support sub-seconds reports. #breaking_change | ||
|
||
CAUTION: This release needs a careful rollout. It _must_ be tested on a staging DON first by setting half of the nodes to this version, while leaving half at the previous version, to verify inter-version interoperability before node-by-node rollout in production. | ||
|
||
NOTE: Protocol version 0 does NOT support gapless handover on sub-second reports. You must upgrade to version 1 for that. | ||
|
||
Rollout plan is here: https://smartcontract-it.atlassian.net/browse/MERC-6852 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package evm | ||
|
||
import ( | ||
"fmt" | ||
"math" | ||
|
||
"github.com/smartcontractkit/chainlink-data-streams/llo" | ||
) | ||
|
||
// Extracts nanosecond timestamps as uint32 number of seconds | ||
func ExtractTimestamps(report llo.Report) (validAfterSeconds, observationTimestampSeconds uint32, err error) { | ||
vas := report.ValidAfterNanoseconds / 1e9 | ||
ots := report.ObservationTimestampNanoseconds / 1e9 | ||
if vas > math.MaxUint32 { | ||
err = fmt.Errorf("validAfterSeconds too large: %d", vas) | ||
return | ||
} | ||
if ots > math.MaxUint32 { | ||
err = fmt.Errorf("observationTimestampSeconds too large: %d", ots) | ||
return | ||
} | ||
return uint32(vas), uint32(ots), nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
138 changes: 72 additions & 66 deletions
138
core/services/llo/evm/report_codec_evm_abi_encode_unpacked_test.go
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.