Skip to content

fix(cluster): hash unsigned v1.3/v1.4 operator signatures as raw bytes - #642

Open
iamquang95 wants to merge 1 commit into
mainfrom
feat/fix-633
Open

fix(cluster): hash unsigned v1.3/v1.4 operator signatures as raw bytes#642
iamquang95 wants to merge 1 commit into
mainfrom
feat/fix-633

Conversation

@iamquang95

Copy link
Copy Markdown
Collaborator

Fix #633

hash_definition_v1x3or4 left-padded operator config_signature/enr_signature to 65 bytes; charon (ssz.go:244-247) writes the raw bytes. Signed definitions coincide (already 65 bytes), but unsigned/partially-signed v1.3/v1.4 definitions hashed differently, so verify_hashes() rejected charon-produced artifacts.

  • Switch the two operator-signature writes to raw put_bytes (v1x5to9 and the creator field were already correct).
  • get_operator_eip712_type now returns Err(UnsupportedVersion) instead of unreachable!() on a version string coming from definition JSON.
  • Regression fixtures (unsigned + partially-signed v1.3) captured from charon v1.7.1's own SetDefinitionHashes(), not from pluto's output; verified the test fails against the old code. All existing signed-path fixtures unchanged.

Comment thread crates/cluster/src/ssz.rs

// Field (2) 'ConfigSignature' Bytes65
put_bytes_n(hh, &o.config_signature, SSZ_LEN_K1_SIG)?;
hh.put_bytes(&o.config_signature)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

https://github.com/ObolNetwork/charon/blob/v1.7.1/cluster/ssz.go#L243-L247

				// Field (2) 'ConfigSignature' Bytes65
				hh.PutBytes(o.ConfigSignature)

				// Field (3) 'ENRSignature' Bytes65
				hh.PutBytes(o.ENRSignature)

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.

Cluster definition_hash mismatch for unsigned v1.3/v1.4 definitions

1 participant