Fix t8n response cancun fields: rename currentBlobGasUsed to blobGasUsed

This commit is contained in:
jangko 2023-10-24 21:22:49 +07:00
parent 63ff17efbf
commit 35ee171013
No known key found for this signature in database
GPG Key ID: 31702AE10541E6B9
8 changed files with 24 additions and 24 deletions

View File

@ -443,7 +443,7 @@ proc `@@`*(x: ExecutionResult): JsonNode =
result["currentBaseFee"] = @@(x.currentBaseFee)
if x.withdrawalsRoot.isSome:
result["withdrawalsRoot"] = @@(x.withdrawalsRoot)
if x.currentBlobGasUsed.isSome:
result["currentBlobGasUsed"] = @@(x.currentBlobGasUsed)
if x.currentExcessBlobGas.isSome:
result["currentExcessBlobGas"] = @@(x.currentExcessBlobGas)
if x.blobGasUsed.isSome:
result["blobGasUsed"] = @@(x.blobGasUsed)

View File

@ -16,7 +16,7 @@
"gasUsed": "0x0",
"currentBaseFee": "0x500",
"withdrawalsRoot": "0x4921c0162c359755b2ae714a0978a1dad2eb8edce7ff9b38b9b6fc4cbc547eb5",
"currentBlobGasUsed": "0x0",
"currentExcessBlobGas": "0x0"
"currentExcessBlobGas": "0x0",
"blobGasUsed": "0x0"
}
}

View File

@ -41,6 +41,6 @@
"currentBaseFee": "0x9",
"withdrawalsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
"currentExcessBlobGas": "0x0",
"currentBlobGasUsed": "0x20000"
"blobGasUsed": "0x20000"
}
}

View File

@ -6,7 +6,7 @@
"storage" : {
}
},
"0xbEac00dDB15f3B6d645C48263dC93862413A222D" : {
"0x000F3df6D732807Ef1319fB7B8bB8522d0Beac02" : {
"balance" : "0x1",
"code" : "0x3373fffffffffffffffffffffffffffffffffffffffe14604457602036146024575f5ffd5b620180005f350680545f35146037575f5ffd5b6201800001545f5260205ff35b6201800042064281555f359062018000015500",
"nonce" : "0x00",

View File

@ -1,6 +1,6 @@
{
"alloc": {
"0xbeac00ddb15f3b6d645c48263dc93862413a222d": {
"0x000f3df6d732807ef1319fb7b8bb8522d0beac02": {
"code": "0x3373fffffffffffffffffffffffffffffffffffffffe14604457602036146024575f5ffd5b620180005f350680545f35146037575f5ffd5b6201800001545f5260205ff35b6201800042064281555f359062018000015500",
"storage": {
"0x000000000000000000000000000000000000000000000000000000000000079e": "0x000000000000000000000000000000000000000000000000000000000000079e",
@ -14,7 +14,7 @@
}
},
"result": {
"stateRoot": "0x2db9f6bc233e8fd0af2d8023404493a19b37d9d69ace71f4e73158851fced574",
"stateRoot": "0x19a4f821a7c0a6f4c934f9acb0fe9ce5417b68086e12513ecbc3e3f57e01573c",
"txRoot": "0x248074fabe112f7d93917f292b64932394f835bb98da91f21501574d58ec92ab",
"receiptsRoot": "0xf78dfb743fbd92ade140711c8bbc542b5e307f0ab7984eff35d751969fe57efa",
"logsHash": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
@ -39,6 +39,6 @@
"currentBaseFee": "0x9",
"withdrawalsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
"currentExcessBlobGas": "0x0",
"currentBlobGasUsed": "0x0"
"blobGasUsed": "0x0"
}
}

View File

@ -1,29 +1,29 @@
## EIP 4788
This test contains testcases for EIP-4788. The 4788-contract is
located at address `0xbeac00ddb15f3b6d645c48263dc93862413a222d`, and this test executes a simple transaction. It also
located at address `0x000F3df6D732807Ef1319fB7B8bB8522d0Beac02`, and this test executes a simple transaction. It also
implicitly invokes the system tx, which sets calls the contract and sets the
storage values
```
$ dir=./testdata/29/ && go run . t8n --state.fork=Cancun --input.alloc=$dir/alloc.json --input.txs=$dir/txs.json --input.env=$dir/env.json --output.alloc=stdout
INFO [08-15|20:07:56.335] Trie dumping started root=ecde45..2af8a7
INFO [08-15|20:07:56.335] Trie dumping complete accounts=2 elapsed="225.848µs"
INFO [08-15|20:07:56.335] Wrote file file=result.json
INFO [09-27|15:34:53.049] Trie dumping started root=19a4f8..01573c
INFO [09-27|15:34:53.049] Trie dumping complete accounts=2 elapsed="192.759µs"
INFO [09-27|15:34:53.050] Wrote file file=result.json
{
"alloc": {
"0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b": {
"balance": "0x16345785d871db8",
"nonce": "0x1"
},
"0xbeac00541d49391ed88abf392bfc1f4dea8c4143": {
"0x000f3df6d732807ef1319fb7b8bb8522d0beac02": {
"code": "0x3373fffffffffffffffffffffffffffffffffffffffe14604457602036146024575f5ffd5b620180005f350680545f35146037575f5ffd5b6201800001545f5260205ff35b6201800042064281555f359062018000015500",
"storage": {
"0x000000000000000000000000000000000000000000000000000000000000079e": "0x000000000000000000000000000000000000000000000000000000000000079e",
"0x000000000000000000000000000000000000000000000000000000000001879e": "0x0000beac00beac00beac00beac00beac00beac00beac00beac00beac00beac00"
},
"balance": "0x
"balance": "0x1"
},
"0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b": {
"balance": "0x16345785d871db8",
"nonce": "0x1"
}
}
}
```

View File

@ -306,7 +306,7 @@ proc exec(ctx: var TransContext,
)
if fork >= FkCancun:
result.result.currentBlobGasUsed = some blobGasUsed
result.result.blobGasUsed = some blobGasUsed
if ctx.env.currentExcessBlobGas.isSome:
result.result.currentExcessBlobGas = ctx.env.currentExcessBlobGas
elif ctx.env.parentExcessBlobGas.isSome and ctx.env.parentBlobGasUsed.isSome:

View File

@ -97,7 +97,7 @@ type
gasUsed*: GasInt
currentBaseFee*: Option[UInt256]
withdrawalsRoot*: Option[Hash256]
currentBlobGasUsed*: Option[uint64]
blobGasUsed*: Option[uint64]
currentExcessBlobGas*: Option[uint64]
const