-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MERC-6004 Add Mercury v4 schema #13862
Conversation
core/services/ocrcommon/telemetry.go
Outdated
@@ -295,7 +297,7 @@ func (e *EnhancedTelemetryService[T]) collectMercuryEnhancedTelemetry(d Enhanced | |||
var bt uint64 | |||
// v1+v2+v3 fields | |||
bp := big.NewInt(0) | |||
//v1+v3 fields | |||
// v1+v3 fields |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we want to add v4 telemetry?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch. I've added a new enum and field for the market status. @mjk90 do you mind also taking a look at the EnhancedEAMercury
proto and see if it makes sense?
core/services/relay/evm/mercury/v4/reportcodec/report_codec_test.go
Outdated
Show resolved
Hide resolved
obs.BenchmarkPrice = parsed.benchmarkPrice | ||
obs.Bid = parsed.bid | ||
obs.Ask = parsed.ask | ||
obs.MarketStatus = parsed.marketStatus |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where would we set MarketStatus.Err?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The error is created by setMarketStatus
and then returned by the ds.parse
method.
require.Error(t, err) | ||
assert.Contains(t, err.Error(), "benchmarkPrice may not be nil") | ||
assert.Contains(t, err.Error(), "linkFee may not be nil") | ||
assert.Contains(t, err.Error(), "nativeFee may not be nil") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what about marketstatus?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The zero value means CLOSED so it is a valid value. Unlike the price fields which are pointer valued *big.Int
, the market status is a scalar uint32
so it can't be nil either.
3cb0b5d
to
56251bd
Compare
8173020
to
b39ea79
Compare
Quality Gate passedIssues Measures |
* Add Mercury v4 * Uncomment out test * Add v4 telemetry * MERC-6004 Fix build * Update chainlink-common * Add changeset * Update market status proto enum values * Add changeset hashtag
Based off Mercury v3 schema with the addition of the market status field. The market status field is an enum which is represented as a uint32 here. This is the most compact width for both Protobuf and Ethereum ABI (uint8 is padded to 32 bytes).
Almost all of the changes are just pattern matching existing places where we fork on the schema version. The things to check for would be the integration test, the
datasource.Observe
method, and generally making sure that I haven't missed anything while copying.Note: this depends on corresponding changes in the
chainlink-common
and repo and smartcontractkit/chainlink-data-streams#73. I'll update this PR with the appropriate versions once those changes are in.