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

Migrate to blobGas in execution-spec-tests #5745

Merged
merged 2 commits into from
Aug 2, 2023
Merged
Show file tree
Hide file tree
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
Prev Previous commit
missed some t8n tests.
Moral of the story: unit tests work.

Signed-off-by: Danno Ferrin <danno.ferrin@swirldslabs.com>
  • Loading branch information
shemnon committed Aug 2, 2023
commit 71836793fa5ca0f463334e121b9b532dfdd136cf
Original file line number Diff line number Diff line change
Expand Up @@ -407,10 +407,13 @@ static T8nResult runTest(
.getDataGasUsed()
.ifPresentOrElse(
bgu -> resultObject.put("blobGasUsed", Bytes.ofUnsignedLong(bgu).toQuantityHexString()),
() -> resultObject.put("blobGasUsed", "0x0"));
() ->
blockHeader
.getExcessDataGas()
.ifPresent(ebg -> resultObject.put("blobGasUsed", "0x0")));
blockHeader
.getExcessDataGas()
.ifPresent(ebg -> resultObject.put("currentExcessBlobGas", ebg.toHexString()));
.ifPresent(ebg -> resultObject.put("currentExcessBlobGas", ebg.toShortHexString()));

ObjectNode allocObject = objectMapper.createObjectNode();
worldState
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@
"ommers": [],
"withdrawals": [],
"parentUncleHash": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
"parentDataGasUsed": "0",
"parentExcessDataGas": "0"
"parentBlobGasUsed": "0",
"parentExcessBlobGas": "0"
}
},
"stdout": {
Expand Down Expand Up @@ -108,7 +108,9 @@
"currentDifficulty": null,
"gasUsed": "0x127bb",
"currentBaseFee": "0x7",
"withdrawalsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421"
"withdrawalsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
"blobGasUsed": "0x0",
"currentExcessBlobGas": "0x0"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -62,52 +62,54 @@
"ommers": [],
"withdrawals": [],
"parentUncleHash": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
"parentDataGasUsed": "0",
"parentExcessDataGas": "0"
"parentBlobGasUsed": "0",
"parentExcessBlobGas": "0"
}
},
"stdout": {
"alloc" : {
"0x095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
"code" : "0x3060005530ff00",
"storage" : {
"0x0000000000000000000000000000000000000000000000000000000000000000" : "0x000000000000000000000000095e7baea6a6c7c4c2dfeb977efac326af552d87"
"alloc": {
"0x095e7baea6a6c7c4c2dfeb977efac326af552d87": {
"code": "0x3060005530ff00",
"storage": {
"0x0000000000000000000000000000000000000000000000000000000000000000": "0x000000000000000000000000095e7baea6a6c7c4c2dfeb977efac326af552d87"
},
"balance" : "0xde0b6b3a76586a0"
"balance": "0xde0b6b3a76586a0"
},
"0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : {
"balance" : "0x233c1"
"0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba": {
"balance": "0x233c1"
},
"0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
"balance" : "0xde0b6b3a75b2232",
"nonce" : "0x1"
"0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b": {
"balance": "0xde0b6b3a75b2232",
"nonce": "0x1"
}
},
"body" : "0xf865f863800a830f424094095e7baea6a6c7c4c2dfeb977efac326af552d87830186a0801ca07bb4986663aec020c016ea3db37ba36e62e9c7d355dc8ed8566b20ce7452b600a07da62397d8a969f674442837f419001f2671df0f19a45586ed3acfd93e819d82",
"result" : {
"stateRoot" : "0xddd3a541e86e2dd0293959736de63e1fad74ae95149f34740b1173378e82527a",
"txRoot" : "0x0cbd46498d79551ba2f4237443d408194f7493f1fd567dbeaf1d53b41b41485a",
"receiptsRoot" : "0xbc67bed8ee77b1d9dd8eb6d6e55abd11e49c50e16832f0c350ae07027c859f19",
"logsHash" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
"logsBloom" : "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"receipts" : [
"body": "0xf865f863800a830f424094095e7baea6a6c7c4c2dfeb977efac326af552d87830186a0801ca07bb4986663aec020c016ea3db37ba36e62e9c7d355dc8ed8566b20ce7452b600a07da62397d8a969f674442837f419001f2671df0f19a45586ed3acfd93e819d82",
"result": {
"stateRoot": "0xddd3a541e86e2dd0293959736de63e1fad74ae95149f34740b1173378e82527a",
"txRoot": "0x0cbd46498d79551ba2f4237443d408194f7493f1fd567dbeaf1d53b41b41485a",
"receiptsRoot": "0xbc67bed8ee77b1d9dd8eb6d6e55abd11e49c50e16832f0c350ae07027c859f19",
"logsHash": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"receipts": [
{
"root" : "0x",
"status" : "0x1",
"cumulativeGasUsed" : "0xbbeb",
"logsBloom" : "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"logs" : null,
"transactionHash" : "0xa87c1a093fe07f3d38db9cde21d05b407f527e88f7c698c9008b6138119d2487",
"contractAddress" : "0x0000000000000000000000000000000000000000",
"gasUsed" : "0xbbeb",
"blockHash" : "0x0000000000000000000000000000000000000000000000000000000000000000",
"transactionIndex" : "0x0"
"root": "0x",
"status": "0x1",
"cumulativeGasUsed": "0xbbeb",
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"logs": null,
"transactionHash": "0xa87c1a093fe07f3d38db9cde21d05b407f527e88f7c698c9008b6138119d2487",
"contractAddress": "0x0000000000000000000000000000000000000000",
"gasUsed": "0xbbeb",
"blockHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"transactionIndex": "0x0"
}
],
"currentDifficulty" : null,
"gasUsed" : "0xbbeb",
"currentBaseFee" : "0x7",
"withdrawalsRoot" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421"
"currentDifficulty": null,
"gasUsed": "0xbbeb",
"currentBaseFee": "0x7",
"withdrawalsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
"blobGasUsed": "0x0",
"currentExcessBlobGas": "0x0"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@
"ommers": [],
"withdrawals": [],
"parentUncleHash": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
"parentDataGasUsed": "0",
"parentExcessDataGas": "0"
"parentBlobGasUsed": "0",
"parentExcessBlobGas": "0"
}
},
"stdout": {
Expand Down Expand Up @@ -92,7 +92,9 @@
"currentDifficulty": null,
"gasUsed": "0x181c6",
"currentBaseFee": "0x7",
"withdrawalsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421"
"withdrawalsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
"blobGasUsed": "0x0",
"currentExcessBlobGas": "0x0"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"input": "0x",
"to": "0x0000000000000000000000000000000000000100",
"accessList": [],
"maxFeePerDataGas": "0x1",
"maxFeePerBlobGas": "0x1",
"sender": "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b",
"blobVersionedHashes": [
"0x0100000000000000000000000000000000000000000000000000000000000000"
Expand Down Expand Up @@ -65,8 +65,8 @@
"ommers": [],
"withdrawals": [],
"parentUncleHash": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
"currentExcessDataGas": "0",
"currentDataGasUsed": "0"
"currentExcessBlobGas": "0",
"currentBlobGasUsed": "0"
}
},
"stdout": {
Expand Down Expand Up @@ -109,7 +109,9 @@
"currentDifficulty": null,
"gasUsed": "0x5208",
"currentBaseFee": "0x7",
"withdrawalsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421"
"withdrawalsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
"blobGasUsed": "0x0",
"currentExcessBlobGas": "0x0"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ public ReferenceTestEnv(
@JsonProperty("withdrawals") final List<EnvWithdrawal> withdrawals,
@JsonProperty("blockHashes") final Map<String, String> blockHashes,
@JsonProperty("currentExcessBlobGas") final String currentExcessBlobGas,
Fixed Show fixed Hide fixed
@JsonProperty("currentBobGasUsed") final String currentBlobGasUsed,
@JsonProperty("currentBlobGasUsed") final String currentBlobGasUsed,
@JsonProperty("parentExcessBlobGas") final String parentExcessBlobGas,
@JsonProperty("parentBlobGasUsed") final String parentBlobGasUsed,
@JsonProperty("beaconRoot") final String beaconRoot) {
Expand All @@ -137,8 +137,8 @@ public ReferenceTestEnv(
Optional.ofNullable(random).map(Difficulty::fromHexString).orElse(Difficulty.ZERO),
0L,
null, // withdrawalsRoot
null, // dataGasUsed
null, // excessDataGas
currentBlobGasUsed == null ? null : Long.decode(currentBlobGasUsed),

Check notice

Code scanning / CodeQL

Missing catch of NumberFormatException

Potential uncaught 'java.lang.NumberFormatException'.
currentExcessBlobGas == null ? null : DataGas.fromHexString(currentExcessBlobGas),
null, // depositsRoot
new MainnetBlockHeaderFunctions());
this.parentDifficulty = parentDifficulty;
Expand Down