Skip to content

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

Merged
manjari25 merged 2 commits into
manjari/tango-signature-entities-and-contractsfrom
manjari/tango-signature-store-mysql
Oct 16, 2026
Merged

manjari25 merged 2 commits 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 SignatureStore contract from the previous PR on MySQL, as a package owned by the tango conflict extension.

What?

Everything is added under submitqueue/extension/conflict/tango/mysql:

  • 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 SignatureStore:
    • A duplicate create maps to storage.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 tango.TargetSignature.
  • Adds the schema directory to the queueshard linter so the new table's primary key is checked.
  • Restricts the Bazel visibility of the MySQL package to the tango tree, the orchestrator service wiring, and its integration test.
  • Adds an integration suite with its own compose file, which runs the store against a real MySQL. It covers a large (100k-target) signature, a duplicate create keeping the first signature, and queue isolation.
  • The store is not added to the orchestrator Storage aggregate. Nothing constructs it yet, and wiring the schema into the compose stack, the e2e suites and the local init target is left for the PR that uses it.

Test Plan

./tool/bazel test //submitqueue/extension/conflict/tango/mysql:go_default_test
./tool/bazel test //test/integration/submitqueue/extension/conflict/tango/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
@manjari25
manjari25 force-pushed the manjari/tango-signature-store-mysql branch from 91a0be2 to fa0cf0f Compare October 15, 2026 21:50
@manjari25 manjari25 changed the title feat(storage): Add MySQL backed target signature store feat(conflict): Add MySQL backed target signature store Oct 15, 2026
Comment thread submitqueue/extension/conflict/tango/mysql/signature_codec.go
Comment thread submitqueue/extension/conflict/tango/mysql/signature_codec.go
Comment thread submitqueue/extension/conflict/tango/mysql/signature_codec.go
@manjari25
manjari25 force-pushed the manjari/tango-signature-store-mysql branch from f86d65b to 2d8623f Compare October 16, 2026 18:39
@manjari25
manjari25 added this pull request to the merge queue Oct 16, 2026
Merged via the queue into main with commit 0740b4f Oct 16, 2026
18 checks passed
@manjari25
manjari25 deleted the manjari/tango-signature-store-mysql branch October 16, 2026 18:56
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