chore: Fix for e2e gossip network test#12954
Merged
Conversation
This test was failing with an invalid signature:
```
18:06:18 ● e2e_p2p_network › should rollup txs from all peers
18:06:18
18:06:18 r must be 0 < r < CURVE.n
18:06:18
18:06:18 79 | const { r, s, v } = signature;
18:06:18 80 | const recoveryBit = toRecoveryBit(v);
18:06:18 > 81 | const sig = new secp256k1.Signature(r.toBigInt(), s.toBigInt()).addRecoveryBit(recoveryBit);
18:06:18 | ^
18:06:18 82 | const publicKey = sig.recoverPublicKey(hash.buffer).toHex(false);
18:06:18 83 | return Buffer.from(publicKey, 'hex');
18:06:18 84 | }
18:06:18
18:06:18 at Signature.assertValidity (../../node_modules/@noble/curves/src/abstract/weierstrass.ts:801:46)
18:06:18 at new Signature (../../node_modules/@noble/curves/src/abstract/weierstrass.ts:782:12)
18:06:18 at recoverPublicKey (../../foundation/dest/crypto/secp256k1-signer/utils.js:81:17)
18:06:18 at recoverAddress (../../foundation/dest/crypto/secp256k1-signer/utils.js:44:23)
18:06:18 at BlockAttestation.getSender (../../stdlib/dest/p2p/block_attestation.js:55:27)
18:06:18 at async Promise.all (index 0)
18:06:18 at Object.<anonymous> (e2e_p2p/gossip_network.test.ts:128:21)
18:06:18
```
The cause was that we were trying to recover the signer from an empty
signature (all zeroes). This is not typically an issue since the p2p
client filters them out (see #12740), but in this test we were reaching
directly to the archiver to retrieve them.
This PR filters out empty signatures before recovering signers for them.
It also includes some extra logging and a test for the validation
service (because why not).
Sample error: http://ci.aztec-labs.com/80ef02336cf535f1
spalladino
commented
Mar 21, 2025
| const [block] = await dataStore.getBlocks(blockNumber, blockNumber); | ||
| const payload = ConsensusPayload.fromBlock(block.block); | ||
| const attestations = block.signatures.map(sig => new BlockAttestation(payload, sig)); | ||
| const attestations = block.signatures.filter(s => !s.isEmpty).map(sig => new BlockAttestation(payload, sig)); |
Contributor
Author
There was a problem hiding this comment.
This is the fix for the issue
Maddiaa0
approved these changes
Mar 24, 2025
PhilWindle
pushed a commit
that referenced
this pull request
Mar 24, 2025
🤖 I have created a new Aztec Packages release --- ## [0.82.2](v0.82.1...v0.82.2) (2025-03-24) ### Features * optimize unconstrained `embedded_curve_add` (noir-lang/noir#7751) ([1e796e2](1e796e2)) * translator zk relation adjustments testing ([#12718](#12718)) ([33e528f](33e528f)) ### Bug Fixes * increased poseidon gates ([#12973](#12973)) ([49d6bfa](49d6bfa)) ### Miscellaneous * bump bb to 0.82.0 (noir-lang/noir#7777) ([1e796e2](1e796e2)) * Fix for e2e gossip network test ([#12954](#12954)) ([5a256c8](5a256c8)) * get logs from init containers ([#12974](#12974)) ([28d1f3e](28d1f3e)) * remove duplication on library list files (noir-lang/noir#7774) ([1e796e2](1e796e2)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
DanielKotov
pushed a commit
that referenced
this pull request
Mar 27, 2025
DanielKotov
pushed a commit
that referenced
this pull request
Mar 27, 2025
🤖 I have created a new Aztec Packages release --- ## [0.82.2](v0.82.1...v0.82.2) (2025-03-24) ### Features * optimize unconstrained `embedded_curve_add` (noir-lang/noir#7751) ([1e796e2](1e796e2)) * translator zk relation adjustments testing ([#12718](#12718)) ([33e528f](33e528f)) ### Bug Fixes * increased poseidon gates ([#12973](#12973)) ([49d6bfa](49d6bfa)) ### Miscellaneous * bump bb to 0.82.0 (noir-lang/noir#7777) ([1e796e2](1e796e2)) * Fix for e2e gossip network test ([#12954](#12954)) ([5a256c8](5a256c8)) * get logs from init containers ([#12974](#12974)) ([28d1f3e](28d1f3e)) * remove duplication on library list files (noir-lang/noir#7774) ([1e796e2](1e796e2)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
DanielKotov
pushed a commit
that referenced
this pull request
Mar 27, 2025
DanielKotov
pushed a commit
that referenced
this pull request
Mar 27, 2025
🤖 I have created a new Aztec Packages release --- ## [0.82.2](v0.82.1...v0.82.2) (2025-03-24) ### Features * optimize unconstrained `embedded_curve_add` (noir-lang/noir#7751) ([1e796e2](1e796e2)) * translator zk relation adjustments testing ([#12718](#12718)) ([33e528f](33e528f)) ### Bug Fixes * increased poseidon gates ([#12973](#12973)) ([49d6bfa](49d6bfa)) ### Miscellaneous * bump bb to 0.82.0 (noir-lang/noir#7777) ([1e796e2](1e796e2)) * Fix for e2e gossip network test ([#12954](#12954)) ([5a256c8](5a256c8)) * get logs from init containers ([#12974](#12974)) ([28d1f3e](28d1f3e)) * remove duplication on library list files (noir-lang/noir#7774) ([1e796e2](1e796e2)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This test was failing with an invalid signature:
The cause was that we were trying to recover the signer from an empty signature (all zeroes). This is not typically an issue since the p2p client filters them out (see #12740), but in this test we were reaching directly to the archiver to retrieve them.
This PR filters out empty signatures before recovering signers for them. It also includes some extra logging and a test for the validation service (because why not).