Skip to content
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

feat: include recovered signer pubkeys in new block payload #662

Merged
merged 4 commits into from
Oct 24, 2024

Conversation

zone117x
Copy link
Member

No description provided.

@zone117x zone117x requested a review from rafaelcr October 24, 2024 07:55
Comment on lines 515 to 526
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,
},
Copy link
Member Author

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.

Copy link
Collaborator

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

components/chainhook-sdk/src/indexer/stacks/mod.rs Outdated Show resolved Hide resolved
Comment on lines 515 to 526
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,
},
Copy link
Collaborator

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

@zone117x zone117x requested a review from rafaelcr October 24, 2024 17:37
@zone117x zone117x merged commit b5ad4ba into stacks-signers Oct 24, 2024
7 checks passed
@zone117x zone117x deleted the feat/block-signer-pubkeys branch October 24, 2024 17:54
@zone117x zone117x had a problem deploying to Development-mainnet October 24, 2024 18:19 — with GitHub Actions Failure
@zone117x zone117x had a problem deploying to Development-testnet October 24, 2024 18:19 — with GitHub Actions Failure
github-actions bot pushed a commit that referenced this pull request Oct 25, 2024
## [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))
Copy link

🎉 This PR is included in version 1.9.0-stacks-signers.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants