Skip to content

feat(storage): Add MySQL backed target signature store - #851

Open
manjari25 wants to merge 1 commit into
manjari/tango-signature-entities-and-contractsfrom
manjari/tango-signature-store-mysql
Open

manjari25 wants to merge 1 commit into
manjari/tango-signature-entities-and-contractsfrom
manjari/tango-signature-store-mysql

Conversation

@manjari25

@manjari25 manjari25 commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Why?

Signatures are expensive to recompute, so the analyzer needs a durable source of truth keyed by batch. This PR implements the TargetSignatureStore contract from the previous PR on MySQL and exposes it through the orchestrator's storage aggregate.

What?

  • Adds the target_signature table:
    • Primary key (queue, batch_id), with no secondary index.
    • A row is written once and never updated.
    • targets is a LONGBLOB, because the largest signatures can be large.
  • Adds a queue-bound MySQL TargetSignatureStore:
    • A duplicate create maps to ErrAlreadyExists.
    • A signature whose queue differs from the bound queue is rejected.
    • Get reports a missing batch as found=false, not as an error.
  • Adds a small binary codec for the targets: an 8-byte big-endian ID followed by a signed varint distance per entry. The codec lives next to the MySQL store because the byte format is a storage detail, so callers only ever see entity.TargetSignature.
  • Adds GetTargetSignatureStore() to the orchestrator Storage aggregate only, so the gateway cannot reach it. The mock is regenerated.
  • Documents the table in the schema README.
  • Updates doc/rfc/service-scoped-extensions.md for the new accessor and table.

Test Plan

./tool/bazel test //submitqueue/orchestrator/extension/storage/mysql:go_default_test
./tool/bazel test //test/integration/submitqueue/extension/storage/mysql/... --test_output=streamed
make check-gazelle
make check-mocks
make lint
CI

Issue

@manjari25
manjari25 requested review from a team and sbalabanov as code owners October 13, 2026 19:44
@manjari25
manjari25 marked this pull request as draft October 13, 2026 19:47
@manjari25
manjari25 force-pushed the manjari/tango-signature-store-mysql branch from 06ebfe1 to 91a0be2 Compare October 14, 2026 02:08
@manjari25
manjari25 marked this pull request as ready for review October 14, 2026 18:09
@manjari25
manjari25 added this pull request to stack #872 October 14, 2026 21:02

This branch has not been deployed

No deployments
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