Add S3 blob storage with cashier billing to ic-gateway#193
Open
shilingwang wants to merge 21 commits intomainfrom
Open
Add S3 blob storage with cashier billing to ic-gateway#193shilingwang wants to merge 21 commits intomainfrom
shilingwang wants to merge 21 commits intomainfrom
Conversation
r-birkner
reviewed
Apr 20, 2026
r-birkner
reviewed
Apr 20, 2026
r-birkner
reviewed
Apr 20, 2026
r-birkner
reviewed
Apr 20, 2026
r-birkner
reviewed
Apr 20, 2026
frankdavid
requested changes
Apr 23, 2026
| data.len() | ||
| }; | ||
|
|
||
| yield bytes::Bytes::copy_from_slice(&data[s..e]); |
There was a problem hiding this comment.
if s == 0 and e == data..len(), skip copying. Alternatively you can create Bytes from data and then use Bytes::slice which is O(1).
| async fn consume_budget(&self, owner: &Principal, cost: i64) -> Result<(), BillingError> { | ||
| { | ||
| let mut budgets = self.budgets.write().await; | ||
| if let Some(cached) = budgets.get_mut(owner) { |
There was a problem hiding this comment.
maybe turning around the structure would be easier to read:
if not in cache or too old {
refresh cache...
}
try_debit()
| if divisor == 0 { | ||
| return 0; | ||
| } | ||
| (quantity as i64 * cost) / divisor |
| let bucket_c = state.bucket.clone(); | ||
|
|
||
| let stream: async_stream::__private::AsyncStream<Result<bytes::Bytes, std::io::Error>, _> = async_stream::try_stream! { | ||
| for hash in &chunk_hashes { |
There was a problem hiding this comment.
The chunks are downloaded sequentially, is this on purpose?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#NODE-1941
Summary
New modules
HTTP endpoints (under /v1/)
Design decisions