[wip] Test to verify state transition size#21297
[wip] Test to verify state transition size#21297cedric-cordenier wants to merge 1 commit intodevelopfrom
Conversation
|
👋 cedric-cordenier, thanks for creating this pull request! To help reviewers, please consider creating future PRs as drafts first. This allows you to self-review and make any final changes before notifying the team. Once you're ready, you can mark it as "Ready for review" to request feedback. Thanks! |
|
✅ No conflicts with other open PRs targeting |
There was a problem hiding this comment.
Pull request overview
Adds a new regression test to ensure the Vault OCR3 plugin’s StateTransition output stays within an expected size bound when processing many GetSecrets observations (stress case approaching identifier/ciphertext limits).
Changes:
- Added helpers to construct
GetSecretsobservations containing encrypted decryption key shares. - Added a
StateTransitionsize-limit test forGetSecretsRequestoutcomes. - Updated imports to support new test helpers (e.g.,
fmt,strings,commontypes).
Comments suppressed due to low confidence (1)
core/services/ocr2/plugins/vault/plugin_test.go:2541
- This test asserts against
512 * 1024(524288) while the plugin’s defaultMaxReportsPlusPrecursorlimit is500 * 1024(= 512000). Using the larger limit can let regressions slip through if the precursor exceeds the configured plugin limit but stays under 512KiB; consider asserting againstdefaultLimitsMaxReportsPlusPrecursorLength(or the limit from the plugin config/info) instead, and update the error message accordingly.
maxResponseSize := 512 * 1024
assert.LessOrEqual(t, len(reportPrecursor), maxResponseSize,
"StateTransition response size %d exceeds 512KB limit", len(reportPrecursor))
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| for i, pk := range keys { | ||
| pkBytes, err := hex.DecodeString(pk) | ||
| require.NoError(t, err) | ||
| pubKey := [32]byte(pkBytes) |
There was a problem hiding this comment.
pkBytes is a []byte from hex.DecodeString, and pubKey := [32]byte(pkBytes) is not a valid conversion (won't compile). Build a [32]byte by copying into a fixed array (and ideally assert len(pkBytes)==32) before calling box.SealAnonymous.
| pubKey := [32]byte(pkBytes) | |
| require.Len(t, pkBytes, 32) | |
| var pubKey [32]byte | |
| copy(pubKey[:], pkBytes) |
|
There was a problem hiding this comment.
🔴 Test Results: Unrelated Failure
Affected failures:
- Workflow Run: Run CCIP integration In Memory Tests For PR / smoke/ccip/ccip_token_transfer_test.go:*_LOOPP
What Broke
This failure appears to be unrelated to the changes in this PR. The root cause is the CCIP integration test timing out because it is not receiving the expected commit reports from the blockchain, likely due to an environmental issue or flakiness in the test setup. The PR introduces changes only to a unit test file for a vault plugin, which is entirely unrelated to the failing CCIP integration test. The CI failure is a timeout in the CCIP integration test, specifically while waiting for commit reports, indicating an issue with the test environment or a pre-existing flakiness.
Autofix Options
You can use our MCP server to get AI assistance with debugging and fixing these failures.
- Use MCP in your IDE to debug the issue. Try
Help me fix CI failures from vdyuPAPeto get started.
Tip
Get Better Results: This CI job is not uploading test reports. Adding structured test reports enables more precise, test-level analysis with better root cause identification and more targeted fix recommendations.
👉🏻 Learn how to upload test results.





Requires
Supports