Skip to content

fix(pxe): deduplicate registerContract by checking for existing instance#21552

Open
Maddiaa0 wants to merge 1 commit intomerge-train/spartanfrom
fix/140-register-contract-dedup
Open

fix(pxe): deduplicate registerContract by checking for existing instance#21552
Maddiaa0 wants to merge 1 commit intomerge-train/spartanfrom
fix/140-register-contract-dedup

Conversation

@Maddiaa0
Copy link
Member

@Maddiaa0 Maddiaa0 commented Mar 13, 2026

part of #21514

honestly not fussed about this one

  • worst case when running on the pxe it would run this again, although only user error would really get us here. Just hygiene really - only opening up as the automated review suggested it

Summary

  • registerContract now checks if a contract is already registered at the given address before performing any work, matching the existing pattern in registerAccount and registerSender
  • Skips redundant artifact validation, address computation, and store writes on duplicate registration
  • Added test verifying the second registration short-circuits without re-registering function signatures

Test plan

  • Unit test confirms node.registerContractFunctionSignatures is not called on duplicate registration
  • Test verifies contract appears exactly once in getContracts()

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

1 participant