-
Notifications
You must be signed in to change notification settings - Fork 153
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Evm ingestion reform #255
Draft
tmcgroul
wants to merge
5
commits into
master
Choose a base branch
from
evm-reform
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Evm ingestion reform #255
Changes from 4 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
{ | ||
"name": "@subsquid/evm-data", | ||
"version": "0.0.0", | ||
"description": "EVM data definition and fetching", | ||
"license": "GPL-3.0-or-later", | ||
"repository": "[email protected]:subsquid/squid.git", | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"files": [ | ||
"lib", | ||
"src" | ||
], | ||
"main": "lib/index.js", | ||
"scripts": { | ||
"build": "rm -rf lib && tsc", | ||
"test": "node lib/test.js" | ||
}, | ||
"dependencies": { | ||
"@subsquid/logger": "^1.3.3", | ||
"@subsquid/util-internal": "^3.0.0", | ||
"@subsquid/util-internal-ingest-tools": "^1.1.1", | ||
"@subsquid/util-internal-range": "^0.2.0", | ||
"@subsquid/util-internal-validation": "^0.3.0" | ||
}, | ||
"peerDependencies": { | ||
"@subsquid/rpc-client": "^4.6.0" | ||
}, | ||
"devDependencies": { | ||
"@subsquid/rpc-client": "^4.6.0", | ||
"@types/node": "^18.18.14", | ||
"typescript": "~5.3.2" | ||
} | ||
} |
File renamed without changes.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './base' |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,205 @@ | ||
import {Bytes, Bytes20, Bytes32, Bytes8} from '../base' | ||
|
||
|
||
export interface BlockHeader { | ||
height: number | ||
hash: Bytes32 | ||
parentHash: Bytes32 | ||
nonce?: Bytes8 | ||
sha3Uncles?: Bytes32 | ||
logsBloom?: Bytes | ||
transactionsRoot?: Bytes32 | ||
stateRoot?: Bytes32 | ||
receiptsRoot?: Bytes32 | ||
mixHash?: Bytes | ||
miner?: Bytes20 | ||
difficulty?: bigint | ||
totalDifficulty?: bigint | ||
extraData?: Bytes | ||
size?: bigint | ||
gasLimit?: bigint | ||
gasUsed?: bigint | ||
timestamp?: number | ||
baseFeePerGas?: bigint | ||
/** | ||
* This field is not supported by all currently deployed archives. | ||
* Requesting it may cause internal error. | ||
*/ | ||
l1BlockNumber?: number | ||
} | ||
|
||
|
||
export interface Transaction extends _Tx, _TxReceipt { | ||
transactionIndex: number | ||
sighash: Bytes | ||
} | ||
|
||
|
||
export interface _Tx { | ||
hash: Bytes32 | ||
from: Bytes20 | ||
to?: Bytes20 | ||
gas?: bigint | ||
gasPrice?: bigint | ||
maxFeePerGas?: bigint | ||
maxPriorityFeePerGas?: bigint | ||
input: Bytes | ||
nonce?: number | ||
value?: bigint | ||
v?: bigint | ||
r?: Bytes32 | ||
s?: Bytes32 | ||
yParity?: number | ||
chainId?: number | ||
} | ||
|
||
|
||
export interface _TxReceipt { | ||
gasUsed?: bigint | ||
cumulativeGasUsed?: bigint | ||
effectiveGasPrice?: bigint | ||
contractAddress?: Bytes32 | ||
type?: number | ||
status?: number | ||
} | ||
|
||
|
||
export interface Log { | ||
logIndex: number | ||
transactionIndex: number | ||
transactionHash: Bytes32 | ||
address: Bytes20 | ||
data: Bytes | ||
topics: Bytes32[] | ||
} | ||
|
||
|
||
export interface TraceBase { | ||
transactionIndex: number | ||
traceAddress: number[] | ||
subtraces: number | ||
error: string | null | ||
revertReason?: string | ||
} | ||
|
||
|
||
export interface TraceCreate extends TraceBase { | ||
type: 'create' | ||
action: TraceCreateAction | ||
result?: TraceCreateResult | ||
} | ||
|
||
|
||
export interface TraceCreateAction { | ||
from: Bytes20 | ||
value: bigint | ||
gas: bigint | ||
init: Bytes | ||
} | ||
|
||
|
||
export interface TraceCreateResult { | ||
gasUsed: bigint | ||
code: Bytes | ||
address: Bytes20 | ||
} | ||
|
||
|
||
export interface TraceCall extends TraceBase { | ||
type: 'call' | ||
action: TraceCallAction | ||
result?: TraceCallResult | ||
} | ||
|
||
|
||
export interface TraceCallAction { | ||
callType: string | ||
from: Bytes20 | ||
to: Bytes20 | ||
value?: bigint | ||
gas: bigint | ||
input: Bytes | ||
sighash: Bytes | ||
} | ||
|
||
|
||
export interface TraceCallResult { | ||
gasUsed: bigint | ||
output: Bytes | ||
} | ||
|
||
|
||
export interface TraceSuicide extends TraceBase { | ||
type: 'suicide' | ||
action: TraceSuicideAction | ||
} | ||
|
||
|
||
export interface TraceSuicideAction { | ||
address: Bytes20 | ||
refundAddress: Bytes20 | ||
balance: bigint | ||
} | ||
|
||
|
||
export interface TraceReward extends TraceBase { | ||
type: 'reward' | ||
action: TraceRewardAction | ||
} | ||
|
||
|
||
export interface TraceRewardAction { | ||
author: Bytes20 | ||
value: bigint | ||
type: string | ||
} | ||
|
||
|
||
export type Trace = TraceCreate | TraceCall | TraceSuicide | TraceReward | ||
|
||
|
||
export interface StateDiffBase { | ||
transactionIndex: number | ||
address: Bytes20 | ||
key: 'balance' | 'code' | 'nonce' | Bytes32 | ||
} | ||
|
||
|
||
export interface StateDiffNoChange extends StateDiffBase { | ||
kind: '=' | ||
prev?: null | ||
next?: null | ||
} | ||
|
||
|
||
export interface StateDiffAdd extends StateDiffBase { | ||
kind: '+' | ||
prev?: null | ||
next: Bytes | ||
} | ||
|
||
|
||
export interface StateDiffChange extends StateDiffBase { | ||
kind: '*' | ||
prev: Bytes | ||
next: Bytes | ||
} | ||
|
||
|
||
export interface EvmStateDiffDelete extends StateDiffBase { | ||
kind: '-' | ||
prev: Bytes | ||
next?: null | ||
} | ||
|
||
|
||
export type StateDiff = StateDiffNoChange | StateDiffAdd | StateDiffChange | EvmStateDiffDelete | ||
|
||
|
||
export interface Block { | ||
header: BlockHeader | ||
transactions: Transaction[] | ||
logs: Log[] | ||
traces: Trace[] | ||
stateDiffs: StateDiff[] | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export * from './data' | ||
export * from './mapping' |
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this file is almost identical copy of evm.ts from evm-processor. this one has more fields marked as optional