@argonprotocol/mainchain 1.6.0-dev.63af99c7 → 1.6.0-dev.feb29b52

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -103,11 +103,13 @@ locators or `buildGatewayActivityStorageProofs(...)` with captured locators. Cap
103
103
  independent; a runtime may accept either format.
104
104
 
105
105
  ```ts
106
+ const cache = new Map<bigint, CapturedGatewayActivityStorageProof>();
106
107
  const captures = await captureGatewayActivityStorageProofs({
107
108
  executionClient,
108
109
  executionBlock: await executionClient.getBlock({ blockTag: 'latest' }),
109
110
  gatewayAddress,
110
111
  locators,
112
+ cache,
111
113
  });
112
114
  // Persist captures in the app, then prepare relay transactions when anchors become available.
113
115
  const result = await buildGatewayActivityProof(client, {
@@ -117,6 +119,12 @@ const result = await buildGatewayActivityProof(client, {
117
119
  });
118
120
  ```
119
121
 
122
+ The optional `cache` is scoped to one Ethereum chain and gateway and keyed by locator index. Restore
123
+ it from persisted captures to refresh a witness without fetching historical logs again. Capture
124
+ always fetches a new storage witness and verifies the cached raw events against its locator
125
+ commitment; cache misses load logs normally. The map is updated only after every selected capture
126
+ verifies. Persist the updated captures in the app.
127
+
120
128
  Storage proofs include the full locator's activity logs and its `activityRootSeed`, even when the
121
129
  last proven nonce falls inside that locator. Only `payload.activities` and
122
130
  `payload.gatewayActivityNonceRange` describe the newly applied suffix. No bootstrap call or stored