-
Notifications
You must be signed in to change notification settings - Fork 759
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
client: add new shanghai engine apis #2509
Conversation
Codecov Report
Additional details and impacted files
Flags with carried forward coverage won't be shown. Click here to find out more. |
for (const txn of block.transactions) { | ||
transactions.push('0x' + txn.serialize().toString('hex')) | ||
} |
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.
for (const txn of block.transactions) { | |
transactions.push('0x' + txn.serialize().toString('hex')) | |
} | |
const transactions = block.transactions.map((tx) => bufferToHex(tx.serialize())) ?? [] |
let withdrawals | ||
if (block._common.gteHardfork(Hardfork.Shanghai)) { | ||
withdrawals = [] | ||
for (const withdrawal of block.withdrawals!) { | ||
withdrawals.push(withdrawal.toJSON() as WithdrawalV1) | ||
} |
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.
let withdrawals | |
if (block._common.gteHardfork(Hardfork.Shanghai)) { | |
withdrawals = [] | |
for (const withdrawal of block.withdrawals!) { | |
withdrawals.push(withdrawal.toJSON() as WithdrawalV1) | |
} | |
const withdrawals = block.withdrawals?.map(wt=>wt.toJSON())??null |
we shouldn't be needing to explicity check for Shanghai as block construction would have taken care of it
message: 'Start and Count parameters cannot be less than 1', | ||
} | ||
} | ||
const currentChainHeight = (await this.chain.getCanonicalHeadHeader()).number |
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.
we should be able to use chain.latest.height or something since its build similarly, could avoid wait/load from db
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.
Good catch. Switched to this.chain.height
.
for (const block of blocks) { | ||
try { | ||
const transactions: string[] = [] | ||
for (const txn of block.transactions) { |
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.
similar simplification for transactions and withdrawals
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.
lgtm!
Nice. 👍🙂 |
Adds new engine apis
getCapabilties
endpoint defined here Engine API: introduce exchangeCapabilities ethereum/execution-apis#364getPayloadBodiesByHashV1
from heregetPayloadBodiesByRangeV1
from here