Skip to content

Aptos Cap Hasher Type#22153

Merged
bolekk merged 1 commit intodevelopfrom
aptos-cap-hasher-type
Apr 23, 2026
Merged

Aptos Cap Hasher Type#22153
bolekk merged 1 commit intodevelopfrom
aptos-cap-hasher-type

Conversation

@yashnevatia
Copy link
Copy Markdown
Contributor

Requires

Supports

Copilot AI review requested due to automatic review settings April 23, 2026 17:30
@yashnevatia yashnevatia requested review from a team as code owners April 23, 2026 17:30
@github-actions
Copy link
Copy Markdown
Contributor

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

@yashnevatia yashnevatia added the build-publish Build and Publish image to SDLC label Apr 23, 2026
@github-actions
Copy link
Copy Markdown
Contributor

I see you updated files related to core. Please run make gocs in the root directory to add a changeset as well as in the text include at least one of the following tags:

  • #added For any new functionality added.
  • #breaking_change For any functionality that requires manual action for the node to boot.
  • #bugfix For bug fixes.
  • #changed For any change to the existing functionality.
  • #db_update For any feature that introduces updates to database schema.
  • #deprecation_notice For any upcoming deprecation functionality.
  • #internal For changesets that need to be excluded from the final changelog.
  • #nops For any feature that is NOP facing and needs to be in the official Release Notes for the release.
  • #removed For any functionality/config that is removed.
  • #updated For any functionality that is updated.
  • #wip For any change that is not ready yet and external communication about it should be held off till it is feature complete.

@github-actions
Copy link
Copy Markdown
Contributor

✅ No conflicts with other open PRs targeting develop

Copy link
Copy Markdown
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

Risk Rating: MEDIUM — touches request hashing for write-report capabilities, which can affect request deduping/consensus behavior across nodes.

Adds Aptos support to the V2 WriteReportExcludeSignaturesHasher so Aptos WriteReportRequest messages are hashed consistently with EVM/Solana (signatures excluded).

Changes:

  • Add Aptos capability protobuf import and hashing path for aptos.WriteReportRequest.
  • Extend write-report family detection to recognize CapabilityId family aptos.
  • Update the “unknown family” error message to include Aptos.
Comments suppressed due to low confidence (1)

core/capabilities/remote/executable/hasher.go:150

  • The new Aptos write-report hashing branch isn’t covered by existing unit tests. Please add tests that build an Aptos WriteReportRequest payload and assert (1) same report bytes but different signatures produce the same hash and (2) nil Report errors, similar to the existing EVM/Solana coverage, to prevent regressions in signature-exclusion logic.
	case writeReportFamilyAptos:
		var wrReq aptoscappb.WriteReportRequest
		if err = req.Payload.UnmarshalTo(&wrReq); err != nil {
			return [32]byte{}, fmt.Errorf("failed to unmarshal Payload to WriteReportRequest: %w", err)
		}
		if wrReq.Report == nil {
			return [32]byte{}, errors.New("WriteReportRequest.Report is nil")
		}

		wrReq.Report.Sigs = nil // exclude signatures from hash
		payload, err = anypb.New(&wrReq)
		if err != nil {
			return [32]byte{}, fmt.Errorf("failed to marshal WriteReportRequest back to anypb: %w", err)
		}

Comment on lines 180 to 185
return writeReportFamilyEVM, nil
case "solana":
return writeReportFamilySolana, nil
case "aptos":
return writeReportFamilyAptos, nil
}
Copy link

Copilot AI Apr 23, 2026

Choose a reason for hiding this comment

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

In getWriteReportFamily, the parsing currently can’t fail in the intended way because strings.Split always returns at least one element. Consider removing the redundant length check above the switch and adding a meaningful validation for malformed capability IDs (e.g., empty family segment) so parsing errors are caught deterministically.

Copilot uses AI. Check for mistakes.
@trunk-io
Copy link
Copy Markdown

trunk-io Bot commented Apr 23, 2026

Static BadgeStatic BadgeStatic BadgeStatic Badge

Failed Test Failure Summary Logs
TestAddTokenPool_Apply The test failed without a specific error message, likely due to a timeout or an unspecified failure during test execution. Logs ↗︎
TestDeployChainContractsChangesetPreload Logs ↗︎
Test_CCIPTokenTransfer_EVM2Sui_ManagedTokenPool_NoRateLimit The test failed due to an unspecified error during execution, with no clear indication of the specific issue from the provided logs. Logs ↗︎

View Full Report ↗︎Docs

Copy link
Copy Markdown
Contributor

@bolekk bolekk left a comment

Choose a reason for hiding this comment

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

LGTM. Could use a unit test.

@cl-sonarqube-production
Copy link
Copy Markdown

@bolekk bolekk added this pull request to the merge queue Apr 23, 2026
Merged via the queue into develop with commit 2ebe6eb Apr 23, 2026
277 of 286 checks passed
@bolekk bolekk deleted the aptos-cap-hasher-type branch April 23, 2026 21:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build-publish Build and Publish image to SDLC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants