Skip to content

Conversation

@JuliusMieliauskas
Copy link
Collaborator

  • Regenerated the test vectors using the prod schema signatures as leanSig library only supports prod signatures
  • Updated deserialization of test case from JSON so that it correctly test cases which are expected to throw exception

After this update, the vector tests run with
cargo test -p containers --features xmss-verify test_vectors::verify_signatures now pass

.join(spec_file);

TestRunner::run_verify_signatures_test(test_path).unwrap();
TestRunner::run_verify_signatures_test(test_path)?;
Copy link
Collaborator

Choose a reason for hiding this comment

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

why? just unwrap error, no need to handle them gracefully

"tests/consensus/devnet/verify_signatures/test_invalid_signatures.py::test_invalid_signature[fork_Devnet][fork_devnet-verify_signatures_test]": {
"network": "Devnet",
"leanEnv": "test",
"leanEnv": "prod",
Copy link
Collaborator

Choose a reason for hiding this comment

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

don't generate tests by hand, update makefile script & use it instead:

.PHONY: generate-test-vectors
generate-test-vectors:
	@rm -rf spec && \
		mkdir -p spec && \
		cd spec && \
		git init && \
		git remote add origin https://github.com/leanEthereum/leanSpec.git && \
		git fetch --depth 1 origin $(LEAN_SPEC_COMMIT) && \
		git switch --detach FETCH_HEAD
-	cd spec && uv run fill --clean --fork=devnet
+	cd spec && uv run fill --clean --fork=devnet --scheme prod
	rm -rf ./test_vectors && mkdir -p ./test_vectors
	cp -r ./spec/fixtures/consensus/* ./test_vectors/

Comment on lines +632 to +638
let expect_exception = raw
.get("tests")
.and_then(|t| t.as_object())
.and_then(|obj| obj.values().next())
.and_then(|tc| tc.get("expectException"))
.and_then(|v| v.as_str())
.map(|s| s.to_owned());
Copy link
Collaborator

Choose a reason for hiding this comment

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

don't handle json by hand, just update "VerifySignaturesTestVectorFile" struct

.map(|s| s.to_owned());

// Phase 2: parse into the typed structure.
let test_file: VerifySignaturesTestVectorFile = match serde_json::from_str(&json_content) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

no need to handle json errors - nobody structures invalid json as spec test failure. Spec test must always be parsed, if it is not - then it is test failure, not "expected error".

@ArtiomTr
Copy link
Collaborator

let's merge this now, and do style fixes later

@ArtiomTr ArtiomTr merged commit b399d98 into devnet-2 Jan 26, 2026
0 of 3 checks passed
@ArtiomTr ArtiomTr deleted the fix/xmss-vector-tests branch January 26, 2026 12:31
LiudasBaronas1 pushed a commit that referenced this pull request Jan 27, 2026
Co-authored-by: noopur23 <82257577+noopur23@users.noreply.github.com>
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.

3 participants