Conversation
- Improved stream handling by breaking the loop upon successful completion. - Simplified metrics update calculations. - Enhanced data continuity validation by removing unnecessary checks. - Updated transaction handling to use state defaults when necessary.
b320829 to
580e966
Compare
…plateRegistry interface
…ions refactor - Remove stale export of non-existent ./dynamic module from index.ts - Replace opts.after (BlockRef) with opts.from + opts.parentHash to match updated DataSourceStreamOptions interface
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 89 out of 97 changed files in this pull request and generated 10 comments.
Files not reviewed (1)
- processor/batch-processor/package-lock.json: Language not supported
Comments suppressed due to low confidence (3)
evm/evm-rpc/src/data-source/rpc-data-source.ts:103
ForkExceptionis thrown withblock.block.parentHash(the actual parent) passed as theparentBlockHashargument. GivenensureContinuitycomparesparentHash(expected) vsblock.block.parentHash(actual), the exception should carry the expected parent hash, otherwise the error message and rollback logic lose the mismatch information.
throw new ForkException(
block.number,
block.block.parentHash,
[{
number: block.number - 1,
hash: block.block.parentHash
}]
)
bitcoin/bitcoin-rpc/src/data-source/rpc-data-source.ts:102
- Same as in EVM:
ForkExceptionis constructed with the actualpreviousblockhash, but the continuity check compares againstparentHash(expected). Pass the expected hash into the exception (and keep the actual hashes inpreviousBlocks) so fork diagnostics/rollback can work correctly.
throw new ForkException(
block.number,
block.block.previousblockhash ?? ZERO_HASH,
[
{
number: block.number - 1,
hash: block.block.previousblockhash ?? ZERO_HASH,
},
],
)
solana/solana-rpc/src/data-source/chain-fixer.ts:163
ForkExceptionis thrown withb.block.previousBlockhashpassed as the expected parent hash argument. Since the fork is detected by comparingthis.parentHash(expected) vsb.block.previousBlockhash(actual), the exception should be constructed withthis.parentHashas the expected parent hash, andpreviousBlockspopulated with the upstream/actual chain refs.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+22
to
+30
| ```typescript | ||
| import {augmentBlock} from '@subsquid/evm-objects' | ||
| import {run} from '@subsquid/evm-stream' | ||
|
|
||
| run({ | ||
| // ... stream configuration | ||
| }, async (streamBlocks) => { | ||
| for (let block of streamBlocks) { | ||
| // Augment the block with relationships |
Comment on lines
50
to
58
| constructor( | ||
| expectedParentHash: string, | ||
| nextBlock: BlockRef, | ||
| public readonly prev: BlockRef[] | ||
| blockNumber: number, | ||
| parentBlockHash: string, | ||
| public readonly previousBlocks: BlockRef[] | ||
| ) { | ||
| assert(prev.length > 0) | ||
| let last = prev[prev.length - 1] | ||
| super(`expected ${nextBlock.number}#${nextBlock.hash} to have parent ${expectedParentHash}, but got ${last.number}#${last.hash}`) | ||
| assert(previousBlocks.length > 0) | ||
| let last = previousBlocks[previousBlocks.length - 1] | ||
| super(`expected ${blockNumber} to have parent ${last.number}#${parentBlockHash}, but got ${last.number}#${last.hash}`) | ||
| } |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…t data types Extract DataSourceBuilder, QueryBuilder and PortalEvmDataSource into dedicated modules, introduce .addQuery() accepting Query or QueryBuilder (existing .addLogs/.addTransactions/etc become aliases). Clean up data type utilities and tighten FieldSelection-driven generics. Made-with: Cursor
…isit data types Mirror the evm-stream refactor: extract DataSourceBuilder, QueryBuilder and PortalSolanaDataSource into dedicated modules, add .addQuery() accepting Query or QueryBuilder (legacy .addInstruction/.addLog/etc become aliases). Clean up data type utilities and drop now-unused field merge helper. Made-with: Cursor
Made-with: Cursor
.setFields() now fully replaces the default field selection, so the example has to list every field it actually uses. preMint (and postMint for symmetry) are needed by the swap mapping logic. Made-with: Cursor
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.
No description provided.