-
Notifications
You must be signed in to change notification settings - Fork 8
feat: support horizon #1109
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
feat: support horizon #1109
Conversation
3fabe65
to
89f8847
Compare
src/reports.rs
Outdated
request: Some(indexer_request.request).filter(|r| r.len() <= MAX_PAYLOAD_BYTES), | ||
response: Some(original_response).filter(|r| r.len() <= MAX_PAYLOAD_BYTES), | ||
allocation: indexer_request.receipt.allocation().0.0.into(), | ||
allocation: indexer_request.receipt.collection().as_address().to_vec(), // Collection ID as address for compatibility |
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.
shouldnt this be collection
?
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.
Right. Thank you!
Signed-off-by: Joseph Livesey <[email protected]>
request: Some(indexer_request.request).filter(|r| r.len() <= MAX_PAYLOAD_BYTES), | ||
response: Some(original_response).filter(|r| r.len() <= MAX_PAYLOAD_BYTES), | ||
allocation: indexer_request.receipt.allocation().0.0.into(), | ||
allocation, |
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.
So this @tmigone is being consumed by other components I think and so I'm being conservative about changing the interface and that's what I'm trying to get at in the comments.
Signed-off-by: Joseph Livesey <[email protected]>
Signed-off-by: Joseph Livesey <[email protected]>
Signed-off-by: Joseph Livesey <[email protected]>
Signed-off-by: Joseph Livesey <[email protected]>
29cca04
to
b533d22
Compare
Signed-off-by: Joseph Livesey <[email protected]>
Closing this PR in favor of: #1119. It contains the same changes with added fixes. |
Horizon Gateway Upgrade
This horizon gateway provides TAP v2 receipt generation while maintaining full backward compatibility with existing v1 receipts from the upstream implementation.
Overview
This is a horizon-ready gateway that adds TAP v2 (collection-based) receipt support to the existing edgeandnode/gateway which only supports TAP v1 (allocation-based) receipts. This implementation generates exclusively v2 receipts while maintaining backward compatibility for processing existing v1 receipts.
Key Changes from Pre-Horizon Gateway
TAP Protocol Support
Receipt Generation
create_receipt(allocation, fee)
for v1 receiptscreate_receipt(collection, fee, payer, data_service, service_provider)
for v2 receiptsID Types
AllocationId
for receipt generation and payment trackingCollectionId
for receipt generation, supports both types for processingReceipt Structure
v1 Receipts (Pre-Horizon):
allocation_id
: Address of the allocationtimestamp_ns
: Timestamp in nanosecondsnonce
: Random noncevalue
: Fee amount in weiv2 Receipts (Horizon):
collection_id
: Collection identifierpayer
: Address of the payerdata_service
: Address of the data serviceservice_provider
: Address of the service providertimestamp_ns
: Timestamp in nanosecondsnonce
: Random noncevalue
: Fee amount in weiMigration from Pre-Horizon
For Operators
tap_graph
to support v2 receiptsFor Indexers