-
Notifications
You must be signed in to change notification settings - Fork 19
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
Clean up oracle spec declaration on market #5714
Comments
What would the relation between conditions here and filter in the |
|
@davidsiska-vega Alright, updated |
So, it would make more sense to me based on the design and how I think about things if this looked like (please excuse anything that isn't valid protobufs…): message DataSourceDefinition {
oneof type {
InternalDataSourceDefinition internal = 1;
OracleDataSourceDefinition oracle = 2;
FilterDataSourceDefinition filter = 3;
}
}
message InternalNetworkDataSourceDefinition {
enum Type {
BLOCK_TIMESTAMP = 1;
// later, others
}
Type type;
}
message SignedMessageOracleDataSourceDefinition {
repeated string pub_keys = 1;
}
message FilterDataSourceDefinition {
DataSourceDefinition input = 1;
repeated Filter conditions = 2;
} So that the example you gave would be: NewMarket {
DataSourceForTradingTermination {
Filter {
input: InternalNetworkData { type: BLOCK_TIMESTAMP }
conditions: [ { operator: GREATER_THAN_OR_EQUAL, value: 123456789 } ]
}
}
} But I appreciate that this may not be compatible with the current implementation due to the fact it would allow nesting of filters (though perhaps we could just error in validation and say nesting filters not [yet] supported…), so if something more like the above is too much hassle for now, I think the proposal above works. I am also not quite clear what the binding thing does exactly… |
There's one issue here, which would be that the Filter type require the key name on which we want to filter. That works with the oracle data source, but not the internal one then as that field would need to be empty, and it goes against why you wanted to change so we don't have non needed fields where we don't need them? |
Blocked: |
Originally in protos: this PR can be moved over to vega repo |
Today, we can only specify an Oracle as data source. The introduction of internal data source was a hack based on the existing Oracle definition, for experiment purpose.
It's time to get this clean up.
Before
The payload used for Oracle data source declaration was:
To specify an internal data source we reused this payload with a few tweaks:
After
That would result in:
The text was updated successfully, but these errors were encountered: