Skip to content

Commit 41e0a05

Browse files
author
EchoBT
committed
fix: use correct salt type for reveal_weights
- Update bittensor-rs to 32c6bfa (reveal_weights now takes &[u16] for salt) - Use get_salt() to properly decode hex storage back to Vec<u16> - Removes incorrect salt_bytes conversion that caused hash mismatches
1 parent c2ba34b commit 41e0a05

File tree

3 files changed

+3
-7
lines changed

3 files changed

+3
-7
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ license = "MIT"
3030

3131
[workspace.dependencies]
3232
# Bittensor
33-
bittensor-rs = { git = "https://github.com/CortexLM/bittensor-rs", rev = "47a9370" }
33+
bittensor-rs = { git = "https://github.com/CortexLM/bittensor-rs", rev = "32c6bfa" }
3434

3535
# Async runtime
3636
tokio = { version = "1.40", features = ["full", "sync", "macros", "rt-multi-thread"] }

crates/bittensor-integration/src/weights.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -357,17 +357,13 @@ impl WeightSubmitter {
357357
pending.uids, pending.weights, pending.salt_hex, salt
358358
);
359359

360-
// Note: reveal_weights API expects &[u8] for salt, but we store as u16
361-
// The salt bytes are converted back from the hex storage
362-
let salt_bytes: Vec<u8> = hex::decode(&pending.salt_hex).unwrap_or_default();
363-
364360
let tx_hash = reveal_weights(
365361
self.client.client()?,
366362
self.client.signer()?,
367363
self.client.netuid(),
368364
&uids_u64,
369365
&pending.weights,
370-
&salt_bytes,
366+
&salt, // Now correctly passing &[u16]
371367
pending.version_key,
372368
ExtrinsicWait::Finalized,
373369
)

0 commit comments

Comments
 (0)