Skip to content

Conversation

@mo4islona
Copy link
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
Copy link

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

This PR introduces "SDK 1.2", a major refactoring that migrates the Solana and EVM data streaming architecture from the old Gateway/Archive + RPC approach to a unified SQD Network Portal-based system. The changes include new packages for EVM streams/objects, a new shared data source abstraction, updates to the batch processor to support hot/unfinalized blocks, and comprehensive updates to example code.

Changes:

  • Introduces new packages: @subsquid/util-internal-data-source, @subsquid/evm-stream, and @subsquid/evm-objects
  • Refactors @subsquid/solana-stream to use Portal client instead of Gateway + RPC
  • Updates @subsquid/batch-processor to support hot blocks and fork handling
  • Renames slot/height fields to standardized number field across Solana packages

Reviewed changes

Copilot reviewed 63 out of 64 changed files in this pull request and generated 10 comments.

Show a summary per file
File Description
util/util-internal-data-source/* New package defining shared DataSource abstraction with BlockRef, fork handling, and stream interfaces
solana/solana-stream/src/source.ts Major refactor from Gateway+RPC to Portal-only architecture with simplified API
solana/solana-stream/src/portal/* New Portal-based data source implementation replacing old archive/RPC sources
evm/evm-stream/* New package for EVM data streaming using Portal client
evm/evm-objects/* New package providing augmented EVM data model with relationships
processor/batch-processor/src/run.ts Enhanced to support hot blocks, fork navigation, and finalized/unfinalized streams
processor/batch-processor/src/database.ts Updated interface to support hot block databases with fork management
test/erc20-transfers/src/processor.ts Updated example to use new EVM stream API
test/solana-example/src/main.ts Updated example to use new Portal-based API
solana/solana-normalization/src/* Renamed slot to number for consistency
solana/solana-objects/src/* Updated to use number instead of height
Files not reviewed (1)
  • common/config/rush/pnpm-lock.yaml: Language not supported
Comments suppressed due to low confidence (2)

solana/solana-stream/src/portal/schema.ts:134

  • Unnecessary parentheses around the array() calls. These can be removed for cleaner code: transactions: array(Transaction), etc.
    evm/evm-stream/src/data/model.ts:1
  • The height field is marked as deprecated in favor of number, but both fields have the same value (line 145: height: number,). This creates confusion as users might not understand which to use. Consider adding a JSDoc comment explaining that height is maintained for backwards compatibility and equals number.
import type {

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

*
* @example
* source.setGateway('https://v2.archive.subsquid.io/network/solana-mainnet')
* source.setGateway('https://portal.sqd.dev/datasets/solana-mainnet')
Copy link

Copilot AI Jan 15, 2026

Choose a reason for hiding this comment

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

The JSDoc example still references the old method name setGateway but the method has been renamed to setPortal. Update the example to use source.setPortal('https://portal.sqd.dev/datasets/solana-mainnet').

Copilot uses AI. Check for mistakes.
Comment on lines +28 to +29
// FIXME: maybe it's better to pass it ias an option to `getStream`
getFinalizedStream(req: DataSourceStreamOptions): AsyncIterable<BlockBatch<B>>
Copy link

Copilot AI Jan 15, 2026

Choose a reason for hiding this comment

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

Corrected spelling of 'ias' to 'as'.

Copilot uses AI. Check for mistakes.
@@ -0,0 +1,91 @@
import {Bytes, FieldSelection} from '@subsquid/evm-stream'
Copy link

Copilot AI Jan 15, 2026

Choose a reason for hiding this comment

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

Unused import Bytes.

Suggested change
import {Bytes, FieldSelection} from '@subsquid/evm-stream'
import {FieldSelection} from '@subsquid/evm-stream'

Copilot uses AI. Check for mistakes.
@@ -0,0 +1,400 @@
import {Bytes, Bytes20, Bytes32, Bytes8} from '@subsquid/evm-stream'
Copy link

Copilot AI Jan 15, 2026

Choose a reason for hiding this comment

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

Unused import Bytes8.

Suggested change
import {Bytes, Bytes20, Bytes32, Bytes8} from '@subsquid/evm-stream'
import {Bytes, Bytes20, Bytes32} from '@subsquid/evm-stream'

Copilot uses AI. Check for mistakes.
Comment on lines +10 to +18
import {
EIP7702Authorization,
EvmTraceCallAction,
EvmTraceCallResult,
EvmTraceCreateAction,
EvmTraceCreateResult,
EvmTraceRewardAction,
EvmTraceSuicideAction
} from '@subsquid/evm-stream/lib/data/evm'
Copy link

Copilot AI Jan 15, 2026

Choose a reason for hiding this comment

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

Unused import EIP7702Authorization.

Copilot uses AI. Check for mistakes.
Comment on lines +1 to +7
import {DEFAULT_FIELDS, FieldSelection} from './model'
import {Selector} from './type-util'


function merge<Keys extends string>(def: Selector<Keys>, requested: Selector<Keys> = {}): Selector<Keys> {
let fields: Selector<Keys> = {}

Copy link

Copilot AI Jan 15, 2026

Choose a reason for hiding this comment

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

Unused imports DEFAULT_FIELDS, FieldSelection.

Suggested change
import {DEFAULT_FIELDS, FieldSelection} from './model'
import {Selector} from './type-util'
function merge<Keys extends string>(def: Selector<Keys>, requested: Selector<Keys> = {}): Selector<Keys> {
let fields: Selector<Keys> = {}
import {Selector} from './type-util'
function merge<Keys extends string>(def: Selector<Keys>, requested: Selector<Keys> = {}): Selector<Keys> {
let fields: Selector<Keys> = {}

Copilot uses AI. Check for mistakes.
Comment on lines +4 to +23

function merge<Keys extends string>(def: Selector<Keys>, requested: Selector<Keys> = {}): Selector<Keys> {
let fields: Selector<Keys> = {}

for (let key in def) {
if (requested[key] !== false) {
fields[key] = def[key]
}
}

for (let key in requested) {
if (requested[key]) {
fields[key] = true
}
}

return fields
}


Copy link

Copilot AI Jan 15, 2026

Choose a reason for hiding this comment

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

Unused function merge.

Suggested change
function merge<Keys extends string>(def: Selector<Keys>, requested: Selector<Keys> = {}): Selector<Keys> {
let fields: Selector<Keys> = {}
for (let key in def) {
if (requested[key] !== false) {
fields[key] = def[key]
}
}
for (let key in requested) {
if (requested[key]) {
fields[key] = true
}
}
return fields
}

Copilot uses AI. Check for mistakes.
Comment on lines +2 to +14
import {
ANY,
array,
ANY_INT,
BOOLEAN,
BYTES,
constant,
NAT,
object,
oneOf,
option,
STRING
} from '@subsquid/util-internal-validation'
Copy link

Copilot AI Jan 15, 2026

Choose a reason for hiding this comment

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

Unused imports ANY, BOOLEAN.

Copilot uses AI. Check for mistakes.
import * as prom from 'prom-client'
import {Database, HashAndHeight} from './database'
import {DataSource} from './datasource'
import {HashAndHeight, Database, HotDatabaseState} from './database'
Copy link

Copilot AI Jan 15, 2026

Choose a reason for hiding this comment

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

Unused import HotDatabaseState.

Copilot uses AI. Check for mistakes.
@@ -0,0 +1,77 @@
import assert from 'assert'
import {Range} from '@subsquid/util-internal-range'
Copy link

Copilot AI Jan 15, 2026

Choose a reason for hiding this comment

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

Unused import Range.

Copilot uses AI. Check for mistakes.
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