-
Notifications
You must be signed in to change notification settings - Fork 13
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
Implement Batch Query Commitements RFC #816
Conversation
@@ -24,54 +25,59 @@ use url::Url; | |||
#[derive(Debug, Clone, Merge, Serialize, Deserialize)] | |||
#[serde(deny_unknown_fields, rename_all = "camelCase")] | |||
pub struct CLIConfig { | |||
/// Database connection configuration | |||
pub database: Option<DatabaseConfig>, |
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.
Sorry for the diff - sorted fields alphabetically
@@ -276,6 +285,208 @@ async fn test_data_query_handler_full() { | |||
|
|||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |||
|
|||
#[test_group::group(engine, datafusion)] | |||
#[test_log::test(tokio::test)] | |||
async fn test_data_query_handler_v2() { |
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.
This test explains it all
let mut visitors: [&mut dyn MetadataChainVisitor<Error = vis::Infallible>; 6] = [ | ||
&mut attachments_visitor, | ||
&mut info_visitor, | ||
&mut license_visitor, | ||
&mut schema_visitor, | ||
&mut seed_visitor, | ||
&mut vocab_visitor, | ||
]; |
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.
FYI @s373r I'm super happy about this trick:
- Notice that all response elements are optional - so if user did not request
seed
orschema
we ideally don't want to search for this event - So I made all visitors above optional
- I then implemented
MetadataChainVisitor
forOption<T> where T: MetadataChainVisitor
- If the
Option
isNone
- the visitor will immediatelyStop
- If
Some
- it delegates the calls to inner visitor
This is about as concise as it gets :)
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.
@sergiimk , 💯
Awesome idea with the optional visitors -- looking at the changes in the other PR noticed this, very cool!
c2ebb5e
to
c324c3e
Compare
50a28aa
to
427e73e
Compare
Description
Closes: kamu-data/kamu-node#125
Closes: kamu-data/kamu-node#126
Implements response signing and a new commitment scheme according to the RFC.
Note that the old response format is preserved for compatibility via
V1 / V2
enum trick. If user request in the new format (e.g. by including?include=proof
) only then they will get a response in the new format. This will allow us to transition to the new format progressively, without breaking the oracles for example.Also introduces a new
{dataset}/metadata
endpoint that allows getting dataset schema, license, info etc.Checklist before requesting a review
Extra steps taken to preserve the compatibility
New config options added, but they have defaults
Will be done separately
DI update is needed and new configuration needs to be exposed - will be preparing a PR