Skip to content

rust-create-cascade: invert blocks where more than 2/3 of known certs are revoked - #389

Merged
jschanck merged 1 commit into
mozilla:mainfrom
jschanck:invert-blocks
Aug 3, 2026
Merged

rust-create-cascade: invert blocks where more than 2/3 of known certs are revoked#389
jschanck merged 1 commit into
mozilla:mainfrom
jschanck:invert-blocks

Conversation

@jschanck

Copy link
Copy Markdown
Collaborator

(Stacked on top of #388)

The clubcard crate has long supported "inverted blocks" which encode the complement of a set rather than the set itself. Prior to this PR we were only using an inverted block when all of the known certificates for a CA were revoked. This PR uses an inverted block whenever doing so drops the expected size of a filter.

For the 2026-07-27-0 data set, this increases the number of inverted blocks from 19 to 47 and it decreases the filter size by 24 kB. Much larger savings can be expected during mass revocation events.

Encoding an inverted block requires an extra pass over the set of known certificates. This is, at worst, a factor 2 increase in runtime. In practice, the runtime of filter generation is dominated by a few large CAs with small revocation rates, and the runtime increase from handling the few small CAs with high revocation rates is negligible.

@jschanck

Copy link
Copy Markdown
Collaborator Author

Depends on mozilla/clubcard#8

@mozkeeler mozkeeler left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - just a couple of comments.

Comment thread rust-create-cascade/src/clubcard_helper.rs
let clubcard =
CRLiteClubcard::from_bytes(&clubcard_bytes).expect("cannot deserialize clubcard");
let issuer_bytes = decode_issuer(&issuer);
assert!(clubcard.as_ref().index()[issuer_bytes.as_slice()].inverted);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we also check that e.g. the clubcard in the previous test isn't inverted?

@jschanck
jschanck merged commit 0082998 into mozilla:main Aug 3, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants