Update ERC-8180: promote contentTag to indexed topic on BAM core events#3
Open
0xrcinus wants to merge 1 commit into
Open
Update ERC-8180: promote contentTag to indexed topic on BAM core events#30xrcinus wants to merge 1 commit into
0xrcinus wants to merge 1 commit into
Conversation
Aligns BAM with ERC-8179's first-class filter key: - BlobBatchRegistered: bytes32 indexed contentTag occupies the third indexed topic; decoder demoted to unindexed event data - CalldataBatchRegistered: same layout - registerCalldataBatch gains a bytes32 contentTag parameter - Behavior clauses 12-14: verbatim binding, no-rejection validation, indexed-topic layout (breaking change) - New Rationale subsections: contentTag uniformity across blob and calldata paths, why contentTag is indexed and decoder is not - New Security Considerations: tag spoofing, null-tag discouragement, calldata griefing economics - Test Cases: new rows for contentTag verbatim emission and eth_getLogs filter behavior on both BAM events - Worked Examples and Minimal Core Implementation updated - Sepolia table reflects amended core deployment alongside legacy Breaking change: existing deployments emit the upstream layout; new deployments would emit the amended layout. Acceptable for Draft-status ERC; no on-chain coexistence path is proposed. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Promotes
contentTaginto the indexed topic set on both BAM core events (BlobBatchRegistered,CalldataBatchRegistered) and addscontentTagas a parameter onregisterCalldataBatch. This is the headline breaking change in the in-flight ERC-8180 amendments.Stacked on #2 (rename PR). Base =
erc-8180/sender-rename. After PR #2 merges, this PR's base will be retargeted tomaster.Why
ERC-8179 positions
contentTagas the first-class indexer filter key onBlobSegmentDeclared. Without this promotion, the "every BAM batch for protocol X" query has no direct filter on the BAM event itself:BlobBatchRegisteredagainst same-transactionBlobSegmentDeclaredevents by versioned hash, then read the segment'scontentTagto identify the protocol. On shared blobs with multiple declared segments under the same versioned hash, the pairing requires log-index bookkeeping to stay unambiguous, and the join is not expressible as a singleeth_getLogscall.BlobSegmentDeclaredforregisterCalldataBatch.CalldataBatchRegisteredis filterable only bydecoderorsubmitter, and payload inspection (decoding the batch to look at its in-band protocol identifier) is the only way to identify the protocol from the event log. The "anyone can read and filter" property does not hold uniformly across the two registration paths.After this PR, a single
eth_getLogscall on either BAM core event recovers every matching registration with its decoder and signature registry in one shot, no joins required. The calldata path gains protocol-identity filtering at parity with the blob path.What changes
Interface (
IERC_BAM_Core)event BlobBatchRegistered( bytes32 indexed versionedHash, address indexed submitter, - address indexed decoder, + bytes32 indexed contentTag, + address decoder, address signatureRegistry );Same shape change on
CalldataBatchRegistered.registerCalldataBatchgains abytes32 contentTagparameter.Behavior (new normative clauses 12-14)
contentTagbinding — the emitted value MUST equal the caller-supplied argument verbatim (no re-derivation, hashing, normalization, or defaulting). The topic MUST be identical acrossBlobSegmentDeclaredandBlobBatchRegisteredproduced by a singleregisterBlobBatchcall.contentTagvalidation — implementations MUST NOT reject any value.bytes32(0)is accepted at the contract layer; arequire(contentTag != 0)check is non-conforming.contentTagoccupiestopic[3];decoderandsignatureRegistryare unindexed event data. Flagged as a breaking change relative to earlier drafts in whichdecoderoccupied the third indexed slot.Why demote
decoder(and notsubmitter)Solidity caps non-anonymous events at three indexed topics. With
contentTagpromoted, one existing indexed topic must move to event data:submitteris retained because the(chainId, contentTag, submitter)attribution tuple recommended for BSS indexers (and now BAM indexers) needs to stay cheap to query.decoderis demoted because filter-by-decoderbecomes less useful as decoders converge on a small stable set, while filter-by-contentTagis the standard indexer query under ERC-8179's design.decoderindexed and leavecontentTagunindexed (forces data-level filtering for the first-class query), and (b) declare the eventsanonymousand use four indexed topics (sacrifices topic-0 dispatch, which loses more discoverability than the extra slot recovers).Security Considerations (three new subsections)
contentTagtag spoofing —contentTagis a caller-chosen label, not an ownership primitive. Indexers MUST attribute by(chainId, contentTag, submitter)and apply submitter-level trust policy.contentTagnull-tag discouragement —bytes32(0)is accepted but NOT RECOMMENDED at the application layer (mirrors ERC-8179 null-tag guidance).contentTaggriefing economics on the calldata path — calldata is cheaper per batch than the blob path, so log-spam attacks are sharper in degree though not in kind. Same attribution-tuple mitigation.Test Cases
New rows cover:
contentTagon both blob and calldata pathsbytes32(0)accepted on both paths (NOT RECOMMENDED at app layer)eth_getLogsfilter onBlobBatchRegisteredandCalldataBatchRegisteredreturns only matchingcontentTagregistrationsReference Implementation
Sepolia deployment table updated:
BlobAuthenticatedMessagingCore(0x9C4b2300…) — amended layoutSocialBlobsCore(legacy,0x11a825a0…) — retained for pre-amendment log inspectionMinimal Core Implementation reflects the new event signatures and
registerCalldataBatchparameter.Breaking-change scope
Existing deployments emit the upstream layout (decoder indexed). New deployments would emit the amended layout (contentTag indexed). No on-chain coexistence path is proposed; consumers re-key their filters against the new topic position. Acceptable for a Draft-status ERC.
Test plan
registerCalldataBatchsignature updated consistently (interface + minimal impl + worked example 2 + test cases)registerBlobBatchescontent (deferred to a follow-up PR)🤖 Generated with Claude Code