Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 14 additions & 8 deletions rs/artifact_pool/src/canister_http_pool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,10 @@ mod tests {
use ic_types::{
CanisterId, RegistryVersion, ReplicaVersion,
artifact::IdentifiableArtifact,
canister_http::{CanisterHttpResponseContent, CanisterHttpResponseMetadata},
canister_http::{
CanisterHttpPaymentReceipt, CanisterHttpResponseContent, CanisterHttpResponseMetadata,
CanisterHttpResponseReceiptShare,
},
crypto::{CryptoHash, Signed},
messages::CallbackId,
signature::BasicSignature,
Expand All @@ -259,13 +262,16 @@ mod tests {

fn fake_share(id: u64) -> CanisterHttpResponseShare {
Signed {
content: CanisterHttpResponseMetadata {
id: CallbackId::from(id),
content_hash: CryptoHashOf::from(CryptoHash(vec![1, 2, 3])),
content_size: 42,
is_reject: false,
registry_version: RegistryVersion::from(id),
replica_version: ReplicaVersion::default(),
content: CanisterHttpResponseReceiptShare {
metadata: CanisterHttpResponseMetadata {
id: CallbackId::from(id),
content_hash: CryptoHashOf::from(CryptoHash(vec![1, 2, 3])),
content_size: 42,
is_reject: false,
registry_version: RegistryVersion::from(id),
replica_version: ReplicaVersion::default(),
},
payment_receipt: CanisterHttpPaymentReceipt::default(),
},
signature: BasicSignature::fake(node_test_id(id)),
}
Expand Down
16 changes: 6 additions & 10 deletions rs/consensus/utils/src/crypto.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use ic_interfaces::{crypto::*, validation::ValidationResult};
use ic_types::{
NodeId, RegistryVersion,
canister_http::CanisterHttpResponseMetadata,
canister_http::CanisterHttpResponseReceiptShare,
consensus::{
BlockMetadata, CatchUpContent, FinalizationContent, NotarizationContent,
RandomBeaconContent, RandomTapeContent, dkg,
Expand Down Expand Up @@ -430,12 +430,8 @@ pub trait ConsensusCrypto:
+ SignVerify<CatchUpContent, ThresholdSignatureShare<CatchUpContent>, NiDkgId>
+ SignVerify<dkg::DealingContent, BasicSignature<dkg::DealingContent>, RegistryVersion>
+ SignVerify<
CanisterHttpResponseMetadata,
BasicSignature<CanisterHttpResponseMetadata>,
RegistryVersion,
> + SignVerify<
CanisterHttpResponseMetadata,
BasicSignature<CanisterHttpResponseMetadata>,
CanisterHttpResponseReceiptShare,
BasicSignature<CanisterHttpResponseReceiptShare>,
RegistryVersion,
> + Aggregate<
NotarizationContent,
Expand Down Expand Up @@ -468,10 +464,10 @@ pub trait ConsensusCrypto:
NiDkgId,
ThresholdSignature<CatchUpContent>,
> + Aggregate<
CanisterHttpResponseMetadata,
BasicSignature<CanisterHttpResponseMetadata>,
CanisterHttpResponseReceiptShare,
BasicSignature<CanisterHttpResponseReceiptShare>,
RegistryVersion,
BasicSignatureBatch<CanisterHttpResponseMetadata>,
BasicSignatureBatch<CanisterHttpResponseReceiptShare>,
> + Crypto
+ Send
+ Sync
Expand Down
4 changes: 2 additions & 2 deletions rs/https_outcalls/client/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ impl NonBlockingChannel<CanisterHttpRequest> for CanisterHttpAdapterClientImpl {
"Canister HTTP request with PayAsYouGo pricing is not supported yet: \
request_id {}, sender {}, process_id: {}",
request_id,
request_sender,
request_context.request.sender,
std::process::id(),
);
let _ = permit.send((
Expand Down Expand Up @@ -210,7 +210,7 @@ impl NonBlockingChannel<CanisterHttpRequest> for CanisterHttpAdapterClientImpl {
&mut *budget,
query_handler,
canister_http_payload,
request_sender,
request_context.request.sender,
transform,
)
.await;
Expand Down
1 change: 1 addition & 0 deletions rs/https_outcalls/consensus/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ rust_test(
"//rs/test_utilities/state",
"//rs/test_utilities/time",
"//rs/test_utilities/types",
"//rs/types/cycles",
"//rs/types/management_canister_types",
"//rs/types/types",
"//rs/utils",
Expand Down
1 change: 1 addition & 0 deletions rs/https_outcalls/consensus/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ ic-test-utilities-registry = { path = "../../test_utilities/registry" }
ic-test-utilities-state = { path = "../../test_utilities/state" }
ic-test-utilities-time = { path = "../../test_utilities/time" }
ic-test-utilities-types = { path = "../../test_utilities/types" }
ic-types-cycles = { path = "../../types/cycles" }
assert_matches = { workspace = true }
mockall = { workspace = true }
proptest = { workspace = true }
Expand Down
14 changes: 7 additions & 7 deletions rs/https_outcalls/consensus/src/gossip.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,12 @@ impl<Pool: CanisterHttpPool> BouncerFactory<CanisterHttpResponseId, Pool>
};
let log = self.log.clone();
Box::new(move |id: &'_ CanisterHttpResponseId| {
if id.content.registry_version != registry_version {
if id.content.registry_version() != registry_version {
warn!(
log,
"Dropping canister http response share with callback id: {}, because registry version {} does not match expected version {}",
id.content.id,
id.content.registry_version,
id.content.id(),
id.content.registry_version(),
registry_version
);
return BouncerValue::Unwanted;
Expand All @@ -83,12 +83,12 @@ impl<Pool: CanisterHttpPool> BouncerFactory<CanisterHttpResponseId, Pool>
// not higher that `MAX_NUMBER_OF_REQUESTS_AHEAD`.
// Receiving an callback Id higher is possible because the priority fn is updated periodically (every 3s) with the latest state
// and can therefore store stale `known_request_ids` and stale `next_callback_id`.
if known_request_ids.contains(&id.content.id)
|| (id.content.id >= next_callback_id
&& id.content.id <= highest_accepted_request_id)
if known_request_ids.contains(&id.content.id())
|| (id.content.id() >= next_callback_id
&& id.content.id() <= highest_accepted_request_id)
{
BouncerValue::Wants
} else if id.content.id > highest_accepted_request_id {
} else if id.content.id() > highest_accepted_request_id {
BouncerValue::MaybeWantsLater
} else {
BouncerValue::Unwanted
Expand Down
Loading
Loading