Skip to content
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

Fix blobGas fields handling in t8n and evmstate #1767

Merged
merged 2 commits into from
Sep 22, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Fix blobGas fields handling in t8n
  • Loading branch information
jangko committed Sep 22, 2023
commit 7ee862ab3fc5e9ed1929fd8011d309c899bd7402
12 changes: 4 additions & 8 deletions tools/t8n/transition.nim
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import
../../nimbus/core/eip4844,
../../nimbus/evm/tracer/json_tracer

import stew/byteutils
const
wrapExceptionEnabled* {.booldefine.} = true
stdinSelector = "stdin"
Expand Down Expand Up @@ -311,7 +310,10 @@ proc exec(ctx: var TransContext,

if fork >= FkCancun:
result.result.currentBlobGasUsed = some blobGasUsed
result.result.currentExcessBlobGas = some calcExcessBlobGas(vmState.parent)
if ctx.env.currentExcessBlobGas.isSome:
result.result.currentExcessBlobGas = ctx.env.currentExcessBlobGas
elif ctx.env.parentExcessBlobGas.isSome and ctx.env.parentBlobGasUsed.isSome:
result.result.currentExcessBlobGas = some calcExcessBlobGas(vmState.parent)

template wrapException(body: untyped) =
when wrapExceptionEnabled:
Expand Down Expand Up @@ -434,12 +436,6 @@ proc transitionAction*(ctx: var TransContext, conf: T8NConf) =
raise newError(ErrorConfig, "Shanghai config but missing 'withdrawals' in env section")

if com.isCancunOrLater(ctx.env.currentTimestamp):
if ctx.env.parentBlobGasUsed.isNone:
raise newError(ErrorConfig, "Cancun config but missing 'parentBlobGasUsed' in env section")

if ctx.env.parentExcessBlobGas.isNone:
raise newError(ErrorConfig, "Cancun config but missing 'parentExcessBlobGas' in env section")

if ctx.env.parentBeaconBlockRoot.isNone:
raise newError(ErrorConfig, "Cancun config but missing 'parentBeaconBlockRoot' in env section")

Expand Down