Skip to content

Comments

[wip] Test to verify state transition size#21297

Open
cedric-cordenier wants to merge 1 commit intodevelopfrom
state-transition-test
Open

[wip] Test to verify state transition size#21297
cedric-cordenier wants to merge 1 commit intodevelopfrom
state-transition-test

Conversation

@cedric-cordenier
Copy link
Contributor

Requires

Supports

Copilot AI review requested due to automatic review settings February 24, 2026 21:07
@cedric-cordenier cedric-cordenier requested review from a team as code owners February 24, 2026 21:07
@github-actions
Copy link
Contributor

👋 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!

@github-actions
Copy link
Contributor

✅ No conflicts with other open PRs targeting develop

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 GetSecrets observations containing encrypted decryption key shares.
  • Added a StateTransition size-limit test for GetSecretsRequest outcomes.
  • 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 default MaxReportsPlusPrecursor limit is 500 * 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 against defaultLimitsMaxReportsPlusPrecursorLength (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)
Copy link

Copilot AI Feb 24, 2026

Choose a reason for hiding this comment

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

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.

Suggested change
pubKey := [32]byte(pkBytes)
require.Len(t, pkBytes, 32)
var pubKey [32]byte
copy(pubKey[:], pkBytes)

Copilot uses AI. Check for mistakes.
@cl-sonarqube-production
Copy link

Copy link

@trunk-io trunk-io bot left a comment

Choose a reason for hiding this comment

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

🔴 Test Results: Unrelated Failure

Affected failures:

  1. 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 vdyuPAPe to 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.

@trunk-io
Copy link

trunk-io bot commented Feb 24, 2026

Static BadgeStatic BadgeStatic BadgeStatic Badge

View Full Report ↗︎Docs

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.

2 participants