ethereumjs-monorepo

@ethereumjs/vm / BlockBuilder

Class: BlockBuilder

Table of contents

Constructors

Properties

Accessors

Methods

Constructors

constructor

new BlockBuilder(vm, opts)

Parameters

Name Type
vm VM
opts BuildBlockOpts

Defined in

vm/src/buildBlock.ts:76

Properties

blobGasUsed

blobGasUsed: bigint = BIGINT_0

The cumulative blob gas used by the blobs in a block

Defined in

vm/src/buildBlock.ts:52


gasUsed

gasUsed: bigint = BIGINT_0

The cumulative gas used by the transactions added to the block.

Defined in

vm/src/buildBlock.ts:48

Accessors

minerValue

get minerValue(): bigint

Returns

bigint

Defined in

vm/src/buildBlock.ts:72


transactionReceipts

get transactionReceipts(): TxReceipt[]

Returns

TxReceipt[]

Defined in

vm/src/buildBlock.ts:68

Methods

addTransaction

addTransaction(tx, __namedParameters?): Promise<RunTxResult>

Run and add a transaction to the block being built. Please note that this modifies the state of the VM. Throws if the transaction’s gasLimit is greater than the remaining gas in the block.

Parameters

Name Type
tx TypedTransaction
__namedParameters Object
__namedParameters.skipHardForkValidation? boolean

Returns

Promise<RunTxResult>

Defined in

vm/src/buildBlock.ts:203


build

build(sealOpts?): Promise<Block>

This method returns the finalized block. It also:

Parameters

Name Type
sealOpts? SealBlockOpts

Returns

Promise<Block>

Defined in

vm/src/buildBlock.ts:293


getStatus

getStatus(): BlockStatus

Returns

BlockStatus

Defined in

vm/src/buildBlock.ts:128


initState

initState(): Promise<void>

Returns

Promise<void>

Defined in

vm/src/buildBlock.ts:357


logsBloom

logsBloom(): Uint8Array

Calculates and returns the logs bloom for the block.

Returns

Uint8Array

Defined in

vm/src/buildBlock.ts:142


receiptTrie

receiptTrie(): Promise<Uint8Array>

Calculates and returns the receiptTrie for the block.

Returns

Promise<Uint8Array>

Defined in

vm/src/buildBlock.ts:154


revert

revert(): Promise<void>

Reverts the checkpoint on the StateManager to reset the state from any transactions that have been run.

Returns

Promise<void>

Defined in

vm/src/buildBlock.ts:274


transactionsTrie

transactionsTrie(): Promise<Uint8Array>

Calculates and returns the transactionsTrie for the block.

Returns

Promise<Uint8Array>

Defined in

vm/src/buildBlock.ts:135