-
Notifications
You must be signed in to change notification settings - Fork 5k
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
Added EIP-4844 Headers for BlockHeaderOutput. Issue: 6933 #6937
Changes from all commits
740bd93
804ee89
ec6a4fc
d0a63c3
38a5b21
8fdfa11
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -236,46 +236,55 @@ export const transactionInfoSchema = { | |
}, | ||
}; | ||
|
||
export const blockSchema = { | ||
export const withdrawalsSchema = { | ||
type: 'object', | ||
properties: { | ||
parentHash: { | ||
format: 'bytes32', | ||
}, | ||
sha3Uncles: { | ||
format: 'bytes32', | ||
index: { | ||
format: 'uint', | ||
}, | ||
miner: { | ||
format: 'bytes', | ||
validatorIndex: { | ||
format: 'uint', | ||
}, | ||
stateRoot: { | ||
format: 'bytes32', | ||
address: { | ||
format: 'address', | ||
}, | ||
transactionsRoot: { | ||
format: 'bytes32', | ||
amount: { | ||
format: 'uint', | ||
}, | ||
receiptsRoot: { | ||
format: 'bytes32', | ||
}, | ||
}; | ||
|
||
export const blockSchema = { | ||
type: 'object', | ||
properties: { | ||
baseFeePerGas: { | ||
format: 'uint', | ||
}, | ||
logsBloom: { | ||
format: 'bytes256', | ||
blobGasUsed: { | ||
format: 'uint', | ||
}, | ||
difficulty: { | ||
format: 'uint', | ||
}, | ||
number: { | ||
excessBlobGas: { | ||
format: 'uint', | ||
}, | ||
extraData: { | ||
format: 'bytes', | ||
}, | ||
gasLimit: { | ||
format: 'uint', | ||
}, | ||
gasUsed: { | ||
format: 'uint', | ||
}, | ||
timestamp: { | ||
format: 'uint', | ||
hash: { | ||
format: 'bytes32', | ||
}, | ||
extraData: { | ||
logsBloom: { | ||
format: 'bytes256', | ||
}, | ||
miner: { | ||
format: 'bytes', | ||
}, | ||
mixHash: { | ||
|
@@ -284,15 +293,33 @@ export const blockSchema = { | |
nonce: { | ||
format: 'uint', | ||
}, | ||
totalDifficulty: { | ||
number: { | ||
format: 'uint', | ||
}, | ||
baseFeePerGas: { | ||
format: 'uint', | ||
parentBeaconBlockRoot: { | ||
format: 'bytes32', | ||
}, | ||
parentHash: { | ||
format: 'bytes32', | ||
}, | ||
receiptsRoot: { | ||
format: 'bytes32', | ||
}, | ||
sha3Uncles: { | ||
format: 'bytes32', | ||
}, | ||
size: { | ||
format: 'uint', | ||
}, | ||
stateRoot: { | ||
format: 'bytes32', | ||
}, | ||
timestamp: { | ||
format: 'uint', | ||
}, | ||
totalDifficulty: { | ||
format: 'uint', | ||
}, | ||
Comment on lines
+299
to
+322
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. these fields are already in current schema but this PR is only rearranging these to diff lines. |
||
transactions: { | ||
oneOf: [ | ||
{ | ||
|
@@ -309,123 +336,123 @@ export const blockSchema = { | |
}, | ||
], | ||
}, | ||
transactionsRoot: { | ||
format: 'bytes32', | ||
}, | ||
uncles: { | ||
type: 'array', | ||
items: { | ||
format: 'bytes32', | ||
}, | ||
}, | ||
hash: { | ||
withdrawals: { | ||
type: 'array', | ||
items: { | ||
...withdrawalsSchema, | ||
}, | ||
}, | ||
withdrawalsRoot: { | ||
format: 'bytes32', | ||
}, | ||
}, | ||
}; | ||
|
||
export const withdrawalsSchema = { | ||
export const blockHeaderSchema = { | ||
type: 'object', | ||
properties: { | ||
index: { | ||
format: 'uint', | ||
author: { | ||
format: 'bytes32', | ||
}, | ||
validatorIndex: { | ||
excessDataGas: { | ||
format: 'uint', | ||
}, | ||
address: { | ||
format: 'address', | ||
}, | ||
amount: { | ||
baseFeePerGas: { | ||
format: 'uint', | ||
}, | ||
}, | ||
}; | ||
|
||
export const blockHeaderSchema = { | ||
type: 'object', | ||
properties: { | ||
author: { | ||
format: 'bytes32', | ||
}, | ||
hash: { | ||
format: 'bytes32', | ||
blobGasUsed: { | ||
format: 'uint', | ||
}, | ||
parentHash: { | ||
format: 'bytes32', | ||
difficulty: { | ||
format: 'uint', | ||
}, | ||
receiptsRoot: { | ||
format: 'bytes32', | ||
excessBlobGas: { | ||
format: 'uint', | ||
}, | ||
miner: { | ||
extraData: { | ||
format: 'bytes', | ||
}, | ||
stateRoot: { | ||
format: 'bytes32', | ||
gasLimit: { | ||
format: 'uint', | ||
}, | ||
transactionsRoot: { | ||
format: 'bytes32', | ||
gasUsed: { | ||
format: 'uint', | ||
}, | ||
withdrawalsRoot: { | ||
hash: { | ||
format: 'bytes32', | ||
}, | ||
logsBloom: { | ||
format: 'bytes256', | ||
}, | ||
difficulty: { | ||
format: 'uint', | ||
}, | ||
totalDifficulty: { | ||
format: 'uint', | ||
miner: { | ||
format: 'bytes', | ||
}, | ||
number: { | ||
format: 'uint', | ||
mixHash: { | ||
format: 'bytes32', | ||
}, | ||
gasLimit: { | ||
nonce: { | ||
format: 'uint', | ||
}, | ||
gasUsed: { | ||
number: { | ||
format: 'uint', | ||
}, | ||
timestamp: { | ||
format: 'uint', | ||
parentBeaconBlockRoot: { | ||
format: 'bytes32', | ||
}, | ||
extraData: { | ||
format: 'bytes', | ||
parentHash: { | ||
format: 'bytes32', | ||
}, | ||
nonce: { | ||
format: 'uint', | ||
receiptsRoot: { | ||
format: 'bytes32', | ||
}, | ||
sha3Uncles: { | ||
format: 'bytes32', | ||
}, | ||
size: { | ||
format: 'uint', | ||
}, | ||
baseFeePerGas: { | ||
format: 'uint', | ||
stateRoot: { | ||
format: 'bytes32', | ||
}, | ||
excessDataGas: { | ||
timestamp: { | ||
format: 'uint', | ||
}, | ||
mixHash: { | ||
format: 'bytes32', | ||
totalDifficulty: { | ||
format: 'uint', | ||
}, | ||
transactions: { | ||
type: 'array', | ||
items: { | ||
format: 'bytes32', | ||
}, | ||
}, | ||
transactionsRoot: { | ||
format: 'bytes32', | ||
}, | ||
uncles: { | ||
type: 'array', | ||
items: { | ||
format: 'bytes32', | ||
}, | ||
}, | ||
withdrawals: { | ||
withdrawals: { | ||
type: 'array', | ||
items: { | ||
...withdrawalsSchema, | ||
}, | ||
}, | ||
withdrawalsRoot: { | ||
format: 'bytes32', | ||
}, | ||
}, | ||
}; | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -130,9 +130,16 @@ export interface BlockInput { | |
readonly baseFeePerGas?: HexString; | ||
} | ||
|
||
export interface Withdrawals { | ||
readonly index: Numbers; | ||
readonly validatorIndex: Numbers; | ||
readonly address: Address; | ||
readonly amount: Numbers; | ||
} | ||
|
||
export interface BlockOutput { | ||
readonly gasLimit: bigint | number; | ||
readonly gasUsed: bigint | number; | ||
readonly gasLimit: bigint | number; | ||
readonly gasUsed: bigint | number; | ||
readonly size: bigint | number; | ||
readonly timestamp: bigint | number; | ||
readonly number?: bigint | number; | ||
|
@@ -142,44 +149,57 @@ export interface BlockOutput { | |
readonly miner?: HexString; | ||
readonly baseFeePerGas?: bigint | number; | ||
readonly parentHash?: HexString32Bytes; | ||
} | ||
|
||
export interface Withdrawals { | ||
readonly index: Numbers; | ||
readonly validatorIndex: Numbers; | ||
readonly address: Address; | ||
readonly amount: Numbers; | ||
// Added properties | ||
readonly blobGasUsed?: bigint | number; | ||
readonly excessBlobGas?: bigint | number; | ||
readonly extraData?: Bytes; | ||
readonly hash?: HexString32Bytes; | ||
readonly logsBloom?: Bytes; | ||
readonly nonce?: bigint | number; | ||
readonly parentBeaconBlockRoot?: HexString32Bytes; | ||
readonly receiptsRoot?: HexString32Bytes; | ||
readonly sha3Uncles: HexString32Bytes[]; | ||
readonly stateRoot?: HexString32Bytes; | ||
readonly transactionsRoot?: HexString32Bytes; | ||
readonly withdrawalsRoot?: HexString32Bytes; | ||
readonly mixHash?: HexString32Bytes; | ||
readonly uncles?: Uncles; | ||
readonly withdrawals?: Withdrawals[]; | ||
} | ||
|
||
export interface BlockHeaderOutput { | ||
readonly hash?: HexString32Bytes; | ||
readonly parentHash?: HexString32Bytes; | ||
readonly receiptsRoot?: HexString32Bytes; | ||
readonly miner?: HexString; | ||
readonly stateRoot?: HexString32Bytes; | ||
readonly transactionsRoot?: HexString32Bytes; | ||
readonly withdrawalsRoot?: HexString32Bytes; | ||
readonly logsBloom?: Bytes; | ||
readonly difficulty?: Numbers; | ||
readonly number?: Numbers; | ||
readonly gasLimit: Numbers; | ||
readonly gasUsed: Numbers; | ||
readonly timestamp: Numbers; | ||
readonly extraData?: Bytes; | ||
readonly nonce?: Numbers; | ||
readonly sha3Uncles: HexString32Bytes[]; | ||
readonly baseFeePerGas?: Numbers; | ||
|
||
// These fields are returned when the RPC client is Nethermind, | ||
// but aren't available in other clients such as Geth | ||
readonly author?: Address; | ||
readonly totalDifficulty?: Numbers; | ||
readonly size?: Numbers; | ||
readonly excessDataGas?: Numbers; | ||
readonly mixHash?: HexString32Bytes; | ||
readonly transactions?: TransactionOutput[]; | ||
readonly uncles?: Uncles; | ||
readonly withdrawals?: Withdrawals[]; | ||
readonly baseFeePerGas?: Numbers; | ||
readonly blobGasUsed?: Numbers; | ||
readonly difficulty?: Numbers; | ||
readonly excessBlobGas?: Numbers; | ||
readonly extraData?: Bytes; | ||
readonly gasLimit: Numbers; | ||
readonly gasUsed: Numbers; | ||
readonly hash?: HexString32Bytes; | ||
readonly logsBloom?: Bytes; | ||
readonly miner?: HexString; | ||
readonly nonce?: Numbers; | ||
readonly number?: Numbers; | ||
readonly parentBeaconBlockRoot?: HexString32Bytes; | ||
readonly parentHash?: HexString32Bytes; | ||
readonly receiptsRoot?: HexString32Bytes; | ||
readonly sha3Uncles: HexString32Bytes[]; | ||
readonly stateRoot?: HexString32Bytes; | ||
readonly timestamp: Numbers; | ||
readonly transactionsRoot?: HexString32Bytes; | ||
readonly withdrawalsRoot?: HexString32Bytes; | ||
|
||
// These fields are returned when the RPC client is Nethermind, | ||
// but aren't available in other clients such as Geth | ||
readonly author?: Address; | ||
readonly totalDifficulty?: Numbers; | ||
readonly size?: Numbers; | ||
readonly excessDataGas?: Numbers; | ||
readonly mixHash?: HexString32Bytes; | ||
readonly transactions?: TransactionOutput[]; | ||
readonly uncles?: Uncles; | ||
readonly withdrawals?: Withdrawals[]; | ||
Comment on lines
+172
to
+202
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is also rearranging most of field except adding ( eip 4844, 4895, 4788 )s |
||
} | ||
|
||
export interface ReceiptInput { | ||
|
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.
reference: ethereum/execution-apis@057892b#diff-7c184b1c6b52b3ebe701b069a613639ad30699c60b9b352be78b64ac0206f424R82