MCPcopy Create free account
hub / github.com/argumentcomputer/ix / count_checkable

Function count_checkable

sp1/host/src/main.rs:98–113  ·  view source on GitHub ↗

Count the kernel-checked target addresses for human-readable output. Mirrors the in-guest enumeration so the printed count matches what the guest actually proves over. Anon: `Env::get_anon` (skip metadata) + `build_anon_work` over `env.consts` — same enumeration `rs_kernel_check_anon` and the guest both use. Meta: `Env::get` (need `env.named`) + `checkable_addrs()` — same `env.named` walk the Me

(env_bytes: &[u8], meta_mode: bool)

Source from the content-addressed store, hash-verified

96
97/// Count the kernel-checked target addresses for human-readable output.
98/// Mirrors the in-guest enumeration so the printed count matches what
99/// the guest actually proves over.
100///
101/// Anon: `Env::get_anon` (skip metadata) + `build_anon_work` over
102/// `env.consts` — same enumeration `rs_kernel_check_anon` and the
103/// guest both use.
104///
105/// Meta: `Env::get` (need `env.named`) + `checkable_addrs()` — same
106/// `env.named` walk the Meta guest does.
107fn count_checkable(env_bytes: &[u8], meta_mode: bool) -> usize {
108 if meta_mode {
109 IxonEnv::get(&mut &env_bytes[..])
110 .expect("invalid Ixon environment")
111 .checkable_addrs()
112 .len()
113 } else {
114 let env =
115 IxonEnv::get_anon(&mut &env_bytes[..]).expect("invalid Ixon environment");
116 build_anon_work(&env)

Callers 1

mainFunction · 0.85

Calls 5

checkable_addrsMethod · 0.80
targetsMethod · 0.80
build_anon_workFunction · 0.50
lenMethod · 0.45
iterMethod · 0.45

Tested by

no test coverage detected