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
Contributor

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
alexcos20 added a commit that referenced this pull request Aug 28, 2026
* Shared Hardware Resource Pool for Compute Environments (#1390)

* shared hw resources

* Add Services (#1402)

* services

* bump contract to 2.9.0 (#1410)

* bump contract to 2.9.0

* cross-node auth tokens (#1404)

* cross-node auth tokens

* new validate auth token method

* stateless

* fix comment reviews

* revert to ask remote node

* finite number expiry + oom protection

* fix test

* remove meax ttl

* add peerid for signature check

* issuerpeerid on create auth token only

---------

Co-authored-by: alexcos20 <alex.coseru@gmail.com>

* Update src/components/Auth/index.ts

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* Update src/components/Auth/index.ts

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* fix network recreate (#1416)

* add cpuList (#1417)

* add cpuList

* services updates (#1422)

* Service lifecycle hardening

* remove axios (#1424)

* remove axios

* Feature/use native sqlite (#1423)

* use native sql

* resources constrains (#1425)

* resources constrains

* New updatedAt record for services (#1428)

* add updatedAt

* fix review comments

* lint

* allow docker specs on service restart (#1429)

* add more templates

* fix stable diffusion template

* fix extend service (#1435)

* new arg "release" for stop service (#1434)

* fix bugs

* fix comment

* add database retry

* add envs, validations, tests

* fix return type

* remove timeout

* fix review

* fix type

* Authenticate `PolicyServerPassthrough` / `initializePSVerification`, and stop logging credentials (#1449)

* Authenticate `PolicyServerPassthrough` / `initializePSVerification`, and stop logging credentials

* Feature/docker stats (#1436)

* docker stats

* remove serviceEndpoints (#1448)

* use custom ocean.js/cli

* fix merge errors

* Dependency and toolchain refresh (#1453)

* updates

* bump node version

* fix review

* use correct ocean.js branch

* workflows comfy (#1442)

* workflows comfy

* fix template

* fix download

* split in two bundles

* workflow id

* multiscene test

* multishoot v2

* fix v2

* v3 try

* voice concat

* update ugc product template to include new fields necessary on dashboard

* concat voices too

* install missing services

* cut to new scene

* remove sizeGb

* cleanup

* readd sizegb and schema

* minimax flow

* simplify

* minimax h3 v2

* v3 h3

* h3 v4

* image defaults

* speed improvement

* fixes

* fix box sizes

* fix corrupt model download

* new carachters

* fix tail sound

* add prompt creation model

* add minimax-music3 template

* ltx 2.5

* space out boxes ltx 2.5

* fix template id

* simplify flow

* fix bugs

* fix wrong img size

* fixes from official docs

* fix input out of range

* minimax h3 fix models

* fix new carachters

* minimax fixes

* find old videos

* fixes ltx 2.5

* try open github minimax flow

* live preview

* allinone fixes

* portarait mode

* more allinone fixes

* fix extend video

* fix libraries

* add muse, qwen38 templates

* fix openweb ui bootstrap

* remove pre configured admin

* fix muse tag

* ui flows

* add glm 5.2 template

* remove comment

* remove incorrect comment

* ecommerce flow fixes

* update templates to run with opencode

* adapt description

* text changes

* fixes ecom

* fixes for ecom

* fixes for ecom

* update glm5.2 template

* reduce context

* add glm5.2 template

* add deepseek harness

* update harness template

* update deepseek template

* update template

* update template

* use bucket snapshot

* deepseek fix

* remove hardcoded flows

* fix dockerfile and path

* update deepseek template

* add other type

* fix prettier

* update mamba version

* remove templates

* remove muse-glimmer

* remove files

* remove Agents.md

* fix coderabbit comments

---------

Co-authored-by: Denis <61563365+dnsi0@users.noreply.github.com>
Co-authored-by: alexcos20 <alex.coseru@gmail.com>

* Fix: indexer silently skipping DDOs on transient provider errors (#1458)

* fix indexer provider

* bump to node 24 (#1454)

* bump to node 24

* guard fix

* p2p_improve (#1455)

* add metrics (#1456)
* keep C2D running when the metadata DB is unreachable (#1457)

* guard ddo metadata

* fix ocean.js branch

* make  "Failed to advertise queued" and Caught "The operation was aborted" while republishing debug events, as they are not errors

* use proper ocean-cli branch

* add helper script

* fix ci

---------

Co-authored-by: Giurgiu Razvan <giurgiur99@gmail.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: Denis <61563365+dnsi0@users.noreply.github.com>
Co-authored-by: Bogdan Fazakas <bogdan.fazakas@gmail.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