Skip to content

WithNoBaseFee will enforce base fee when GasFeeCap is not-nil #222

@zacksinclair

Description

@zacksinclair

Pseudo-code example of the issue:

vm, err := w3vm.New(
	w3vm.WithNoBaseFee(),
)

msg := w3types.Message{
	From:     ....,
	To:          ....,
	Input:     callData,
	Value:    callValue,
	Gas:       gasLimit,
	GasFeeCap: nextBlockBaseFee,
}

vm.Apply(msg)

This will result in max fee per gas less than block base fee.

Commenting out GasFeeCap will apply it successfully.

I'm curious if this is intended behavior or not. WithNoBaseFee documentation states "forces the EIP-1559 base fee to 0 for the VM" which makes me think that this isn't intended.

This issue makes testing quite a bit more tricky, as you either have to temporarily comment out GasFeeCap or try to price the base fee in test code and forks from old blocks.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions