bump contract to 2.9.0#1410
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
|
/run-security-scan |
alexcos20
left a comment
There was a problem hiding this comment.
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.
Integrate @oceanprotocol/contracts 2.9.0 — Escrow
Auth+ReLockeventsSummary
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:
Authevent gained a non-indexedaddress token(betweenpayeeandmaxLockedAmount), so indexers no longer have to infer which token an authorizationapplies to.
ReLockevent 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 callreLock/reLocksfrom the node — we onlyindex the events.
Why the code change is needed
The indexer matches logs against a hardcoded
EVENT_HASHEStable (topic0 → signature),used both as the
getLogstopic filter and for dispatch. Because theAuthsignature changed,its keccak256 topic0 changed too — the stale entry meant new-format
Authlogs would beneither fetched nor dispatched.
ReLockhad no entry at all. The ABI decode path itself needsno change:
EscrowEventProcessorbuilds itsInterfacefrom the imported 2.9.0 artifact.What's included
src/utils/constants.tsAuthtopic0 →0x5a3021f4…, signature →Auth(address,address,address,uint256,uint256,uint256); addedESCROW_RELOCKtoEVENTS,ESCROW_EVENTS, andEVENT_HASHES(0x1ccec59c…)src/components/Indexer/processor.tsReLock→EscrowEventProcessorinEVENT_PROCESSOR_MAPsrc/components/Indexer/processors/EscrowEventProcessor.tstokenon theAuthcase; added theReLockcase (payer,payee,jobId,oldAmount,newAmount,newExpiry,token)src/@types/Escrow.tsoldAmount?,newAmount?,newExpiry?toEscrowEventsrc/components/database/{Typesense,Elastic}Schemas.tsescrowschema (uint256 kept as raw strings)package.json@oceanprotocol/contractsto 2.9.0The
Authtokenreuses the existingEscrowEvent.tokenfield, and the query/read path(
GetEscrowEventsCommand,EscrowEventsHandler, theescrowHTTP route) needs no change —eventType: 'ReLock'is accepted becauseReLockis now inESCROW_EVENTS. The other fiveEscrow events (Deposit/Lock/Claimed/Canceled/Withdraw) are unchanged; their topic0s already
match the 2.9.0 ABI.
Tests
src/test/integration/escrow.test.ts: theAuthtest now also asserts the indexedtoken,and a new
indexes a ReLock eventtest creates a lock thenreLocks it and asserts theindexed
payer/payee/jobId/oldAmount/newAmount/token(and thatnewExpiryispopulated).
pass on both Typesense and Elasticsearch backends.
type-checkandlintare clean.