Skip to content

bump contract to 2.9.0#1410

Merged
alexcos20 merged 3 commits into
next-4from
feature/bundle_escrow
Jul 9, 2026
Merged

bump contract to 2.9.0#1410
alexcos20 merged 3 commits into
next-4from
feature/bundle_escrow

Conversation

@alexcos20

@alexcos20 alexcos20 commented Jul 9, 2026

Copy link
Copy Markdown
Member

Integrate @oceanprotocol/contracts 2.9.0 — Escrow Auth + ReLock events

Summary

Updates the indexer to the Escrow contract shipped in @oceanprotocol/contracts@2.9.0
(contracts#1031, "add bundles &
relocks"). Two indexer-relevant changes landed on-chain:

  • The Auth event gained a non-indexed address token (between payee and
    maxLockedAmount), so indexers no longer have to infer which token an authorization
    applies to.
  • A new ReLock event is emitted when a payee adjusts an active lock's amount/expiry.

This PR wires both into the existing Escrow indexing pipeline. It does not adopt the new
bundle entrypoints (bundle, bundleJobs) or call reLock/reLocks from the node — we only
index the events.

Why the code change is needed

The indexer matches logs against a hardcoded EVENT_HASHES table (topic0 → signature),
used both as the getLogs topic filter and for dispatch. Because the Auth signature changed,
its keccak256 topic0 changed too — the stale entry meant new-format Auth logs would be
neither fetched nor dispatched. ReLock had no entry at all. The ABI decode path itself needs
no change: EscrowEventProcessor builds its Interface from the imported 2.9.0 artifact.

What's included

Area Change
src/utils/constants.ts Auth topic0 → 0x5a3021f4…, signature → Auth(address,address,address,uint256,uint256,uint256); added ESCROW_RELOCK to EVENTS, ESCROW_EVENTS, and EVENT_HASHES (0x1ccec59c…)
src/components/Indexer/processor.ts Registered ReLockEscrowEventProcessor in EVENT_PROCESSOR_MAP
src/components/Indexer/processors/EscrowEventProcessor.ts Store token on the Auth case; added the ReLock case (payer, payee, jobId, oldAmount, newAmount, newExpiry, token)
src/@types/Escrow.ts Added oldAmount?, newAmount?, newExpiry? to EscrowEvent
src/components/database/{Typesense,Elastic}Schemas.ts Declared the three new fields on the escrow schema (uint256 kept as raw strings)
package.json Bumped @oceanprotocol/contracts to 2.9.0

The Auth token reuses the existing EscrowEvent.token field, and the query/read path
(GetEscrowEventsCommand, EscrowEventsHandler, the escrow HTTP route) needs no change —
eventType: 'ReLock' is accepted because ReLock is now in ESCROW_EVENTS. The other five
Escrow events (Deposit/Lock/Claimed/Canceled/Withdraw) are unchanged; their topic0s already
match the 2.9.0 ABI.

Tests

  • src/test/integration/escrow.test.ts: the Auth test now also asserts the indexed token,
    and a new indexes a ReLock event test creates a lock then reLocks it and asserts the
    indexed payer/payee/jobId/oldAmount/newAmount/token (and that newExpiry is
    populated).
  • Verified end-to-end against Barge running the contracts: 7/7 escrow integration tests
    pass
    on both Typesense and Elasticsearch backends. type-check and lint are clean.

Note: reLock's expiry is a duration-from-now capped by creationTimestamp + maxLockSeconds,
so the ReLock test passes a value below maxLockSeconds to leave headroom for the wall-clock
time spent waiting on the Lock event to index.

@coderabbitai

coderabbitai Bot commented Jul 9, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 965dc8e0-4d70-4098-8205-d988451a56c4

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/bundle_escrow

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@alexcos20

Copy link
Copy Markdown
Member Author

/run-security-scan

@alexcos20 alexcos20 left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

AI automated code review (Gemini 3).

Overall risk: low

Summary:
The PR successfully upgrades @oceanprotocol/contracts to v2.9.0 and implements indexer support for the new ReLock escrow event, along with the updated Auth event signature. Database schemas (Elasticsearch and Typesense), event processors, and constants have been seamlessly updated to reflect the new on-chain event properties. The addition of the new integration test thoroughly exercises the updated functionality. LGTM!

Comments:
• [INFO][style] Excellent work keeping the event processing simple and strictly mapping the new ReLock event properties using the existing addr and num type-safe helper functions.
• [INFO][other] Great addition of integration tests for the reLock transaction. Using real contract interactions to ensure the indexer captures the newly emitted events guarantees strong end-to-end reliability.
• [INFO][other] Good catch on updating the EVENT_HASHES for ESCROW_AUTH to reflect the newly added address parameter. Keeping these synchronized perfectly aligns the indexer with the v2.9.0 ABI.

@alexcos20
alexcos20 merged commit 0e007d8 into next-4 Jul 9, 2026
26 of 28 checks passed
@alexcos20
alexcos20 deleted the feature/bundle_escrow branch July 9, 2026 06:00
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