chainlink-common
chainlink-common copied to clipboard
(feat): Add Median Aggregator to OCR3 capability
Description
Add Median Aggregator, that takes in the output of an Action:
type CapabilityResponse struct {
Value *values.Map
}
and returns a single signed report with:
Reports:
[
{
FeedID: []byte
RawReport: nil,
Price: big.Int,
Timestamp: time.Time.Unix(),
RemappedID: string
},
...
]
Caveats
- Output structure lifted from what will currently work with Chain Writer and the current Feeds Consumer contract, with no modifications.
- Input should have observations data as bytes, but this is not enforced. Open to ideas here:
- More strict? Error on receiving non-numerical bytes?
- Less strict by supporting other types such as
big.Int.FromString()
- Currently supports only a single value. Should be straight forward to extend by providing multiple ValueKeys in config. and then returning multiple reports
- This will need to be merged for a proper integration test within the Chainlink repo