-
Notifications
You must be signed in to change notification settings - Fork 63
feat: include recovered signer pubkeys in new block payload #662
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| signer_public_keys: match (signer_sig_hash, &block.signer_signature) { | ||
| (Some(signer_sig_hash), Some(signatures)) => { | ||
| Some(signatures.iter().map(|sig_hex| { | ||
| let sig_msg = clarity::util::secp256k1::MessageSignature::from_hex(sig_hex) | ||
| .expect("unable to parse signer signature message"); | ||
| let pubkey = get_signer_pubkey_from_message_hash(&signer_sig_hash, &sig_msg) | ||
| .expect("unable to recover signer sig pubkey"); | ||
| format!("0x{}", hex::encode(pubkey)) | ||
| }).collect()) | ||
| } | ||
| _ => None, | ||
| }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rafaelcr any suggestions on how to add a test for this? I have a sample /new_block message and the expected pubkeys to use as a test vector, but not sure where/how to set that up.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a good question, haven't quite figured out how to properly do tests yet, we should put a pin on this and I'll write some tests once we have the entire signers feature wired up and working
| signer_public_keys: match (signer_sig_hash, &block.signer_signature) { | ||
| (Some(signer_sig_hash), Some(signatures)) => { | ||
| Some(signatures.iter().map(|sig_hex| { | ||
| let sig_msg = clarity::util::secp256k1::MessageSignature::from_hex(sig_hex) | ||
| .expect("unable to parse signer signature message"); | ||
| let pubkey = get_signer_pubkey_from_message_hash(&signer_sig_hash, &sig_msg) | ||
| .expect("unable to recover signer sig pubkey"); | ||
| format!("0x{}", hex::encode(pubkey)) | ||
| }).collect()) | ||
| } | ||
| _ => None, | ||
| }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a good question, haven't quite figured out how to properly do tests yet, we should put a pin on this and I'll write some tests once we have the entire signers feature wired up and working
## [1.9.0-stacks-signers.1](v1.8.0...v1.9.0-stacks-signers.1) (2024-10-25) ### Features * add various new nakamoto block fields to `/new_block` ingestion and `StacksPayload` ([#659](#659)) ([f48cda5](f48cda5)) * include recovered signer pubkeys in new block payload ([#662](#662)) ([b5ad4ba](b5ad4ba)) * include signer messages in Stacks predicate payloads ([#656](#656)) ([aee14bc](aee14bc)) * parse `/stackerdb_chunks` Stacks node event ([#653](#653)) ([e44d84a](e44d84a)) * store signer messages in local sqlite database ([#664](#664)) ([d12acd9](d12acd9)) * support tenure-height in block messages ([#661](#661)) ([99e5a61](99e5a61)) * **ts-client:** add persisted predicates and periodic health check ([#658](#658)) ([535226a](535226a)) * **ts-client:** add signer messages to stacks payloads ([#657](#657)) ([ff66bb2](ff66bb2)) ### Bug Fixes * add a configurable max timeout for outgoing predicate payload requests ([#642](#642)) ([6c1dfa9](6c1dfa9)), closes [#643](#643) * increase stacks event server body size limit to 500MB ([#660](#660)) ([21234c9](21234c9)) * return 500 status code to Stacks node when event ingestion fails ([#648](#648)) ([63c753c](63c753c)), closes [#646](#646) * signer pubkey calculation ([#665](#665)) ([cc93873](cc93873)) * update SignerMessage deserializing ([#663](#663)) ([71364c1](71364c1)) * validate ts client predicates before registering ([#639](#639)) ([2d08f72](2d08f72))
|
🎉 This PR is included in version 1.9.0-stacks-signers.1 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
## [1.9.0](v1.8.0...v1.9.0) (2025-06-16) ### Features * add mock signature pubkey ([#670](#670)) ([c414d79](c414d79)) * add mock signer message support ([#669](#669)) ([ad5fd54](ad5fd54)) * add various new nakamoto block fields to `/new_block` ingestion and `StacksPayload` ([#659](#659)) ([f48cda5](f48cda5)) * callback to intercept and modify predicates before re-registration ([#675](#675)) ([5f13912](5f13912)) * include recovered signer pubkeys in new block payload ([#662](#662)) ([b5ad4ba](b5ad4ba)) * include signer messages in Stacks predicate payloads ([#656](#656)) ([aee14bc](aee14bc)) * parse `/stackerdb_chunks` Stacks node event ([#653](#653)) ([e44d84a](e44d84a)) * store signer messages in local sqlite database ([#664](#664)) ([d12acd9](d12acd9)) * support tenure-height in block messages ([#661](#661)) ([99e5a61](99e5a61)) * **ts-client:** add persisted predicates and periodic health check ([#658](#658)) ([535226a](535226a)) * **ts-client:** add signer messages to stacks payloads ([#657](#657)) ([ff66bb2](ff66bb2)) ### Bug Fixes * add a configurable max timeout for outgoing predicate payload requests ([#642](#642)) ([6c1dfa9](6c1dfa9)), closes [#643](#643) * add missing fields to ordinal inscription reveals ([#703](#703)) ([4e49608](4e49608)) * bump stacks codec ([3c117b5](3c117b5)) * increase stacks event server body size limit to 500MB ([#660](#660)) ([21234c9](21234c9)) * mock signature retrieval ([#671](#671)) ([8bb59c1](8bb59c1)) * only import stacks tsv if chainstate is empty ([#684](#684)) ([1f9f37e](1f9f37e)), closes [#677](#677) * propagate error when trying to store peer info ([1bc949a](1bc949a)) * read contract_interface from Stacks node block events ([#712](#712)) ([6f9c718](6f9c718)) * read stacks-core http event POST payloads for ignored events ([#673](#673)) ([a01470e](a01470e)) * return 500 status code to Stacks node when event ingestion fails ([#648](#648)) ([63c753c](63c753c)), closes [#646](#646) * signer pubkey calculation ([#665](#665)) ([cc93873](cc93873)) * ts client missing matches_regex option for print_event ([#701](#701)) ([8247900](8247900)) * update SignerMessage deserializing ([#663](#663)) ([71364c1](71364c1)) * validate ts client predicates before registering ([#639](#639)) ([2d08f72](2d08f72))
|
🎉 This PR is included in version 1.9.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
## [1.9.0-stacks-signers.1](hirosystems/chainhook@v1.8.0...v1.9.0-stacks-signers.1) (2024-10-25) ### Features * add various new nakamoto block fields to `/new_block` ingestion and `StacksPayload` ([#659](hirosystems/chainhook#659)) ([f48cda5](hirosystems/chainhook@f48cda5)) * include recovered signer pubkeys in new block payload ([#662](hirosystems/chainhook#662)) ([b5ad4ba](hirosystems/chainhook@b5ad4ba)) * include signer messages in Stacks predicate payloads ([#656](hirosystems/chainhook#656)) ([aee14bc](hirosystems/chainhook@aee14bc)) * parse `/stackerdb_chunks` Stacks node event ([#653](hirosystems/chainhook#653)) ([e44d84a](hirosystems/chainhook@e44d84a)) * store signer messages in local sqlite database ([#664](hirosystems/chainhook#664)) ([d12acd9](hirosystems/chainhook@d12acd9)) * support tenure-height in block messages ([#661](hirosystems/chainhook#661)) ([99e5a61](hirosystems/chainhook@99e5a61)) * **ts-client:** add persisted predicates and periodic health check ([#658](hirosystems/chainhook#658)) ([535226a](hirosystems/chainhook@535226a)) * **ts-client:** add signer messages to stacks payloads ([#657](hirosystems/chainhook#657)) ([ff66bb2](hirosystems/chainhook@ff66bb2)) ### Bug Fixes * add a configurable max timeout for outgoing predicate payload requests ([#642](hirosystems/chainhook#642)) ([6c1dfa9](hirosystems/chainhook@6c1dfa9)), closes [#643](hirosystems/chainhook#643) * increase stacks event server body size limit to 500MB ([#660](hirosystems/chainhook#660)) ([21234c9](hirosystems/chainhook@21234c9)) * return 500 status code to Stacks node when event ingestion fails ([#648](hirosystems/chainhook#648)) ([63c753c](hirosystems/chainhook@63c753c)), closes [#646](hirosystems/chainhook#646) * signer pubkey calculation ([#665](hirosystems/chainhook#665)) ([cc93873](hirosystems/chainhook@cc93873)) * update SignerMessage deserializing ([#663](hirosystems/chainhook#663)) ([71364c1](hirosystems/chainhook@71364c1)) * validate ts client predicates before registering ([#639](hirosystems/chainhook#639)) ([2d08f72](hirosystems/chainhook@2d08f72))
No description provided.