-
Notifications
You must be signed in to change notification settings - Fork 171
Add external_hash to bundle #765
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
Conversation
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.
Pull Request Overview
Adds support for an externally provided unique identifier for bundles.
- Introduces external_hash: Option on Bundle and bundle_hash: Option on RawBundleMetadata.
- Wires encode/decode so RawBundleMetadata.bundle_hash maps to Bundle.external_hash.
- Updates logic to prefer the external hash where appropriate (redistribution and blocks processor) and adjusts tests/test helpers.
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 6 comments.
Show a summary per file
File | Description |
---|---|
crates/rbuilder-primitives/src/lib.rs | Adds external_hash field to Bundle with documentation. |
crates/rbuilder-primitives/src/serialize.rs | Adds bundle_hash to RawBundleMetadata and maps to/from Bundle.external_hash. |
crates/rbuilder-primitives/src/order_builder.rs | Initializes external_hash: None in BundleBuilder. |
crates/rbuilder-primitives/src/test_data_generator.rs | Initializes external_hash: None in test data helpers. |
crates/rbuilder/src/backtest/redistribute/mod.rs | Uses external_hash.unwrap_or(hash) when tracking bundle hashes. |
crates/rbuilder-operator/src/blocks_processor.rs | Prefers external_hash over hash when reporting bundle_hash; updates test metadata. |
crates/rbuilder/src/backtest/build_block/synthetic_orders.rs | Initializes external_hash: None in synthetic bundle creation. |
crates/rbuilder/src/backtest/restore_landed_orders/find_landed_orders.rs | Updates tests to set external_hash: None. |
crates/rbuilder/src/building/builders/parallel_builder/conflict_resolvers.rs | Updates tests to set external_hash: None. |
crates/rbuilder/src/backtest/store.rs | Populates bundle_hash: None in RawBundleMetadata in tests. |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
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.
Pull Request Overview
Copilot reviewed 11 out of 11 changed files in this pull request and generated 3 comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
📝 Summary
bundle_hash
field that is set by the sender to uniquely identify bundleexternal_hash
field💡 Motivation and Context
This allows ingress service to set bundle hash that is returned to the user.
✅ I have completed the following steps:
make lint
make test