Skip to content

Commit

Permalink
Check for 7685 before adding requests
Browse files Browse the repository at this point in the history
  • Loading branch information
acolytec3 committed Apr 29, 2024
1 parent 0d6feaf commit 6f07126
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/block/test/header.spec.ts
Expand Up @@ -162,7 +162,7 @@ describe('[Block]: Header functions', () => {
})

it('Initialization -> fromValuesArray() -> error cases', () => {
const headerArray = Array(21).fill(new Uint8Array(0))
const headerArray = Array(22).fill(new Uint8Array(0))

// mock header data (if set to zeros(0) header throws)
headerArray[0] = zeros(32) //parentHash
Expand Down
7 changes: 4 additions & 3 deletions packages/vm/src/buildBlock.ts
Expand Up @@ -320,10 +320,10 @@ export class BlockBuilder {
blobGasUsed = this.blobGasUsed
}

const requests = await accumulateRequests(this.vm)

let requestsRoot = undefined
let requests
let requestsRoot
if (this.vm.common.isActivatedEIP(7685)) {
const requests = await accumulateRequests(this.vm)
requestsRoot = await Block.genRequestsTrieRoot(requests)
// Do other validations per request type
}
Expand Down Expand Up @@ -353,6 +353,7 @@ export class BlockBuilder {
withdrawals: this.withdrawals,
requests,
}
console.log(blockData)
const block = Block.fromBlockData(blockData, blockOpts)

if (this.blockOpts.putBlockIntoBlockchain === true) {
Expand Down

0 comments on commit 6f07126

Please sign in to comment.