20260420_2 完成输出report和ccr优化,snapshot耗时优化到70多秒
This commit is contained in:
@@ -184,6 +184,7 @@ fn apnic_tree_full_stats_serial() {
|
||||
repo_sync_runtime: None,
|
||||
parallel_phase2_config: None,
|
||||
parallel_roa_worker_pool: None,
|
||||
ccr_accumulator: None,
|
||||
};
|
||||
|
||||
let stats = RefCell::new(LiveStats::default());
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
use rpki::ccr::{
|
||||
CcrContentInfo, CcrDigestAlgorithm, ManifestInstance, ManifestState, RoaPayloadSet,
|
||||
RoaPayloadState, RouterKey, RouterKeySet, RouterKeyState, TrustAnchorState, compute_state_hash,
|
||||
decode_content_info, dump_content_info_json_value,
|
||||
compute_state_hash, decode_content_info, dump_content_info_json_value,
|
||||
encode::{
|
||||
encode_aspa_payload_state_payload_der, encode_content_info,
|
||||
encode_manifest_state_payload_der, encode_roa_payload_state_payload_der,
|
||||
@@ -10,12 +8,14 @@ use rpki::ccr::{
|
||||
verify::{
|
||||
verify_against_report_json_path, verify_against_vcir_store, verify_content_info_bytes,
|
||||
},
|
||||
CcrContentInfo, CcrDigestAlgorithm, ManifestInstance, ManifestState, RoaPayloadSet,
|
||||
RoaPayloadState, RouterKey, RouterKeySet, RouterKeyState, TrustAnchorState,
|
||||
};
|
||||
use rpki::data_model::common::BigUnsigned;
|
||||
use rpki::storage::{
|
||||
PackTime, RocksStore, ValidatedCaInstanceResult, ValidatedManifestMeta, VcirArtifactKind,
|
||||
VcirArtifactRole, VcirArtifactValidationStatus, VcirAuditSummary, VcirChildEntry,
|
||||
VcirInstanceGate, VcirRelatedArtifact, VcirSummary,
|
||||
VcirArtifactRole, VcirArtifactValidationStatus, VcirAuditSummary, VcirCcrManifestProjection,
|
||||
VcirChildEntry, VcirInstanceGate, VcirRelatedArtifact, VcirSummary,
|
||||
};
|
||||
|
||||
fn sample_time() -> time::OffsetDateTime {
|
||||
@@ -108,6 +108,25 @@ fn sample_ccr() -> Vec<u8> {
|
||||
encode_content_info(&CcrContentInfo::new(ccr)).expect("encode ccr")
|
||||
}
|
||||
|
||||
fn sample_ccr_manifest_projection(
|
||||
manifest_rsync_uri: &str,
|
||||
manifest_sha256: Vec<u8>,
|
||||
) -> VcirCcrManifestProjection {
|
||||
VcirCcrManifestProjection {
|
||||
manifest_rsync_uri: manifest_rsync_uri.to_string(),
|
||||
manifest_sha256,
|
||||
manifest_size: 2048,
|
||||
manifest_ee_aki: vec![0x55; 20],
|
||||
manifest_number_be: vec![1],
|
||||
manifest_this_update: PackTime::from_utc_offset_datetime(sample_time()),
|
||||
manifest_sia_locations_der: vec![vec![
|
||||
0x30, 0x11, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x30, 0x05, 0x86, 0x05,
|
||||
b'r', b's', b'y', b'n', b'c',
|
||||
]],
|
||||
subordinate_skis: vec![vec![0x33; 20]],
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn verify_content_info_bytes_succeeds_for_valid_ccr() {
|
||||
let der = sample_ccr();
|
||||
@@ -195,6 +214,10 @@ fn verify_against_vcir_store_matches_manifest_hashes() {
|
||||
validated_manifest_this_update: PackTime::from_utc_offset_datetime(sample_time()),
|
||||
validated_manifest_next_update: PackTime::from_utc_offset_datetime(sample_time()),
|
||||
},
|
||||
ccr_manifest_projection: sample_ccr_manifest_projection(
|
||||
"rsync://example.test/current.mft",
|
||||
vec![0x10; 32],
|
||||
),
|
||||
instance_gate: VcirInstanceGate {
|
||||
manifest_next_update: PackTime::from_utc_offset_datetime(sample_time()),
|
||||
current_crl_next_update: PackTime::from_utc_offset_datetime(sample_time()),
|
||||
|
||||
@@ -7,10 +7,10 @@ use rpki::policy::{CaFailedFetchPolicy, Policy};
|
||||
use rpki::storage::{
|
||||
PackTime, RawByHashEntry, RepositoryViewEntry, RepositoryViewState, RocksStore,
|
||||
ValidatedCaInstanceResult, ValidatedManifestMeta, VcirArtifactKind, VcirArtifactRole,
|
||||
VcirArtifactValidationStatus, VcirAuditSummary, VcirInstanceGate, VcirRelatedArtifact,
|
||||
VcirSummary,
|
||||
VcirArtifactValidationStatus, VcirAuditSummary, VcirCcrManifestProjection, VcirInstanceGate,
|
||||
VcirRelatedArtifact, VcirSummary,
|
||||
};
|
||||
use rpki::validation::manifest::{PublicationPointSource, process_manifest_publication_point};
|
||||
use rpki::validation::manifest::{process_manifest_publication_point, PublicationPointSource};
|
||||
|
||||
fn issuer_ca_fixture() -> Vec<u8> {
|
||||
std::fs::read(
|
||||
@@ -64,6 +64,19 @@ fn store_validated_manifest_baseline(
|
||||
store
|
||||
.put_raw_by_hash_entry(&manifest_raw)
|
||||
.expect("store VCIR manifest raw_by_hash");
|
||||
let ccr_manifest_projection = VcirCcrManifestProjection {
|
||||
manifest_rsync_uri: manifest_rsync_uri.to_string(),
|
||||
manifest_sha256: hex::decode(&manifest_sha256).expect("decode manifest hash"),
|
||||
manifest_size: manifest_bytes.len() as u64,
|
||||
manifest_ee_aki: vec![0x11; 20],
|
||||
manifest_number_be: manifest_number_be.clone(),
|
||||
manifest_this_update: PackTime::from_utc_offset_datetime(this_update),
|
||||
manifest_sia_locations_der: vec![vec![
|
||||
0x30, 0x11, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x30, 0x05, 0x86, 0x05,
|
||||
b'r', b's', b'y', b'n', b'c',
|
||||
]],
|
||||
subordinate_skis: Vec::new(),
|
||||
};
|
||||
|
||||
let vcir = ValidatedCaInstanceResult {
|
||||
manifest_rsync_uri: manifest_rsync_uri.to_string(),
|
||||
@@ -80,6 +93,7 @@ fn store_validated_manifest_baseline(
|
||||
validated_manifest_this_update: PackTime::from_utc_offset_datetime(this_update),
|
||||
validated_manifest_next_update: PackTime::from_utc_offset_datetime(next_update),
|
||||
},
|
||||
ccr_manifest_projection,
|
||||
instance_gate: VcirInstanceGate {
|
||||
manifest_next_update: PackTime::from_utc_offset_datetime(next_update),
|
||||
current_crl_next_update: PackTime::from_utc_offset_datetime(next_update),
|
||||
|
||||
@@ -7,12 +7,12 @@ use rpki::policy::{CaFailedFetchPolicy, Policy};
|
||||
use rpki::storage::{
|
||||
PackTime, RawByHashEntry, RepositoryViewEntry, RepositoryViewState, RocksStore,
|
||||
ValidatedCaInstanceResult, ValidatedManifestMeta, VcirArtifactKind, VcirArtifactRole,
|
||||
VcirArtifactValidationStatus, VcirAuditSummary, VcirInstanceGate, VcirRelatedArtifact,
|
||||
VcirSummary,
|
||||
VcirArtifactValidationStatus, VcirAuditSummary, VcirCcrManifestProjection, VcirInstanceGate,
|
||||
VcirRelatedArtifact, VcirSummary,
|
||||
};
|
||||
use rpki::validation::manifest::{
|
||||
ManifestProcessError, PublicationPointSource, process_manifest_publication_point,
|
||||
process_manifest_publication_point_after_repo_sync,
|
||||
process_manifest_publication_point, process_manifest_publication_point_after_repo_sync,
|
||||
ManifestProcessError, PublicationPointSource,
|
||||
};
|
||||
|
||||
fn issuer_ca_fixture_der() -> Vec<u8> {
|
||||
@@ -67,6 +67,19 @@ fn store_validated_manifest_baseline(
|
||||
store
|
||||
.put_raw_by_hash_entry(&manifest_raw)
|
||||
.expect("store VCIR manifest raw_by_hash");
|
||||
let ccr_manifest_projection = VcirCcrManifestProjection {
|
||||
manifest_rsync_uri: manifest_rsync_uri.to_string(),
|
||||
manifest_sha256: hex::decode(&manifest_sha256).expect("decode manifest hash"),
|
||||
manifest_size: manifest_bytes.len() as u64,
|
||||
manifest_ee_aki: vec![0x11; 20],
|
||||
manifest_number_be: manifest_number_be.clone(),
|
||||
manifest_this_update: PackTime::from_utc_offset_datetime(this_update),
|
||||
manifest_sia_locations_der: vec![vec![
|
||||
0x30, 0x11, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x30, 0x05, 0x86, 0x05,
|
||||
b'r', b's', b'y', b'n', b'c',
|
||||
]],
|
||||
subordinate_skis: Vec::new(),
|
||||
};
|
||||
|
||||
let vcir = ValidatedCaInstanceResult {
|
||||
manifest_rsync_uri: manifest_rsync_uri.to_string(),
|
||||
@@ -83,6 +96,7 @@ fn store_validated_manifest_baseline(
|
||||
validated_manifest_this_update: PackTime::from_utc_offset_datetime(this_update),
|
||||
validated_manifest_next_update: PackTime::from_utc_offset_datetime(next_update),
|
||||
},
|
||||
ccr_manifest_projection,
|
||||
instance_gate: VcirInstanceGate {
|
||||
manifest_next_update: PackTime::from_utc_offset_datetime(next_update),
|
||||
current_crl_next_update: PackTime::from_utc_offset_datetime(next_update),
|
||||
|
||||
Reference in New Issue
Block a user