Ethereumjs-Webserver

@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:75

Properties

blobGasUsed

blobGasUsed: bigint = BIGINT_0

The cumulative blob gas used by the blobs in a block

Defined in

vm/src/buildBlock.ts:51


gasUsed

gasUsed: bigint = BIGINT_0

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

Defined in

vm/src/buildBlock.ts:47

Accessors

minerValue

get minerValue(): bigint

Returns

bigint

Defined in

vm/src/buildBlock.ts:71


transactionReceipts

get transactionReceipts(): TxReceipt[]

Returns

TxReceipt[]

Defined in

vm/src/buildBlock.ts:67

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:202


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:292


getStatus

getStatus(): BlockStatus

Returns

BlockStatus

Defined in

vm/src/buildBlock.ts:127


initState

initState(): Promise<void>

Returns

Promise<void>

Defined in

vm/src/buildBlock.ts:356


logsBloom

logsBloom(): Uint8Array

Calculates and returns the logs bloom for the block.

Returns

Uint8Array

Defined in

vm/src/buildBlock.ts:141


receiptTrie

receiptTrie(): Promise<Uint8Array>

Calculates and returns the receiptTrie for the block.

Returns

Promise<Uint8Array>

Defined in

vm/src/buildBlock.ts:153


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:273


transactionsTrie

transactionsTrie(): Promise<Uint8Array>

Calculates and returns the transactionsTrie for the block.

Returns

Promise<Uint8Array>

Defined in

vm/src/buildBlock.ts:134