Skip to content

SDK 1.2#426

Merged
belopash merged 38 commits intomasterfrom
portal-api
Apr 22, 2026
Merged

SDK 1.2#426
belopash merged 38 commits intomasterfrom
portal-api

Conversation

@mo4islona
Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI review requested due to automatic review settings January 15, 2026 09:04
@mo4islona mo4islona marked this pull request as draft January 15, 2026 09:05

This comment was marked as resolved.

- 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.
@belopash belopash force-pushed the portal-api branch 2 times, most recently from b320829 to 580e966 Compare March 24, 2026 08:44
belopash added 2 commits April 6, 2026 01:13
…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
@belopash belopash marked this pull request as ready for review April 20, 2026 14:12
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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

  • ForkException is thrown with block.block.parentHash (the actual parent) passed as the parentBlockHash argument. Given ensureContinuity compares parentHash (expected) vs block.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: ForkException is constructed with the actual previousblockhash, but the continuity check compares against parentHash (expected). Pass the expected hash into the exception (and keep the actual hashes in previousBlocks) 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

  • ForkException is thrown with b.block.previousBlockhash passed as the expected parent hash argument. Since the fork is detected by comparing this.parentHash (expected) vs b.block.previousBlockhash (actual), the exception should be constructed with this.parentHash as the expected parent hash, and previousBlocks populated with the upstream/actual chain refs.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread test/solana-example/src/main.ts
Comment thread processor/batch-processor/package-lock.json Outdated
Comment thread evm/evm-stream/src/portal/schema.ts Outdated
Comment thread test/erc20-transfers/package.json
Comment thread evm/evm-stream/package.json Outdated
Comment thread util/util-internal-data-source/src/index.ts Outdated
Comment thread graphql/graphql-server/src/server.ts Outdated
Comment thread processor/batch-processor/src/util.ts Outdated
Comment thread evm/evm-objects/README.md
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}`)
}
belopash and others added 4 commits April 20, 2026 17:59
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
.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
@belopash belopash merged commit 1b0d331 into master Apr 22, 2026
1 check failed
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.

3 participants