From e0f6dd90652721da8849011513f6984b67e12633 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Olivier=20B=C3=A9gassat?= Date: Tue, 26 Nov 2024 21:58:25 +0700 Subject: [PATCH 01/44] first commit --- .../fragment/common/CommonFragmentValues.java | 1 - .../module/hub/section/CreateSection.java | 5 ++++ .../createTests/nontrivial/Tests.java | 20 ++++++++++++++++ .../createTests/trivial/RootLevel.java | 22 +++++++++++++++++ .../createTests/trivial/todo.md | 24 +++++++++++++++++++ 5 files changed, 71 insertions(+), 1 deletion(-) create mode 100644 arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/nontrivial/Tests.java create mode 100644 arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/trivial/RootLevel.java create mode 100644 arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/trivial/todo.md diff --git a/arithmetization/src/main/java/net/consensys/linea/zktracer/module/hub/fragment/common/CommonFragmentValues.java b/arithmetization/src/main/java/net/consensys/linea/zktracer/module/hub/fragment/common/CommonFragmentValues.java index f335d77a18..fe4bcdbcd1 100644 --- a/arithmetization/src/main/java/net/consensys/linea/zktracer/module/hub/fragment/common/CommonFragmentValues.java +++ b/arithmetization/src/main/java/net/consensys/linea/zktracer/module/hub/fragment/common/CommonFragmentValues.java @@ -258,7 +258,6 @@ public long computeGasNext(short exceptions) { final long gasAfterDeductingCost = computeGasRemaining() - computeGasCost(); OpCode opCode = hub.opCode(); - GasProjection gasUtility = Hub.GAS_PROJECTOR.of(hub.messageFrame(), opCode); return switch (hub.opCodeData().instructionFamily()) { case KEC, COPY, STACK_RAM, STORAGE, LOG, HALT -> gasAfterDeductingCost; diff --git a/arithmetization/src/main/java/net/consensys/linea/zktracer/module/hub/section/CreateSection.java b/arithmetization/src/main/java/net/consensys/linea/zktracer/module/hub/section/CreateSection.java index 535c4bb37e..300a639ac0 100644 --- a/arithmetization/src/main/java/net/consensys/linea/zktracer/module/hub/section/CreateSection.java +++ b/arithmetization/src/main/java/net/consensys/linea/zktracer/module/hub/section/CreateSection.java @@ -220,6 +220,11 @@ public CreateSection(Hub hub, MessageFrame frame) { // Finally, non-exceptional, non-aborting, non-failing, non-emptyInitCode create //////////////////////////////////////////////////////////////////////////////// + // we charge for the gas paid out of pocked + final long gasMinusUpfrontGasCost = commonValues.gasNext(); + final long gasPaidOutOfPocket = Hub.GAS_PROJECTOR.of(frame, hub.opCode()).gasPaidOutOfPocket(); + commonValues.gasNext(gasMinusUpfrontGasCost - gasPaidOutOfPocket); + // we capture revert information about the child context: CCSR and CCRS hub.defers().scheduleForContextReEntry(imcFragment, hub.currentFrame()); diff --git a/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/nontrivial/Tests.java b/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/nontrivial/Tests.java new file mode 100644 index 0000000000..3c2a6ef893 --- /dev/null +++ b/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/nontrivial/Tests.java @@ -0,0 +1,20 @@ +/* + * Copyright Consensys Software Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 + */ +package net.consensys.linea.zktracer.instructionprocessing.createTests.nontrivial; + +public class Tests { + + +} diff --git a/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/trivial/RootLevel.java b/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/trivial/RootLevel.java new file mode 100644 index 0000000000..58db5a185d --- /dev/null +++ b/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/trivial/RootLevel.java @@ -0,0 +1,22 @@ +/* + * Copyright Consensys Software Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 + */ +package net.consensys.linea.zktracer.instructionprocessing.createTests.trivial; + +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; + +public class RootLevel { + +} diff --git a/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/trivial/todo.md b/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/trivial/todo.md new file mode 100644 index 0000000000..ea4ab088fe --- /dev/null +++ b/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/trivial/todo.md @@ -0,0 +1,24 @@ +# Definitions + +Trivial CREATE's are those creates that are +- unexceptional +- don't abort +- don't raise the failure condition **F** +- but deploy with empty initialization code + +# Parameters + +In terms of the parameters we can play with we find: +- CREATE vs CREATE2 +- zero value vs nonzero value +- WILL_REVERT vs WONT_REVERT +- root level or higher level +- zero size, huge offset shenanigans + +We _could_ also consider collisions via CREATE2 or through multi transactions and SELFDESTRUCT's. +This will be the focus of other tests. We should also measure the interaction that these trivial deployments have with EXTCODEHASH. +Furthermore, we should see how these deployments squash any return data (if present.) And then there is obviously the question of deployment numbers, deployment statuses. + +- EXTCODEHASH before and after +- squashing of return data and RETURNDATASIZE +- warmth post deployment (EXTCODEXXX + BALANCE + CALL's + SELFDESTRUCT heir + ...) From 0c986fe41a889321f13ca0efcd0dfd1dcfdd7e22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Olivier=20B=C3=A9gassat?= Date: Wed, 27 Nov 2024 13:00:06 +0700 Subject: [PATCH 02/44] ras --- .../module/hub/fragment/common/CommonFragmentValues.java | 2 -- .../zktracer/instructionprocessing/createTests/trivial/todo.md | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/arithmetization/src/main/java/net/consensys/linea/zktracer/module/hub/fragment/common/CommonFragmentValues.java b/arithmetization/src/main/java/net/consensys/linea/zktracer/module/hub/fragment/common/CommonFragmentValues.java index fe4bcdbcd1..03d38c928c 100644 --- a/arithmetization/src/main/java/net/consensys/linea/zktracer/module/hub/fragment/common/CommonFragmentValues.java +++ b/arithmetization/src/main/java/net/consensys/linea/zktracer/module/hub/fragment/common/CommonFragmentValues.java @@ -257,8 +257,6 @@ public long computeGasNext(short exceptions) { final long gasAfterDeductingCost = computeGasRemaining() - computeGasCost(); - OpCode opCode = hub.opCode(); - return switch (hub.opCodeData().instructionFamily()) { case KEC, COPY, STACK_RAM, STORAGE, LOG, HALT -> gasAfterDeductingCost; case CREATE -> gasAfterDeductingCost; diff --git a/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/trivial/todo.md b/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/trivial/todo.md index ea4ab088fe..8272354204 100644 --- a/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/trivial/todo.md +++ b/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/trivial/todo.md @@ -1,6 +1,6 @@ # Definitions -Trivial CREATE's are those creates that are +Trivial CREATE's are those CREATE's that are - unexceptional - don't abort - don't raise the failure condition **F** From 20448957b21466cdf1eedf2ec40b1f9361b523b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Olivier=20B=C3=A9gassat?= Date: Wed, 27 Nov 2024 13:00:19 +0700 Subject: [PATCH 03/44] feat: wip tests --- .../createTests/CreateType.java | 20 +++++ .../createTests/OffsetParameter.java | 24 ++++++ .../createTests/SizeParameter.java | 24 ++++++ .../createTests/ValueParameter.java | 22 +++++ .../createTests/WhenToTestParameter.java | 21 +++++ .../createTests/trivial/RootLevel.java | 86 +++++++++++++++++++ 6 files changed, 197 insertions(+) create mode 100644 arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/CreateType.java create mode 100644 arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/OffsetParameter.java create mode 100644 arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/SizeParameter.java create mode 100644 arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/ValueParameter.java create mode 100644 arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/WhenToTestParameter.java diff --git a/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/CreateType.java b/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/CreateType.java new file mode 100644 index 0000000000..7fd4279e60 --- /dev/null +++ b/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/CreateType.java @@ -0,0 +1,20 @@ +/* + * Copyright Consensys Software Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 + */ +package net.consensys.linea.zktracer.instructionprocessing.createTests; + +public enum CreateType { + CREATE, + CREATE2 +} diff --git a/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/OffsetParameter.java b/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/OffsetParameter.java new file mode 100644 index 0000000000..f22299f965 --- /dev/null +++ b/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/OffsetParameter.java @@ -0,0 +1,24 @@ +/* + * Copyright Consensys Software Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 + */ +package net.consensys.linea.zktracer.instructionprocessing.createTests; + +public enum OffsetParameter { + ZERO, + THREE, + SIXTEEN, + SIXTEEN_BYTE_INT, + THIRTY_TWO_BYTE_INT, + MAX, +} diff --git a/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/SizeParameter.java b/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/SizeParameter.java new file mode 100644 index 0000000000..9df96f94a0 --- /dev/null +++ b/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/SizeParameter.java @@ -0,0 +1,24 @@ +/* + * Copyright Consensys Software Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 + */ +package net.consensys.linea.zktracer.instructionprocessing.createTests; + +public enum SizeParameter { + ZERO, + TWELVE, // - 3 - 1 + THIRTEEN, // - 3 + 0 + FOURTEEN, // - 3 + 1 + THIRTY_TWO, + MSIZE, +} diff --git a/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/ValueParameter.java b/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/ValueParameter.java new file mode 100644 index 0000000000..e420ac8079 --- /dev/null +++ b/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/ValueParameter.java @@ -0,0 +1,22 @@ +/* + * Copyright Consensys Software Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 + */ +package net.consensys.linea.zktracer.instructionprocessing.createTests; + +public enum ValueParameter { + ZERO, + ONE, + SELFBALANCE, + SELFBALANCE_PLUS_ONE, +} diff --git a/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/WhenToTestParameter.java b/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/WhenToTestParameter.java new file mode 100644 index 0000000000..e2062b0fa8 --- /dev/null +++ b/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/WhenToTestParameter.java @@ -0,0 +1,21 @@ +/* + * Copyright Consensys Software Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 + */ +package net.consensys.linea.zktracer.instructionprocessing.createTests; + +public enum WhenToTestParameter { + BEFORE, + AFTER, + BEFORE_AND_AFTER +} diff --git a/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/trivial/RootLevel.java b/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/trivial/RootLevel.java index 58db5a185d..32e2b685e4 100644 --- a/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/trivial/RootLevel.java +++ b/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/trivial/RootLevel.java @@ -14,9 +14,95 @@ */ package net.consensys.linea.zktracer.instructionprocessing.createTests.trivial; +import net.consensys.linea.testing.BytecodeCompiler; +import net.consensys.linea.zktracer.instructionprocessing.createTests.*; +import net.consensys.linea.zktracer.opcode.OpCode; import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; +import java.util.ArrayList; +import java.util.List; +import java.util.stream.Stream; + +import static net.consensys.linea.zktracer.instructionprocessing.createTests.WhenToTestParameter.BEFORE; +import static net.consensys.linea.zktracer.instructionprocessing.createTests.WhenToTestParameter.BEFORE_AND_AFTER; +import static net.consensys.linea.zktracer.opcode.OpCode.*; + public class RootLevel { + public String salt01 = "5a1701"; + public String salt02 = "5a1702"; + + @ParameterizedTest + @MethodSource("createParametersForEmptyCreates") + void rootLevelCreateTests( + CreateType createType, + ValueParameter valueParameter, + OffsetParameter offsetParameter, + boolean revert) { + + } + + void rootLevelCreate2AndExtCodeHash( + WhenToTestParameter when + ) { + + int storageKey = 0; + BytecodeCompiler program = BytecodeCompiler.newProgram(); + precomputeAndStoreCreate2DeploymentAddress(program, salt01, storageKey); + + if (when == BEFORE || when == BEFORE_AND_AFTER) { + } + } + + private static Stream createParametersForEmptyCreates() { + + final List valueParameters = List.of(ValueParameter.ZERO, ValueParameter.ONE); + + List arguments = new ArrayList<>(); + + for (CreateType createType : CreateType.values()) { + for (ValueParameter valueParameter : valueParameters) { + for (OffsetParameter offsetParameter : OffsetParameter.values()) { + arguments.add(Arguments.of(createType, valueParameter, offsetParameter, true)); + arguments.add(Arguments.of(createType, valueParameter, offsetParameter, false)); + } + } + } + + return arguments.stream(); + } + + public static void precomputeAndStoreCreate2DeploymentAddress(BytecodeCompiler program, String salt, int storageKey) { + program + .push(0xff) + .push(0) + .op(MSTORE8); // (255) + program + .op(OpCode.ADDRESS) + .push(8 * 12) + .op(SHL) + .push(1) + .op(MSTORE); + program + .push(salt) + .push(21) + .op(MSTORE); // salt + program + .push(0) + .push(0) + .op(SHA3) + .push(53) + .op(MSTORE); // init code hash = KECCAK(( )) + program + .push(85) // 1 + 20 + 32 + 32 + .push(0) + .op(SHA3); // extract raw address + program + .push("000000000000000000000000ffffffffffffffffffffffffffffffffffffffff") + .op(AND) // computes deployment address + .push(storageKey) + .op(SSTORE); // SSTORE address at key = 0 + } } From a271c07f4f8d8274591b111ca79b7a375156780d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Olivier=20B=C3=A9gassat?= Date: Wed, 27 Nov 2024 13:23:30 +0700 Subject: [PATCH 04/44] feat: root level CREATE tests --- .../createTests/trivial/RootLevel.java | 87 +++++++++++++++++-- 1 file changed, 80 insertions(+), 7 deletions(-) diff --git a/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/trivial/RootLevel.java b/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/trivial/RootLevel.java index 32e2b685e4..c3131fbdc6 100644 --- a/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/trivial/RootLevel.java +++ b/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/trivial/RootLevel.java @@ -15,16 +15,19 @@ package net.consensys.linea.zktracer.instructionprocessing.createTests.trivial; import net.consensys.linea.testing.BytecodeCompiler; +import net.consensys.linea.testing.BytecodeRunner; import net.consensys.linea.zktracer.instructionprocessing.createTests.*; import net.consensys.linea.zktracer.opcode.OpCode; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; +import org.junit.jupiter.params.provider.EnumSource; import org.junit.jupiter.params.provider.MethodSource; import java.util.ArrayList; import java.util.List; import java.util.stream.Stream; +import static net.consensys.linea.zktracer.instructionprocessing.createTests.CreateType.CREATE2; import static net.consensys.linea.zktracer.instructionprocessing.createTests.WhenToTestParameter.BEFORE; import static net.consensys.linea.zktracer.instructionprocessing.createTests.WhenToTestParameter.BEFORE_AND_AFTER; import static net.consensys.linea.zktracer.opcode.OpCode.*; @@ -42,18 +45,43 @@ void rootLevelCreateTests( OffsetParameter offsetParameter, boolean revert) { + BytecodeCompiler program = BytecodeCompiler.newProgram(); + genericCreate(program, createType, valueParameter, offsetParameter, SizeParameter.ZERO); + + if (revert) { + program + .push(0) + .push(0) + .op(REVERT); + } + + run(program); } - void rootLevelCreate2AndExtCodeHash( - WhenToTestParameter when - ) { + @ParameterizedTest + @EnumSource(WhenToTestParameter.class) + void rootLevelCreate2AndExtCodeHash(WhenToTestParameter when) { int storageKey = 0; BytecodeCompiler program = BytecodeCompiler.newProgram(); - precomputeAndStoreCreate2DeploymentAddress(program, salt01, storageKey); + precomputeCreate2DeploymentAddress(program, salt01, storageKey); + storeAt(program, storageKey); + + if (when == BEFORE || when == BEFORE_AND_AFTER) { + loadFromStorage(program, storageKey); + program.op(EXTCODEHASH); // we expect to see 0 + } + + genericCreate(program, CREATE2, ValueParameter.ONE, OffsetParameter.ZERO, SizeParameter.ZERO); if (when == BEFORE || when == BEFORE_AND_AFTER) { + loadFromStorage(program, storageKey); + program.op(EQ); // we expect to have the result be true here + loadFromStorage(program, storageKey); + program.op(EXTCODEHASH); // we expect to see KECCAK(( )) } + + run(program); } private static Stream createParametersForEmptyCreates() { @@ -74,7 +102,37 @@ private static Stream createParametersForEmptyCreates() { return arguments.stream(); } - public static void precomputeAndStoreCreate2DeploymentAddress(BytecodeCompiler program, String salt, int storageKey) { + public static void genericCreate(BytecodeCompiler program, CreateType type, ValueParameter valueParameter, OffsetParameter offsetParameter, SizeParameter sizeParameter) { + + switch (sizeParameter) { + case ZERO -> program.push(0); + case TWELVE -> program.push(12); + case THIRTEEN -> program.push(13); + case FOURTEEN -> program.push(14); + case THIRTY_TWO -> program.push(0x20); + case MSIZE -> program.op(MSTORE); + } + switch (offsetParameter) { + case ZERO -> program.push(0); + case THREE -> program.push(0); + case SIXTEEN -> program.push(0x10); + case SIXTEEN_BYTE_INT -> program.push("abe1245ffff123a87000a543eff12aaa"); + case THIRTY_TWO_BYTE_INT -> program.push("abe1245ffff123a87000a543eff12aaa09987582714266effffefaabc76aa758"); + case MAX -> program.push("ff".repeat(32)); + } + switch (valueParameter) { + case ZERO -> program.push(0); + case ONE -> program.push(1); + case SELFBALANCE -> program.op(SELFBALANCE); + case SELFBALANCE_PLUS_ONE -> program.op(SELFBALANCE).push(1).op(ADD); + } + switch (type) { + case CREATE -> program.op(CREATE); + case CREATE2 -> program.op(OpCode.CREATE2); + } + } + + public static void precomputeCreate2DeploymentAddress(BytecodeCompiler program, String salt, int key) { program .push(0xff) .push(0) @@ -101,8 +159,23 @@ public static void precomputeAndStoreCreate2DeploymentAddress(BytecodeCompiler p .op(SHA3); // extract raw address program .push("000000000000000000000000ffffffffffffffffffffffffffffffffffffffff") - .op(AND) // computes deployment address + .op(AND); // computes deployment address + } + + public static void storeAt(BytecodeCompiler program, int storageKey) { + program .push(storageKey) - .op(SSTORE); // SSTORE address at key = 0 + .op(SSTORE); } + + public static void loadFromStorage(BytecodeCompiler program, int storageKey) { + program + .push(storageKey) + .op(SLOAD); + } + + private void run(BytecodeCompiler program) { + BytecodeRunner.of(program).run(); + } + } From 8826713e354a1fd480493ae4fa2e2dc795dcc0c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Olivier=20B=C3=A9gassat?= Date: Wed, 27 Nov 2024 13:30:22 +0700 Subject: [PATCH 05/44] ras --- .../createTests/trivial/todo.md | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/trivial/todo.md b/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/trivial/todo.md index 8272354204..66d1b0cafe 100644 --- a/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/trivial/todo.md +++ b/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/trivial/todo.md @@ -9,11 +9,15 @@ Trivial CREATE's are those CREATE's that are # Parameters In terms of the parameters we can play with we find: -- CREATE vs CREATE2 -- zero value vs nonzero value -- WILL_REVERT vs WONT_REVERT -- root level or higher level -- zero size, huge offset shenanigans +- [ ] level + - [x] root level + - [ ] higher level +- [x] CREATE vs CREATE2 +- [x] zero value vs nonzero value +- [x] WILL_REVERT vs WONT_REVERT +- [ ] zero size + - [ ] 'zero size, huge offset' shenanigans +- [ ] nonzero size We _could_ also consider collisions via CREATE2 or through multi transactions and SELFDESTRUCT's. This will be the focus of other tests. We should also measure the interaction that these trivial deployments have with EXTCODEHASH. From 98f63a4c4bb45d9c69c098c3881f5ad14cb75463 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Olivier=20B=C3=A9gassat?= Date: Wed, 27 Nov 2024 13:38:17 +0700 Subject: [PATCH 06/44] fix: added missing salt parameter to genericCreate() --- .../createTests/trivial/RootLevel.java | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/trivial/RootLevel.java b/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/trivial/RootLevel.java index c3131fbdc6..7da08a5870 100644 --- a/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/trivial/RootLevel.java +++ b/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/trivial/RootLevel.java @@ -27,7 +27,6 @@ import java.util.List; import java.util.stream.Stream; -import static net.consensys.linea.zktracer.instructionprocessing.createTests.CreateType.CREATE2; import static net.consensys.linea.zktracer.instructionprocessing.createTests.WhenToTestParameter.BEFORE; import static net.consensys.linea.zktracer.instructionprocessing.createTests.WhenToTestParameter.BEFORE_AND_AFTER; import static net.consensys.linea.zktracer.opcode.OpCode.*; @@ -46,7 +45,7 @@ void rootLevelCreateTests( boolean revert) { BytecodeCompiler program = BytecodeCompiler.newProgram(); - genericCreate(program, createType, valueParameter, offsetParameter, SizeParameter.ZERO); + genericCreate(program, createType, valueParameter, offsetParameter, SizeParameter.ZERO, salt01); if (revert) { program @@ -64,7 +63,7 @@ void rootLevelCreate2AndExtCodeHash(WhenToTestParameter when) { int storageKey = 0; BytecodeCompiler program = BytecodeCompiler.newProgram(); - precomputeCreate2DeploymentAddress(program, salt01, storageKey); + precomputeCreate2DeploymentAddress(program, salt01); storeAt(program, storageKey); if (when == BEFORE || when == BEFORE_AND_AFTER) { @@ -72,7 +71,7 @@ void rootLevelCreate2AndExtCodeHash(WhenToTestParameter when) { program.op(EXTCODEHASH); // we expect to see 0 } - genericCreate(program, CREATE2, ValueParameter.ONE, OffsetParameter.ZERO, SizeParameter.ZERO); + genericCreate(program, CreateType.CREATE2, ValueParameter.ONE, OffsetParameter.ZERO, SizeParameter.ZERO, salt01); if (when == BEFORE || when == BEFORE_AND_AFTER) { loadFromStorage(program, storageKey); @@ -102,7 +101,9 @@ private static Stream createParametersForEmptyCreates() { return arguments.stream(); } - public static void genericCreate(BytecodeCompiler program, CreateType type, ValueParameter valueParameter, OffsetParameter offsetParameter, SizeParameter sizeParameter) { + public static void genericCreate(BytecodeCompiler program, CreateType type, ValueParameter valueParameter, OffsetParameter offsetParameter, SizeParameter sizeParameter, String salt) { + + if (type == CreateType.CREATE2) program.push(salt); switch (sizeParameter) { case ZERO -> program.push(0); @@ -132,17 +133,17 @@ public static void genericCreate(BytecodeCompiler program, CreateType type, Valu } } - public static void precomputeCreate2DeploymentAddress(BytecodeCompiler program, String salt, int key) { + public static void precomputeCreate2DeploymentAddress(BytecodeCompiler program, String salt) { program .push(0xff) .push(0) .op(MSTORE8); // (255) program .op(OpCode.ADDRESS) - .push(8 * 12) + .push(12 * 8) .op(SHL) .push(1) - .op(MSTORE); + .op(MSTORE); // store address left shifted by 12 bytes program .push(salt) .push(21) From 50f85d7723c976b2b01782e4f9d357f0e70583d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Olivier=20B=C3=A9gassat?= Date: Wed, 27 Nov 2024 14:33:37 +0700 Subject: [PATCH 07/44] feat: some abort tests for CREATE(2) --- .../createTests/SizeParameter.java | 1 + .../createTests/abort/Balance.java | 71 +++++++++++++++++++ .../createTests/abort/todo.md | 18 +++++ .../createTests/trivial/RootLevel.java | 10 +-- 4 files changed, 95 insertions(+), 5 deletions(-) create mode 100644 arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/abort/Balance.java create mode 100644 arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/abort/todo.md diff --git a/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/SizeParameter.java b/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/SizeParameter.java index 9df96f94a0..f65676efb9 100644 --- a/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/SizeParameter.java +++ b/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/SizeParameter.java @@ -21,4 +21,5 @@ public enum SizeParameter { FOURTEEN, // - 3 + 1 THIRTY_TWO, MSIZE, + MAX, } diff --git a/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/abort/Balance.java b/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/abort/Balance.java new file mode 100644 index 0000000000..3a32ca8e93 --- /dev/null +++ b/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/abort/Balance.java @@ -0,0 +1,71 @@ +/* + * Copyright Consensys Software Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 + */ +package net.consensys.linea.zktracer.instructionprocessing.createTests.abort; + +import net.consensys.linea.testing.BytecodeCompiler; +import net.consensys.linea.zktracer.instructionprocessing.createTests.CreateType; +import net.consensys.linea.zktracer.instructionprocessing.createTests.OffsetParameter; +import net.consensys.linea.zktracer.instructionprocessing.createTests.SizeParameter; +import net.consensys.linea.zktracer.instructionprocessing.createTests.ValueParameter; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.Arguments; +import org.junit.jupiter.params.provider.MethodSource; + +import java.util.ArrayList; +import java.util.List; +import java.util.stream.Stream; + +import static net.consensys.linea.zktracer.instructionprocessing.createTests.SizeParameter.*; +import static net.consensys.linea.zktracer.instructionprocessing.createTests.trivial.RootLevel.*; +import static net.consensys.linea.zktracer.opcode.OpCode.SHA3; + +public class Balance { + + @ParameterizedTest + @MethodSource("rootLevelInsufficientBalanceParameters") + void rootLevelInsfficientBalanceEmptyCreateOpcodeTest(CreateType createType, SizeParameter sizeParameter, OffsetParameter offsetParameter) { + + BytecodeCompiler program = BytecodeCompiler.newProgram(); + + if (sizeParameter == MSIZE) { + program.push(512).push(0).op(SHA3); // purely to expand memory + } + + genericCreate(program, createType, ValueParameter.SELFBALANCE_PLUS_ONE, offsetParameter, sizeParameter, salt01); + + run(program); + } + + /** + * {@link #rootLevelInsufficientBalanceParameters} excludes ''large sizes'': we are interested in unexceptional but aborted + * CREATE(2)'s. + * + */ + private static Stream rootLevelInsufficientBalanceParameters() { + + List arguments = new ArrayList<>(); + List sizeParameters = List.of(ZERO, TWELVE, THIRTEEN, FOURTEEN, THIRTY_TWO, MSIZE); + + for (CreateType createType : CreateType.values()) { + for (OffsetParameter offsetParameter : OffsetParameter.values()) { + for (SizeParameter sizeParameter : sizeParameters) { + arguments.add(Arguments.of(createType, sizeParameter, offsetParameter)); + } + } + } + + return arguments.stream(); + } +} diff --git a/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/abort/todo.md b/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/abort/todo.md new file mode 100644 index 0000000000..6fe8b53714 --- /dev/null +++ b/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/abort/todo.md @@ -0,0 +1,18 @@ +# Definitions + +Aborted CREATE's are those CREATE's that are +- unexceptional +- attempt to provide more balance than is avaiable or happen at CSD = 1024 + +# Parameters + +- [ ] fail because of BALANCE +- [ ] fail because of CALL_STACK_DEPTH + +We can then +- [ ] do an EXTCODEHASH on the deployment address to test + - warmth (shouldn't be warm) + - existence (should exist or not depending on balance alone unless collision) +- [ ] two deployment tests + - [ ] first deployment aborts with CREATE(2), a second deployment at this place doesn't abort + - [ ] first deployment succeeds with CREATE2, a second attempt aborts before FailureCondition **F** can be raised. \ No newline at end of file diff --git a/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/trivial/RootLevel.java b/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/trivial/RootLevel.java index 7da08a5870..00cc4813f6 100644 --- a/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/trivial/RootLevel.java +++ b/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/trivial/RootLevel.java @@ -33,8 +33,8 @@ public class RootLevel { - public String salt01 = "5a1701"; - public String salt02 = "5a1702"; + public static String salt01 = "5a1701"; + public static String salt02 = "5a1702"; @ParameterizedTest @MethodSource("createParametersForEmptyCreates") @@ -111,7 +111,8 @@ public static void genericCreate(BytecodeCompiler program, CreateType type, Valu case THIRTEEN -> program.push(13); case FOURTEEN -> program.push(14); case THIRTY_TWO -> program.push(0x20); - case MSIZE -> program.op(MSTORE); + case MSIZE -> program.op(MSIZE); + case MAX -> program.push("ff".repeat(32)); } switch (offsetParameter) { case ZERO -> program.push(0); @@ -175,8 +176,7 @@ public static void loadFromStorage(BytecodeCompiler program, int storageKey) { .op(SLOAD); } - private void run(BytecodeCompiler program) { + public static void run(BytecodeCompiler program) { BytecodeRunner.of(program).run(); } - } From 14afa7309d486398d88d7f7213f4e8e527020830 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Olivier=20B=C3=A9gassat?= Date: Wed, 27 Nov 2024 15:16:19 +0700 Subject: [PATCH 08/44] feat: abort / success and success / abort tests for CREATE(2)'s --- .../createTests/CreateType.java | 4 +- .../createTests/OffsetParameter.java | 12 +- .../createTests/SizeParameter.java | 27 +- .../createTests/ValueParameter.java | 8 +- .../createTests/WhenToTestParameter.java | 6 +- .../createTests/abort/Balance.java | 145 +++++++--- .../createTests/nontrivial/Tests.java | 5 +- .../createTests/trivial/RootLevel.java | 261 +++++++++--------- 8 files changed, 275 insertions(+), 193 deletions(-) diff --git a/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/CreateType.java b/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/CreateType.java index 7fd4279e60..2129b04df5 100644 --- a/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/CreateType.java +++ b/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/CreateType.java @@ -15,6 +15,6 @@ package net.consensys.linea.zktracer.instructionprocessing.createTests; public enum CreateType { - CREATE, - CREATE2 + CREATE, + CREATE2 } diff --git a/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/OffsetParameter.java b/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/OffsetParameter.java index f22299f965..dadfcc0d11 100644 --- a/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/OffsetParameter.java +++ b/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/OffsetParameter.java @@ -15,10 +15,10 @@ package net.consensys.linea.zktracer.instructionprocessing.createTests; public enum OffsetParameter { - ZERO, - THREE, - SIXTEEN, - SIXTEEN_BYTE_INT, - THIRTY_TWO_BYTE_INT, - MAX, + ZERO, + THREE, + SIXTEEN, + SIXTEEN_BYTE_INT, + THIRTY_TWO_BYTE_INT, + MAX, } diff --git a/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/SizeParameter.java b/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/SizeParameter.java index f65676efb9..2b5108fc1a 100644 --- a/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/SizeParameter.java +++ b/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/SizeParameter.java @@ -15,11 +15,24 @@ package net.consensys.linea.zktracer.instructionprocessing.createTests; public enum SizeParameter { - ZERO, - TWELVE, // - 3 - 1 - THIRTEEN, // - 3 + 0 - FOURTEEN, // - 3 + 1 - THIRTY_TWO, - MSIZE, - MAX, + ZERO, + TWELVE, // - 3 - 1 + THIRTEEN, // - 3 + 0 + FOURTEEN, // - 3 + 1 + THIRTY_TWO, + MSIZE, + MAX; + + public boolean isAnyOf(SizeParameter... sizeParameters) { + for (SizeParameter sizeParameter : sizeParameters) { + if (this == sizeParameter) { + return true; + } + } + return false; + } + + public boolean willRaiseException() { + return this.isAnyOf(MAX); + } } diff --git a/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/ValueParameter.java b/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/ValueParameter.java index e420ac8079..55d56d176f 100644 --- a/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/ValueParameter.java +++ b/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/ValueParameter.java @@ -15,8 +15,8 @@ package net.consensys.linea.zktracer.instructionprocessing.createTests; public enum ValueParameter { - ZERO, - ONE, - SELFBALANCE, - SELFBALANCE_PLUS_ONE, + ZERO, + ONE, + SELFBALANCE, + SELFBALANCE_PLUS_ONE, } diff --git a/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/WhenToTestParameter.java b/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/WhenToTestParameter.java index e2062b0fa8..20ea4d1393 100644 --- a/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/WhenToTestParameter.java +++ b/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/WhenToTestParameter.java @@ -15,7 +15,7 @@ package net.consensys.linea.zktracer.instructionprocessing.createTests; public enum WhenToTestParameter { - BEFORE, - AFTER, - BEFORE_AND_AFTER + BEFORE, + AFTER, + BEFORE_AND_AFTER } diff --git a/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/abort/Balance.java b/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/abort/Balance.java index 3a32ca8e93..d786a406f8 100644 --- a/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/abort/Balance.java +++ b/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/abort/Balance.java @@ -14,6 +14,15 @@ */ package net.consensys.linea.zktracer.instructionprocessing.createTests.abort; +import static net.consensys.linea.zktracer.instructionprocessing.createTests.SizeParameter.*; +import static net.consensys.linea.zktracer.instructionprocessing.createTests.trivial.RootLevel.*; +import static net.consensys.linea.zktracer.instructionprocessing.utilities.Calls.appendRevert; +import static net.consensys.linea.zktracer.opcode.OpCode.SHA3; + +import java.util.ArrayList; +import java.util.List; +import java.util.stream.Stream; + import net.consensys.linea.testing.BytecodeCompiler; import net.consensys.linea.zktracer.instructionprocessing.createTests.CreateType; import net.consensys.linea.zktracer.instructionprocessing.createTests.OffsetParameter; @@ -23,49 +32,117 @@ import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; -import java.util.ArrayList; -import java.util.List; -import java.util.stream.Stream; +public class Balance { -import static net.consensys.linea.zktracer.instructionprocessing.createTests.SizeParameter.*; -import static net.consensys.linea.zktracer.instructionprocessing.createTests.trivial.RootLevel.*; -import static net.consensys.linea.zktracer.opcode.OpCode.SHA3; + /** The tests below are meant to trigger the "insufficientBalanceAbort" condition. */ + @ParameterizedTest + @MethodSource("rootLevelInsufficientBalanceParameters") + void rootLevelInsufficientBalanceCreateOpcodeTest( + CreateType createType, SizeParameter sizeParameter, OffsetParameter offsetParameter) { -public class Balance { + BytecodeCompiler program = BytecodeCompiler.newProgram(); - @ParameterizedTest - @MethodSource("rootLevelInsufficientBalanceParameters") - void rootLevelInsfficientBalanceEmptyCreateOpcodeTest(CreateType createType, SizeParameter sizeParameter, OffsetParameter offsetParameter) { + if (sizeParameter == MSIZE) { + program.push(513).push(0).op(SHA3); // purely to expand memory to 0 < 512 + 32 bytes + } - BytecodeCompiler program = BytecodeCompiler.newProgram(); + genericCreate( + program, + createType, + ValueParameter.SELFBALANCE_PLUS_ONE, + offsetParameter, + sizeParameter, + salt01); - if (sizeParameter == MSIZE) { - program.push(512).push(0).op(SHA3); // purely to expand memory - } + run(program); + } - genericCreate(program, createType, ValueParameter.SELFBALANCE_PLUS_ONE, offsetParameter, sizeParameter, salt01); + /** + * In the tests {@link #rootLevelAbortThenSuccessCreateTest} we perform two CREATE(2)'s in a row. + * The first one is designed to raise the insufficientBalanceAbort condition, the second one is + * designed to succeed. We optionally REVERT. + */ + @ParameterizedTest + @MethodSource("offsetAndSizeParameters") + void rootLevelAbortThenSuccessCreateTest( + CreateType createType, + OffsetParameter offsetParameter, + SizeParameter sizeParameter, + boolean reverts) { + BytecodeCompiler program = BytecodeCompiler.newProgram(); + genericCreate( + program, + createType, + ValueParameter.SELFBALANCE_PLUS_ONE, + offsetParameter, + sizeParameter, + salt01); // aborts + genericCreate(program, createType, ValueParameter.ONE, offsetParameter, sizeParameter, salt01); - run(program); + if (reverts) { + appendRevert(program, 2, 13); } - /** - * {@link #rootLevelInsufficientBalanceParameters} excludes ''large sizes'': we are interested in unexceptional but aborted - * CREATE(2)'s. - * - */ - private static Stream rootLevelInsufficientBalanceParameters() { - - List arguments = new ArrayList<>(); - List sizeParameters = List.of(ZERO, TWELVE, THIRTEEN, FOURTEEN, THIRTY_TWO, MSIZE); - - for (CreateType createType : CreateType.values()) { - for (OffsetParameter offsetParameter : OffsetParameter.values()) { - for (SizeParameter sizeParameter : sizeParameters) { - arguments.add(Arguments.of(createType, sizeParameter, offsetParameter)); - } - } - } + run(program); + } + + /** + * In the tests {@link #rootLevelSuccessThenAbortCreateTest} we perform two CREATE(2)'s in a row. + * The first one is designed to succeed, the second one is designed to raise the + * insufficientBalanceAbort condition. We optionally REVERT. + */ + @ParameterizedTest + @MethodSource("offsetAndSizeParameters") + void rootLevelSuccessThenAbortCreateTest( + CreateType createType, + OffsetParameter offsetParameter, + SizeParameter sizeParameter, + boolean reverts) { + BytecodeCompiler program = BytecodeCompiler.newProgram(); + genericCreate(program, createType, ValueParameter.ONE, offsetParameter, sizeParameter, salt01); + genericCreate( + program, + createType, + ValueParameter.SELFBALANCE_PLUS_ONE, + offsetParameter, + sizeParameter, + salt01); // aborts + if (reverts) { + appendRevert(program, 2, 13); + } + run(program); + } - return arguments.stream(); + private static Stream offsetAndSizeParameters() { + List arguments = new ArrayList<>(); + for (OffsetParameter offsetParameter : OffsetParameter.values()) { + for (SizeParameter sizeParameter : SizeParameter.values()) { + if (sizeParameter.willRaiseException()) continue; + arguments.add(Arguments.of(CreateType.CREATE, offsetParameter, sizeParameter, true)); + arguments.add(Arguments.of(CreateType.CREATE2, offsetParameter, sizeParameter, false)); + } } + return arguments.stream(); + } + + /** + * {@link #rootLevelInsufficientBalanceParameters} excludes ''large sizes'': we are interested in + * unexceptional but aborted CREATE(2)'s. + */ + private static Stream rootLevelInsufficientBalanceParameters() { + + List arguments = new ArrayList<>(); + List sizeParameters = + List.of(ZERO, TWELVE, THIRTEEN, FOURTEEN, THIRTY_TWO, MSIZE); + + for (CreateType createType : CreateType.values()) { + for (OffsetParameter offsetParameter : OffsetParameter.values()) { + for (SizeParameter sizeParameter : sizeParameters) { + arguments.add(Arguments.of(createType, sizeParameter, offsetParameter)); + } + } + } + + return arguments.stream(); + } } diff --git a/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/nontrivial/Tests.java b/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/nontrivial/Tests.java index 3c2a6ef893..5fdc80ec05 100644 --- a/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/nontrivial/Tests.java +++ b/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/nontrivial/Tests.java @@ -14,7 +14,4 @@ */ package net.consensys.linea.zktracer.instructionprocessing.createTests.nontrivial; -public class Tests { - - -} +public class Tests {} diff --git a/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/trivial/RootLevel.java b/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/trivial/RootLevel.java index 00cc4813f6..96f1bc6c82 100644 --- a/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/trivial/RootLevel.java +++ b/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/trivial/RootLevel.java @@ -14,6 +14,14 @@ */ package net.consensys.linea.zktracer.instructionprocessing.createTests.trivial; +import static net.consensys.linea.zktracer.instructionprocessing.createTests.WhenToTestParameter.BEFORE; +import static net.consensys.linea.zktracer.instructionprocessing.createTests.WhenToTestParameter.BEFORE_AND_AFTER; +import static net.consensys.linea.zktracer.opcode.OpCode.*; + +import java.util.ArrayList; +import java.util.List; +import java.util.stream.Stream; + import net.consensys.linea.testing.BytecodeCompiler; import net.consensys.linea.testing.BytecodeRunner; import net.consensys.linea.zktracer.instructionprocessing.createTests.*; @@ -23,160 +31,147 @@ import org.junit.jupiter.params.provider.EnumSource; import org.junit.jupiter.params.provider.MethodSource; -import java.util.ArrayList; -import java.util.List; -import java.util.stream.Stream; - -import static net.consensys.linea.zktracer.instructionprocessing.createTests.WhenToTestParameter.BEFORE; -import static net.consensys.linea.zktracer.instructionprocessing.createTests.WhenToTestParameter.BEFORE_AND_AFTER; -import static net.consensys.linea.zktracer.opcode.OpCode.*; - public class RootLevel { - public static String salt01 = "5a1701"; - public static String salt02 = "5a1702"; - - @ParameterizedTest - @MethodSource("createParametersForEmptyCreates") - void rootLevelCreateTests( - CreateType createType, - ValueParameter valueParameter, - OffsetParameter offsetParameter, - boolean revert) { - - BytecodeCompiler program = BytecodeCompiler.newProgram(); - genericCreate(program, createType, valueParameter, offsetParameter, SizeParameter.ZERO, salt01); - - if (revert) { - program - .push(0) - .push(0) - .op(REVERT); - } + public static String salt01 = "5a1701"; + public static String salt02 = "5a1702"; - run(program); - } + @ParameterizedTest + @MethodSource("createParametersForEmptyCreates") + void rootLevelCreateTests( + CreateType createType, + ValueParameter valueParameter, + OffsetParameter offsetParameter, + boolean revert) { - @ParameterizedTest - @EnumSource(WhenToTestParameter.class) - void rootLevelCreate2AndExtCodeHash(WhenToTestParameter when) { + BytecodeCompiler program = BytecodeCompiler.newProgram(); + genericCreate(program, createType, valueParameter, offsetParameter, SizeParameter.ZERO, salt01); - int storageKey = 0; - BytecodeCompiler program = BytecodeCompiler.newProgram(); - precomputeCreate2DeploymentAddress(program, salt01); - storeAt(program, storageKey); + if (revert) { + program.push(0).push(0).op(REVERT); + } - if (when == BEFORE || when == BEFORE_AND_AFTER) { - loadFromStorage(program, storageKey); - program.op(EXTCODEHASH); // we expect to see 0 - } + run(program); + } - genericCreate(program, CreateType.CREATE2, ValueParameter.ONE, OffsetParameter.ZERO, SizeParameter.ZERO, salt01); + @ParameterizedTest + @EnumSource(WhenToTestParameter.class) + void rootLevelCreate2AndExtCodeHash(WhenToTestParameter when) { - if (when == BEFORE || when == BEFORE_AND_AFTER) { - loadFromStorage(program, storageKey); - program.op(EQ); // we expect to have the result be true here - loadFromStorage(program, storageKey); - program.op(EXTCODEHASH); // we expect to see KECCAK(( )) - } + int storageKey = 0; + BytecodeCompiler program = BytecodeCompiler.newProgram(); + precomputeCreate2DeploymentAddress(program, salt01); + storeAt(program, storageKey); - run(program); + if (when == BEFORE || when == BEFORE_AND_AFTER) { + loadFromStorage(program, storageKey); + program.op(EXTCODEHASH); // we expect to see 0 } - private static Stream createParametersForEmptyCreates() { - - final List valueParameters = List.of(ValueParameter.ZERO, ValueParameter.ONE); - - List arguments = new ArrayList<>(); + genericCreate( + program, + CreateType.CREATE2, + ValueParameter.ONE, + OffsetParameter.ZERO, + SizeParameter.ZERO, + salt01); + + if (when == BEFORE || when == BEFORE_AND_AFTER) { + loadFromStorage(program, storageKey); + program.op(EQ); // we expect to have the result be true here + loadFromStorage(program, storageKey); + program.op(EXTCODEHASH); // we expect to see KECCAK(( )) + } - for (CreateType createType : CreateType.values()) { - for (ValueParameter valueParameter : valueParameters) { - for (OffsetParameter offsetParameter : OffsetParameter.values()) { - arguments.add(Arguments.of(createType, valueParameter, offsetParameter, true)); - arguments.add(Arguments.of(createType, valueParameter, offsetParameter, false)); - } - } - } + run(program); + } - return arguments.stream(); - } + private static Stream createParametersForEmptyCreates() { - public static void genericCreate(BytecodeCompiler program, CreateType type, ValueParameter valueParameter, OffsetParameter offsetParameter, SizeParameter sizeParameter, String salt) { + final List valueParameters = List.of(ValueParameter.ZERO, ValueParameter.ONE); - if (type == CreateType.CREATE2) program.push(salt); + List arguments = new ArrayList<>(); - switch (sizeParameter) { - case ZERO -> program.push(0); - case TWELVE -> program.push(12); - case THIRTEEN -> program.push(13); - case FOURTEEN -> program.push(14); - case THIRTY_TWO -> program.push(0x20); - case MSIZE -> program.op(MSIZE); - case MAX -> program.push("ff".repeat(32)); - } - switch (offsetParameter) { - case ZERO -> program.push(0); - case THREE -> program.push(0); - case SIXTEEN -> program.push(0x10); - case SIXTEEN_BYTE_INT -> program.push("abe1245ffff123a87000a543eff12aaa"); - case THIRTY_TWO_BYTE_INT -> program.push("abe1245ffff123a87000a543eff12aaa09987582714266effffefaabc76aa758"); - case MAX -> program.push("ff".repeat(32)); - } - switch (valueParameter) { - case ZERO -> program.push(0); - case ONE -> program.push(1); - case SELFBALANCE -> program.op(SELFBALANCE); - case SELFBALANCE_PLUS_ONE -> program.op(SELFBALANCE).push(1).op(ADD); - } - switch (type) { - case CREATE -> program.op(CREATE); - case CREATE2 -> program.op(OpCode.CREATE2); + for (CreateType createType : CreateType.values()) { + for (ValueParameter valueParameter : valueParameters) { + for (OffsetParameter offsetParameter : OffsetParameter.values()) { + arguments.add(Arguments.of(createType, valueParameter, offsetParameter, true)); + arguments.add(Arguments.of(createType, valueParameter, offsetParameter, false)); } + } } - public static void precomputeCreate2DeploymentAddress(BytecodeCompiler program, String salt) { - program - .push(0xff) - .push(0) - .op(MSTORE8); // (255) - program - .op(OpCode.ADDRESS) - .push(12 * 8) - .op(SHL) - .push(1) - .op(MSTORE); // store address left shifted by 12 bytes - program - .push(salt) - .push(21) - .op(MSTORE); // salt - program - .push(0) - .push(0) - .op(SHA3) - .push(53) - .op(MSTORE); // init code hash = KECCAK(( )) - program - .push(85) // 1 + 20 + 32 + 32 - .push(0) - .op(SHA3); // extract raw address - program - .push("000000000000000000000000ffffffffffffffffffffffffffffffffffffffff") - .op(AND); // computes deployment address + return arguments.stream(); + } + + public static void genericCreate( + BytecodeCompiler program, + CreateType type, + ValueParameter valueParameter, + OffsetParameter offsetParameter, + SizeParameter sizeParameter, + String salt) { + + if (type == CreateType.CREATE2) program.push(salt); + + switch (sizeParameter) { + case ZERO -> program.push(0); + case TWELVE -> program.push(12); + case THIRTEEN -> program.push(13); + case FOURTEEN -> program.push(14); + case THIRTY_TWO -> program.push(0x20); + case MSIZE -> program.op(MSIZE); + case MAX -> program.push("ff".repeat(32)); } - - public static void storeAt(BytecodeCompiler program, int storageKey) { - program - .push(storageKey) - .op(SSTORE); + switch (offsetParameter) { + case ZERO -> program.push(0); + case THREE -> program.push(0); + case SIXTEEN -> program.push(0x10); + case SIXTEEN_BYTE_INT -> program.push("abe1245ffff123a87000a543eff12aaa"); + case THIRTY_TWO_BYTE_INT -> program.push( + "abe1245ffff123a87000a543eff12aaa09987582714266effffefaabc76aa758"); + case MAX -> program.push("ff".repeat(32)); } - - public static void loadFromStorage(BytecodeCompiler program, int storageKey) { - program - .push(storageKey) - .op(SLOAD); + switch (valueParameter) { + case ZERO -> program.push(0); + case ONE -> program.push(1); + case SELFBALANCE -> program.op(SELFBALANCE); + case SELFBALANCE_PLUS_ONE -> program.op(SELFBALANCE).push(1).op(ADD); } - - public static void run(BytecodeCompiler program) { - BytecodeRunner.of(program).run(); + switch (type) { + case CREATE -> program.op(CREATE); + case CREATE2 -> program.op(OpCode.CREATE2); } + } + + public static void precomputeCreate2DeploymentAddress(BytecodeCompiler program, String salt) { + program.push(0xff).push(0).op(MSTORE8); // (255) + program + .op(OpCode.ADDRESS) + .push(12 * 8) + .op(SHL) + .push(1) + .op(MSTORE); // store address left shifted by 12 bytes + program.push(salt).push(21).op(MSTORE); // salt + program.push(0).push(0).op(SHA3).push(53).op(MSTORE); // init code hash = KECCAK(( )) + program + .push(85) // 1 + 20 + 32 + 32 + .push(0) + .op(SHA3); // extract raw address + program + .push("000000000000000000000000ffffffffffffffffffffffffffffffffffffffff") + .op(AND); // computes deployment address + } + + public static void storeAt(BytecodeCompiler program, int storageKey) { + program.push(storageKey).op(SSTORE); + } + + public static void loadFromStorage(BytecodeCompiler program, int storageKey) { + program.push(storageKey).op(SLOAD); + } + + public static void run(BytecodeCompiler program) { + BytecodeRunner.of(program).run(); + } } From b18f6dd201378ab38ff34c1b823e4f72fe61bfd7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Olivier=20B=C3=A9gassat?= Date: Wed, 27 Nov 2024 18:52:21 +0700 Subject: [PATCH 09/44] feat: more tests --- .../createTests/failure/Create2.java | 63 +++++++++++++ .../createTests/failure/NoFailure.java | 68 ++++++++++++++ .../createTests/failure/todo.md | 93 +++++++++++++++++++ .../createTests/trivial/RootLevel.java | 5 +- 4 files changed, 227 insertions(+), 2 deletions(-) create mode 100644 arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/failure/Create2.java create mode 100644 arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/failure/NoFailure.java create mode 100644 arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/failure/todo.md diff --git a/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/failure/Create2.java b/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/failure/Create2.java new file mode 100644 index 0000000000..da27516a73 --- /dev/null +++ b/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/failure/Create2.java @@ -0,0 +1,63 @@ +/* + * Copyright Consensys Software Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 + */ +package net.consensys.linea.zktracer.instructionprocessing.createTests.failure; + +import static net.consensys.linea.zktracer.instructionprocessing.createTests.trivial.RootLevel.*; +import static net.consensys.linea.zktracer.opcode.OpCode.CREATE2; + +import net.consensys.linea.testing.BytecodeCompiler; +import org.junit.jupiter.api.Test; + +/** The following tests raise the Failure Condition F CREATE2. */ +public class Create2 { + + @Test + void failureConditionNonceTest() { + + BytecodeCompiler program = BytecodeCompiler.newProgram(); + program + .push(salt01) + .push(0) + .push(0) + .push(1) + .op(CREATE2) + .push(salt01) + .push(0) + .push(0) + .push(1) + .op(CREATE2); + + run(program); + } + + @Test + void failureConditionNonceAndCodeTest() { + + BytecodeCompiler program = BytecodeCompiler.newProgram(); + program + .push(salt01) + .push(0) + .push(0) + .push(1) + .op(CREATE2) + .push(salt01) + .push(0) + .push(0) + .push(1) + .op(CREATE2); + + run(program); + } +} diff --git a/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/failure/NoFailure.java b/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/failure/NoFailure.java new file mode 100644 index 0000000000..d29ea21eb6 --- /dev/null +++ b/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/failure/NoFailure.java @@ -0,0 +1,68 @@ +/* + * Copyright Consensys Software Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 + */ +package net.consensys.linea.zktracer.instructionprocessing.createTests.failure; + +import static net.consensys.linea.zktracer.instructionprocessing.createTests.trivial.RootLevel.*; +import static net.consensys.linea.zktracer.opcode.OpCode.*; + +import net.consensys.linea.testing.BytecodeCompiler; +import org.junit.jupiter.api.Test; + +public class NoFailure { + + /** + * The following tests runs two separate CREATE2 deployments with different SALT parameters. No + * address collision takes place, no failure condition F is raised. + */ + @Test + void noFailureConditionTest() { + + BytecodeCompiler program = BytecodeCompiler.newProgram(); + program + .push(salt01) + .push(0) + .push(0) + .push(1) + .op(CREATE2) + .push(salt02) + .push(0) + .push(0) + .push(1) + .op(CREATE2); + + run(program); + } + + /** + * The following (1) precomputes a deployment address (2) stores it (3) transfers value to that + * address (4) performs a deployment (CREATE2) at that address + */ + @Test + void noFailureConditionDespiteNonzeroBalanceTest() { + + BytecodeCompiler program = BytecodeCompiler.newProgram(); + + precomputeDeploymentAddressOfEmptyInitCodeCreate2(program, salt01); + storeAt(program, 0xadd7); + program.push(0).push(0).push(0).push(0).push(1); // value + loadFromStorage(program, 0xadd7); // address + program.op(GAS).op(CALL); + program.push(salt01).push(0).push(0).push(1).op(CREATE2); + loadFromStorage(program, 0xadd7); + program.op(EQ); // we expect the result to be true + + run(program); + } +} diff --git a/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/failure/todo.md b/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/failure/todo.md new file mode 100644 index 0000000000..8837a48477 --- /dev/null +++ b/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/failure/todo.md @@ -0,0 +1,93 @@ +# Definitions + +Failure Condition **F** CREATE's are those CREATE's that +- are unexceptional +- don't abort +- but raise Failure Condition **F** + +Recall that this condition is triggered when the deployment address has one or more of the following properties +- nonzero nonce +- nonempty code + +**Note.** Nonzero balance isn't an issue. + +There are two main ways to produce the Failure Condition **F**. +- simple: address collisions are trivial to produce via CREATE2; here we have two ways to deploy: + - [ ] empty deployed code + - [ ] nonempty deployed code +- harder: address collisions via CREATE + +This is classical by now: +- contract A does a CREATE2 deploying contract B + - contract B should be able to do a SELFDESTRUCT / CREATE +- contract B does a CREATE deploying contract C while it has nonce n (e.g. n = 1) +- contract B selfdestructs +- contract A re-deploys contract B using CREATE2 again +- contract B attempts a CREATE at the same nonce n as previously, effectively attempting to re-deploy at contract C's address + +I guess the simplest way to achieve this would be to have B have the following code + +```asm +// contract B deployed code +PUSH1 0 +PUSH1 0 +PUSH1 0 +PUSH1 0 +PUSH1 0 +CALLDATALOAD // expecting to find an address in call data +GAS +DELEGATECALL +``` + +This byte code measures 13 bytes. The associated init code would be +```asm +PUSH13 ... +PUSH1 0 +MSTORE +PUSH1 13 +PUSH1 0 +RETURN +``` + +which is 22 bytes. It should be deployed in a CREATE2 with 1 Wei of value. + +We then need two contracts: +- one that simply selfdestructs +- another one that CREATEs. + +E.g. + +```asm +// basic CREATE-or contract (deploys 0x) +PUSH1 0 +PUSH1 0 +PUSH1 0 +CREATE +``` +or +```asm +// alternative basic CREATE-or contract (deploys 0x00 .. 00) +PUSH1 32 +PUSH1 0 +PUSH1 0 +CREATE +``` + +```asm +// basic SELFDESTRUCT-or +ORIGIN +SELFDESTRUCT +``` + +The simplest scenario would be +- transaction 1: + - to contract A + - deploy contract B + - get back to A + - CALL contract B with call data the address of the basic CREATE-or + - CALL contract B with call data the address of the basic SELFDESTRUCT-or +- transaction 2: + - to contract A + - deploy contract B (which is clean) + - CALL contract B with call data the address of the basic CREATE-or + - raise failure condition F diff --git a/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/trivial/RootLevel.java b/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/trivial/RootLevel.java index 96f1bc6c82..8fb678de69 100644 --- a/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/trivial/RootLevel.java +++ b/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/trivial/RootLevel.java @@ -60,7 +60,7 @@ void rootLevelCreate2AndExtCodeHash(WhenToTestParameter when) { int storageKey = 0; BytecodeCompiler program = BytecodeCompiler.newProgram(); - precomputeCreate2DeploymentAddress(program, salt01); + precomputeDeploymentAddressOfEmptyInitCodeCreate2(program, salt01); storeAt(program, storageKey); if (when == BEFORE || when == BEFORE_AND_AFTER) { @@ -144,7 +144,8 @@ public static void genericCreate( } } - public static void precomputeCreate2DeploymentAddress(BytecodeCompiler program, String salt) { + public static void precomputeDeploymentAddressOfEmptyInitCodeCreate2( + BytecodeCompiler program, String salt) { program.push(0xff).push(0).op(MSTORE8); // (255) program .op(OpCode.ADDRESS) From e8cd37f52a47bb293f7a3f889a578209659da4de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Olivier=20B=C3=A9gassat?= Date: Wed, 27 Nov 2024 19:15:20 +0700 Subject: [PATCH 10/44] fix: documentation + no SUX for CREATE2 anymore --- .../createTests/failure/Create2.java | 47 ++++++++++++++++--- 1 file changed, 40 insertions(+), 7 deletions(-) diff --git a/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/failure/Create2.java b/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/failure/Create2.java index da27516a73..e017f1f413 100644 --- a/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/failure/Create2.java +++ b/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/failure/Create2.java @@ -15,9 +15,10 @@ package net.consensys.linea.zktracer.instructionprocessing.createTests.failure; import static net.consensys.linea.zktracer.instructionprocessing.createTests.trivial.RootLevel.*; -import static net.consensys.linea.zktracer.opcode.OpCode.CREATE2; +import static net.consensys.linea.zktracer.opcode.OpCode.*; import net.consensys.linea.testing.BytecodeCompiler; +import org.apache.tuweni.bytes.Bytes; import org.junit.jupiter.api.Test; /** The following tests raise the Failure Condition F CREATE2. */ @@ -42,21 +43,53 @@ void failureConditionNonceTest() { run(program); } + /** + * We first produce init code that, when run, does + * + *

PUSH1 1 + * + *

PUSH1 0 + * + *

RETURN + * + *

i.e. 0x60016000f3. We then (1) store that init code in memory (2) use it for a first CREATE2 + * which deploys a SMC with bytecode of length 1 equal to 0x00 (3) test the (EXT) code size, + * code hash and balance of this new account (4) attempt a second deployment at that same + * exact address, thus raising the Failure Condition F. + */ @Test void failureConditionNonceAndCodeTest() { + BytecodeCompiler initCode = BytecodeCompiler.newProgram(); + initCode + .push(1) // size + .push(0) + .op(RETURN); + Bytes compiledInitCode = initCode.compile(); + BytecodeCompiler program = BytecodeCompiler.newProgram(); program - .push(salt01) - .push(0) + .push(compiledInitCode) + .push(8 * (32 - compiledInitCode.size())) + .op(SHL) .push(0) - .push(1) - .op(CREATE2) + .op(MSTORE); // this puts the init code in memory + + program .push(salt01) + .push(compiledInitCode.size()) .push(0) + .push(1) // value + .op(CREATE2); // first deployment, deploys monobyte byte code + + program.op(DUP1).op(DUP1).op(EXTCODEHASH).op(EXTCODESIZE).op(BALANCE); + + program + .push(salt01) + .push(compiledInitCode.size()) .push(0) - .push(1) - .op(CREATE2); + .push(1) // value + .op(CREATE2); // second (attempted) deployment raises failure condition run(program); } From 7744321df1b732499347d68e3a343411b6473d52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Olivier=20B=C3=A9gassat?= Date: Wed, 27 Nov 2024 19:18:10 +0700 Subject: [PATCH 11/44] spotless --- .../instructionprocessing/createTests/failure/Create2.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/failure/Create2.java b/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/failure/Create2.java index e017f1f413..6c466af051 100644 --- a/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/failure/Create2.java +++ b/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/failure/Create2.java @@ -53,9 +53,9 @@ void failureConditionNonceTest() { *

RETURN * *

i.e. 0x60016000f3. We then (1) store that init code in memory (2) use it for a first CREATE2 - * which deploys a SMC with bytecode of length 1 equal to 0x00 (3) test the (EXT) code size, - * code hash and balance of this new account (4) attempt a second deployment at that same - * exact address, thus raising the Failure Condition F. + * which deploys a SMC with bytecode of length 1 equal to 0x00 (3) test the (EXT) code size, code + * hash and balance of this new account (4) attempt a second deployment at that same exact + * address, thus raising the Failure Condition F. */ @Test void failureConditionNonceAndCodeTest() { From 356dc8e43ea97f508df3ac6dbe1365c5e16ce8e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Olivier=20B=C3=A9gassat?= Date: Wed, 27 Nov 2024 21:40:36 +0700 Subject: [PATCH 12/44] fix: make the test work --- .../createTests/failure/Create.java | 237 ++++++++++++++++++ .../utilities/MonoOpCodeSmcs.java | 3 +- .../consensys/linea/testing/ToyAccount.java | 11 + 3 files changed, 249 insertions(+), 2 deletions(-) create mode 100644 arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/failure/Create.java diff --git a/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/failure/Create.java b/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/failure/Create.java new file mode 100644 index 0000000000..3c20f8252f --- /dev/null +++ b/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/failure/Create.java @@ -0,0 +1,237 @@ +/* + * Copyright Consensys Software Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 + */ +package net.consensys.linea.zktracer.instructionprocessing.createTests.failure; + +import static net.consensys.linea.zktracer.instructionprocessing.createTests.trivial.RootLevel.salt01; +import static net.consensys.linea.zktracer.instructionprocessing.utilities.MonoOpCodeSmcs.keyPair; +import static net.consensys.linea.zktracer.instructionprocessing.utilities.MonoOpCodeSmcs.userAccount; +import static net.consensys.linea.zktracer.opcode.OpCode.*; +import static net.consensys.linea.zktracer.types.Utils.leftPadTo; + +import java.util.List; + +import net.consensys.linea.testing.BytecodeCompiler; +import net.consensys.linea.testing.ToyAccount; +import net.consensys.linea.testing.ToyExecutionEnvironmentV2; +import net.consensys.linea.testing.ToyTransaction; +import org.apache.tuweni.bytes.Bytes; +import org.hyperledger.besu.datatypes.Address; +import org.hyperledger.besu.datatypes.Wei; +import org.hyperledger.besu.ethereum.core.Transaction; +import org.junit.jupiter.api.Test; + +public class Create { + + final Bytes tinyAddress1 = Bytes.fromHexString("badd1ec0de"); + final Bytes tinyAddress2 = Bytes.fromHexString("900d1ec0de"); + final Bytes leftPaddedAddress1 = leftPadTo(tinyAddress1, 32); + final Bytes leftPaddedAddress2 = leftPadTo(tinyAddress2, 32); + final Address address1 = Address.wrap(leftPadTo(tinyAddress1, 20)); + final Address address2 = Address.wrap(leftPadTo(tinyAddress2, 20)); + final Address targetAddress = Address.fromHexString("797add7e55"); + + final BytecodeCompiler simpleSelfDestruct = + BytecodeCompiler.newProgram().op(ORIGIN).op(SELFDESTRUCT); + + final ToyAccount simpleSelfDestructor = + ToyAccount.builder() + .code(simpleSelfDestruct.compile()) + .nonce(91) + .balance(Wei.of(1234L)) + .address(address1) + .build(); + + final BytecodeCompiler simpleCreate = + BytecodeCompiler.newProgram() + .push(0) // empty init code + .push(0) + .push(1) // value + .op(CREATE); + + final ToyAccount simpleCreator = + ToyAccount.builder() + .code(simpleCreate.compile()) + .nonce(512) + .balance(Wei.of(73L)) + .address(address2) + .build(); + + final BytecodeCompiler codeToDeploy = + BytecodeCompiler.newProgram() + .push(0) // rac + .push(0) // rao + .push(0) // cds + .push(0) // cdo + .push(0) + .op(CALLDATALOAD) // should be an address + .op(GAS) + .op(DELEGATECALL); + + final BytecodeCompiler initCodeThatDeploysTheDesiredCode = + BytecodeCompiler.newProgram() + .push(codeToDeploy.compile()) + .push(8 * (32 - codeToDeploy.compile().size())) + .op(SHL) + .push(0) + .op(MSTORE) + .push(codeToDeploy.compile().size()) // code size + .push(0) + .op(RETURN); + + int addressKey = 0xad; + + final BytecodeCompiler targetByteCode = + BytecodeCompiler.newProgram() + .op(CALLDATASIZE) + .op(ISZERO) + .push(1) + .op(SUB) // ¬ [CALLDATASIZE == 0] + .push( + 1 + + 1 + + (1 + 1) + + 1 + + (1 + 1) + + 1 // + + (1 + initCodeThatDeploysTheDesiredCode.compile().size()) + + (1 + 1) + + 1 + + (1 + 1) + + 1 + + (1 + salt01.length() / 2) + + 1 + + (1 + 1) + + (1 + 1) + + (1 + 1) + + 1 + + (1 + 1) + + 1 + + 1 // + ) + .op(JUMPI) + // + .push(initCodeThatDeploysTheDesiredCode.compile()) + .push(8 * (32 - initCodeThatDeploysTheDesiredCode.compile().size())) + .op(SHL) + .push(0) + .op(MSTORE) + .push(salt01) + .push(initCodeThatDeploysTheDesiredCode.compile().size()) // init code size + .push(0) // offset + .push(0xff) // value + .op(CREATE2) + .push(addressKey) + .op(SSTORE) + .op(STOP) + // + .op(JUMPDEST) + .push(0) + .op(CALLDATALOAD) // extracts (address) from call data + .push(0) + .op(MSTORE) + .push(0) // rac + .push(0) // rao + .push(0x20) // cds + .push(0) // cdo + .push(addressKey) + .op(SLOAD) // extract stored address + .push(0xef) // value + .op(GAS) // gas + .op(CALL); + + final ToyAccount targetAccount = + ToyAccount.builder() + .code(targetByteCode.compile()) + .nonce(1337) + .balance(Wei.of(73L)) + .address(targetAddress) + .build(); + + final Transaction deploymentTransactionNumber1 = + ToyTransaction.builder() + .sender(userAccount) + .to(targetAccount) + .keyPair(keyPair) + .value(Wei.of(0xffff)) + .gasLimit(1_000_000L) + .gasPrice(Wei.of(8)) + .build(); + + final Transaction createTransactionNumber1 = + ToyTransaction.builder() + .sender(userAccount.raiseNonceBy(1)) + .to(targetAccount) + .keyPair(keyPair) + .value(Wei.of(0xeeee)) + .gasLimit(1_000_000L) + .gasPrice(Wei.of(8)) + .payload(leftPaddedAddress1) + .build(); + + final Transaction selfDestructTransaction = + ToyTransaction.builder() + .sender(userAccount.raiseNonceBy(2)) + .to(targetAccount) + .keyPair(keyPair) + .value(Wei.of(0xdddd)) + .gasLimit(1_000_000L) + .gasPrice(Wei.of(8)) + .payload(leftPaddedAddress2) + .build(); + + final Transaction deploymentTransactionNumber2 = + ToyTransaction.builder() + .sender(userAccount.raiseNonceBy(3)) + .to(targetAccount) + .keyPair(keyPair) + .value(Wei.of(0xcccc)) + .gasLimit(1_000_000L) + .gasPrice(Wei.of(8)) + .build(); + + final Transaction createTransactionNumber2 = + ToyTransaction.builder() + .sender(userAccount.raiseNonceBy(4)) + .to(targetAccount) + .keyPair(keyPair) + .value(Wei.of(0xbbbb)) + .gasLimit(1_000_000L) + .gasPrice(Wei.of(8)) + .payload(leftPaddedAddress1) + .build(); + + final List transactions = + List.of( + deploymentTransactionNumber1, + createTransactionNumber1, + selfDestructTransaction, + deploymentTransactionNumber2, + createTransactionNumber2 + ); + + final List accounts = List.of(userAccount, targetAccount, simpleSelfDestructor, simpleCreator); + + @Test + void complexFailureConditionTest() { + + ToyExecutionEnvironmentV2.builder() + .accounts(accounts) + .transactions(transactions) + .zkTracerValidator( + zkTracer -> {}) + .build() + .run(); + } +} diff --git a/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/utilities/MonoOpCodeSmcs.java b/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/utilities/MonoOpCodeSmcs.java index d81289648c..7cea5d389e 100644 --- a/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/utilities/MonoOpCodeSmcs.java +++ b/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/utilities/MonoOpCodeSmcs.java @@ -29,8 +29,7 @@ public class MonoOpCodeSmcs { public static KeyPair keyPair = new SECP256K1().generateKeyPair(); public static Address userAddress = Address.extract(Hash.hash(keyPair.getPublicKey().getEncodedBytes())); - public static ToyAccount userAccount = - ToyAccount.builder().balance(Wei.fromEth(10)).nonce(99).address(userAddress).build(); + public static ToyAccount userAccount = ToyAccount.builder().balance(Wei.fromEth(10)).nonce(99).address(userAddress).build(); public static ToyAccount accountWhoseByteCodeIsASingleStop = ToyAccount.builder() diff --git a/testing/src/main/java/net/consensys/linea/testing/ToyAccount.java b/testing/src/main/java/net/consensys/linea/testing/ToyAccount.java index d66bf1c0bf..12834dada6 100644 --- a/testing/src/main/java/net/consensys/linea/testing/ToyAccount.java +++ b/testing/src/main/java/net/consensys/linea/testing/ToyAccount.java @@ -202,4 +202,15 @@ public ReferenceTestWorldState.AccountMock toAccountMock() { return new ReferenceTestWorldState.AccountMock( Long.toHexString(nonce), balance.toHexString(), accountMockStorage, code.toHexString()); } + + public ToyAccount raiseNonceBy(long k) { + long updatedNonce = this.getNonce() + k; + return new ToyAccount( + this.parent, + this.getAddress(), + updatedNonce, + this.balance, + this.balance + ); + } } From b3fd26f690cf380596e001659b5155320e6865df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Olivier=20B=C3=A9gassat?= Date: Wed, 27 Nov 2024 21:44:54 +0700 Subject: [PATCH 13/44] spotless --- .../createTests/failure/Create.java | 31 +++++++++---------- .../utilities/MonoOpCodeSmcs.java | 3 +- .../consensys/linea/testing/ToyAccount.java | 8 +---- 3 files changed, 18 insertions(+), 24 deletions(-) diff --git a/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/failure/Create.java b/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/failure/Create.java index 3c20f8252f..34ef668f04 100644 --- a/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/failure/Create.java +++ b/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/failure/Create.java @@ -171,12 +171,12 @@ public class Create { final Transaction createTransactionNumber1 = ToyTransaction.builder() - .sender(userAccount.raiseNonceBy(1)) + .sender(userAccount.raiseNonceBy(1)) .to(targetAccount) .keyPair(keyPair) .value(Wei.of(0xeeee)) - .gasLimit(1_000_000L) - .gasPrice(Wei.of(8)) + .gasLimit(1_000_000L) + .gasPrice(Wei.of(8)) .payload(leftPaddedAddress1) .build(); @@ -186,29 +186,29 @@ public class Create { .to(targetAccount) .keyPair(keyPair) .value(Wei.of(0xdddd)) - .gasLimit(1_000_000L) - .gasPrice(Wei.of(8)) + .gasLimit(1_000_000L) + .gasPrice(Wei.of(8)) .payload(leftPaddedAddress2) .build(); final Transaction deploymentTransactionNumber2 = ToyTransaction.builder() - .sender(userAccount.raiseNonceBy(3)) + .sender(userAccount.raiseNonceBy(3)) .to(targetAccount) .keyPair(keyPair) .value(Wei.of(0xcccc)) - .gasLimit(1_000_000L) - .gasPrice(Wei.of(8)) + .gasLimit(1_000_000L) + .gasPrice(Wei.of(8)) .build(); final Transaction createTransactionNumber2 = ToyTransaction.builder() - .sender(userAccount.raiseNonceBy(4)) + .sender(userAccount.raiseNonceBy(4)) .to(targetAccount) .keyPair(keyPair) .value(Wei.of(0xbbbb)) - .gasLimit(1_000_000L) - .gasPrice(Wei.of(8)) + .gasLimit(1_000_000L) + .gasPrice(Wei.of(8)) .payload(leftPaddedAddress1) .build(); @@ -218,10 +218,10 @@ public class Create { createTransactionNumber1, selfDestructTransaction, deploymentTransactionNumber2, - createTransactionNumber2 - ); + createTransactionNumber2); - final List accounts = List.of(userAccount, targetAccount, simpleSelfDestructor, simpleCreator); + final List accounts = + List.of(userAccount, targetAccount, simpleSelfDestructor, simpleCreator); @Test void complexFailureConditionTest() { @@ -229,8 +229,7 @@ void complexFailureConditionTest() { ToyExecutionEnvironmentV2.builder() .accounts(accounts) .transactions(transactions) - .zkTracerValidator( - zkTracer -> {}) + .zkTracerValidator(zkTracer -> {}) .build() .run(); } diff --git a/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/utilities/MonoOpCodeSmcs.java b/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/utilities/MonoOpCodeSmcs.java index 7cea5d389e..d81289648c 100644 --- a/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/utilities/MonoOpCodeSmcs.java +++ b/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/utilities/MonoOpCodeSmcs.java @@ -29,7 +29,8 @@ public class MonoOpCodeSmcs { public static KeyPair keyPair = new SECP256K1().generateKeyPair(); public static Address userAddress = Address.extract(Hash.hash(keyPair.getPublicKey().getEncodedBytes())); - public static ToyAccount userAccount = ToyAccount.builder().balance(Wei.fromEth(10)).nonce(99).address(userAddress).build(); + public static ToyAccount userAccount = + ToyAccount.builder().balance(Wei.fromEth(10)).nonce(99).address(userAddress).build(); public static ToyAccount accountWhoseByteCodeIsASingleStop = ToyAccount.builder() diff --git a/testing/src/main/java/net/consensys/linea/testing/ToyAccount.java b/testing/src/main/java/net/consensys/linea/testing/ToyAccount.java index 12834dada6..c6d0b5eeec 100644 --- a/testing/src/main/java/net/consensys/linea/testing/ToyAccount.java +++ b/testing/src/main/java/net/consensys/linea/testing/ToyAccount.java @@ -205,12 +205,6 @@ public ReferenceTestWorldState.AccountMock toAccountMock() { public ToyAccount raiseNonceBy(long k) { long updatedNonce = this.getNonce() + k; - return new ToyAccount( - this.parent, - this.getAddress(), - updatedNonce, - this.balance, - this.balance - ); + return new ToyAccount(this.parent, this.getAddress(), updatedNonce, this.balance, this.balance); } } From aa81fbaf4d1e16d28cef75ce9ca2b1f4c3a707c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Olivier=20B=C3=A9gassat?= Date: Thu, 28 Nov 2024 14:43:41 +0700 Subject: [PATCH 14/44] feat: added documentation for nontrivial CREATE tests --- .../createTests/nontrivial/Tests.java | 17 -------- .../createTests/nontrivial/todo.md | 43 +++++++++++++++++++ 2 files changed, 43 insertions(+), 17 deletions(-) delete mode 100644 arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/nontrivial/Tests.java create mode 100644 arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/nontrivial/todo.md diff --git a/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/nontrivial/Tests.java b/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/nontrivial/Tests.java deleted file mode 100644 index 5fdc80ec05..0000000000 --- a/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/nontrivial/Tests.java +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright Consensys Software Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - * - * SPDX-License-Identifier: Apache-2.0 - */ -package net.consensys.linea.zktracer.instructionprocessing.createTests.nontrivial; - -public class Tests {} diff --git a/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/nontrivial/todo.md b/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/nontrivial/todo.md new file mode 100644 index 0000000000..fda135edbb --- /dev/null +++ b/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/nontrivial/todo.md @@ -0,0 +1,43 @@ +# Definitions + +Nontrivial CREATE's are those CREATE's that are +- unexceptional +- don't abort +- don't raise the failure condition **F** +- but deploy with nonempty initialization code + +# Parameters + +In terms of the parameters we can play with we find a lot, so many that breaking them up into orthogonal subsets is mandatory + +The first distinction is wrt its **initiation** +- [ ] deployment transaction +- [ ] CREATE-induced deployment +- [ ] CREATE2-induced deployment + +And we must explore the option where said deployment gets reverted later or not +- [ ] WILL_REVERT +- [ ] WONT_REVERT + +Then **during deployment** we can play around with +- [ ] modifying its own storage during deployment phase +- [ ] (using CREATE2) calling its own creator to attempt a second CREATE2 deployment within the deployment at the current deployment address + +In terms of how we **terminate deployment** we must explore those terminations that **revoke it altogether** +- [ ] exception terminates deployment + - [ ] standard exception + - [ ] maxCodeSizeException + - [ ] invalidCodePrefixException +- [ ] REVERT terminates deployment, revoking it altogether + +In terms of how we **terminate deployment** we must explore those terminations that **lead to (temporary) deployment** +- [ ] STOP terminates deployment (leading to empty deployment) +- [ ] SELFDESTRUCT terminates deployment (leading to empty deployment) +- [ ] RETURN terminates deployment + - [ ] empty deployment + - [ ] nonempty deployment + +Once we are in the realm of successful deployments we must explore deployed byte code that +- [ ] allows for modifying its own storage +- [ ] allows for SELFDESTRUCT through its own code +- [ ] ability to DELEGATECALL into other accounts \ No newline at end of file From c8c5aaa6390d2a6eb4212ec6304e6a9f3f0adc7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Olivier=20B=C3=A9gassat?= Date: Fri, 29 Nov 2024 16:34:23 +0700 Subject: [PATCH 15/44] feat: more CREATE test todo's --- .../createTests/nontrivial/todo.md | 21 ++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/nontrivial/todo.md b/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/nontrivial/todo.md index fda135edbb..a0457d960d 100644 --- a/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/nontrivial/todo.md +++ b/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/nontrivial/todo.md @@ -40,4 +40,23 @@ In terms of how we **terminate deployment** we must explore those terminations t Once we are in the realm of successful deployments we must explore deployed byte code that - [ ] allows for modifying its own storage - [ ] allows for SELFDESTRUCT through its own code -- [ ] ability to DELEGATECALL into other accounts \ No newline at end of file +- [ ] ability to DELEGATECALL into other accounts + +# Specific scenarios that we need to test + +- [ ] deployment transaction + - [ ] COINBASE is the deployment address [yes / no] + - [ ] deployment address already has funds [yes / no] + - [ ] deployment success [yes / no] + - [ ] 0th transaction CALL's future deployment address with value [yes / no] + - [ ] 2nd transaction CALL's failed deployment address with value [yes / no] + - [ ] 2nd transaction EXTCODEHASH's failed deployment address [yes / no] + - [ ] 2nd transaction SELFDESTRUCT's and targets failed deployment address with value [yes / no] +- [ ] same thing with CREATE-induced deployment (though this should be working fine as is) + +The rationale for the last points: the recent change that we made to TX_INIT / TX_FINL solved an issue whereby +after a failed deployment transaction the deployment address would still have a nonzero nonce (≥ 1) and thus would +EXIST in the state σ after transaction end. This would have down stream effects such as +- EXTCODEHASH would not behave the same +- CALL with value would cost 25k less gas +- sending funds via SELFDESTRUCT would cost 25k less gas \ No newline at end of file From 3eb1d330b54591407c057709167836ed707dee13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Olivier=20B=C3=A9gassat?= Date: Mon, 2 Dec 2024 13:42:51 +0700 Subject: [PATCH 16/44] ras --- .../createTests/abort/Balance.java | 27 +++++++++++++++++++ .../createTests/nontrivial/todo.md | 2 +- 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/abort/Balance.java b/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/abort/Balance.java index d786a406f8..c880a15335 100644 --- a/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/abort/Balance.java +++ b/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/abort/Balance.java @@ -28,6 +28,7 @@ import net.consensys.linea.zktracer.instructionprocessing.createTests.OffsetParameter; import net.consensys.linea.zktracer.instructionprocessing.createTests.SizeParameter; import net.consensys.linea.zktracer.instructionprocessing.createTests.ValueParameter; +import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; @@ -86,6 +87,32 @@ void rootLevelAbortThenSuccessCreateTest( run(program); } + @Test + void rootLevelAbortThenSuccessCreateTest() { + + // parameters + CreateType createType = CreateType.CREATE; + OffsetParameter offsetParameter = OffsetParameter.ZERO; + SizeParameter sizeParameter = SizeParameter.ZERO; + boolean reverts = true; + + BytecodeCompiler program = BytecodeCompiler.newProgram(); + genericCreate( + program, + createType, + ValueParameter.SELFBALANCE_PLUS_ONE, + offsetParameter, + sizeParameter, + salt01); // aborts + genericCreate(program, createType, ValueParameter.ONE, offsetParameter, sizeParameter, salt01); + + if (reverts) { + appendRevert(program, 2, 13); + } + + run(program); + } + /** * In the tests {@link #rootLevelSuccessThenAbortCreateTest} we perform two CREATE(2)'s in a row. * The first one is designed to succeed, the second one is designed to raise the diff --git a/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/nontrivial/todo.md b/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/nontrivial/todo.md index a0457d960d..fee80001d6 100644 --- a/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/nontrivial/todo.md +++ b/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/nontrivial/todo.md @@ -58,5 +58,5 @@ The rationale for the last points: the recent change that we made to TX_INIT / T after a failed deployment transaction the deployment address would still have a nonzero nonce (≥ 1) and thus would EXIST in the state σ after transaction end. This would have down stream effects such as - EXTCODEHASH would not behave the same -- CALL with value would cost 25k less gas +- CALL with value may cost 25k less gas - sending funds via SELFDESTRUCT would cost 25k less gas \ No newline at end of file From 818e6920efe2cd550016c277d4341281cf5ef7d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Olivier=20B=C3=A9gassat?= Date: Mon, 2 Dec 2024 13:43:20 +0700 Subject: [PATCH 17/44] fix: CREATE's gasPaidOutOfPocket() --- .../linea/zktracer/opcode/gas/projector/Create.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/arithmetization/src/main/java/net/consensys/linea/zktracer/opcode/gas/projector/Create.java b/arithmetization/src/main/java/net/consensys/linea/zktracer/opcode/gas/projector/Create.java index f4b7ad1332..b53c7a5175 100644 --- a/arithmetization/src/main/java/net/consensys/linea/zktracer/opcode/gas/projector/Create.java +++ b/arithmetization/src/main/java/net/consensys/linea/zktracer/opcode/gas/projector/Create.java @@ -52,12 +52,13 @@ public long largestOffset() { @Override public long gasPaidOutOfPocket() { long currentGas = frame.getRemainingGas(); - long gasCost = this.staticGas() + this.memoryExpansion(); + long upfrontGasCost = this.upfrontGasCost(); - if (gasCost > currentGas) { + if (upfrontGasCost > currentGas) { return 0; - } else { - return currentGas - currentGas / 64; } + + long gasMinusUpfront = currentGas - upfrontGasCost; + return gasMinusUpfront - gasMinusUpfront / 64; } } From 2bc38d731daf4016a412d5dedfccf4648a6149ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Olivier=20B=C3=A9gassat?= Date: Mon, 2 Dec 2024 13:44:35 +0700 Subject: [PATCH 18/44] fix: remove double use of CREATE's gasPaidOutOfPocket --- .../zktracer/module/hub/section/CreateSection.java | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/arithmetization/src/main/java/net/consensys/linea/zktracer/module/hub/section/CreateSection.java b/arithmetization/src/main/java/net/consensys/linea/zktracer/module/hub/section/CreateSection.java index a38b94e5f7..2653d51d06 100644 --- a/arithmetization/src/main/java/net/consensys/linea/zktracer/module/hub/section/CreateSection.java +++ b/arithmetization/src/main/java/net/consensys/linea/zktracer/module/hub/section/CreateSection.java @@ -220,18 +220,15 @@ public CreateSection(Hub hub, MessageFrame frame) { // Finally, non-exceptional, non-aborting, non-failing, non-emptyInitCode create //////////////////////////////////////////////////////////////////////////////// - // we charge for the gas paid out of pocked - final long gasMinusUpfrontGasCost = commonValues.gasNext(); - final long gasPaidOutOfPocket = Hub.GAS_PROJECTOR.of(frame, hub.opCode()).gasPaidOutOfPocket(); - commonValues.gasNext(gasMinusUpfrontGasCost - gasPaidOutOfPocket); + // we charge for the gas paid out of pocket + commonValues.payGasPaidOutOfPocket(hub); // we capture revert information about the child context: CCSR and CCRS hub.defers().scheduleForContextReEntry(imcFragment, hub.currentFrame()); // The current execution context pays (63/64)ths of it current gas to the child context - commonValues.payGasPaidOutOfPocket(hub); - hub.defers() - .scheduleForContextReEntry(this, callFrame); // To get the success bit of the CREATE(2) + // To get the success bit of the CREATE(2) operation + hub.defers().scheduleForContextReEntry(this, callFrame); requiresRomLex = true; hub.romLex().callRomLex(frame); From 0611e0e72a6e2b7e2eaa9512923dcf5a5580d865 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Olivier=20B=C3=A9gassat?= Date: Mon, 2 Dec 2024 13:45:02 +0700 Subject: [PATCH 19/44] fix: using creator snapshots for creatorAccountFragment of CreateSection --- .../linea/zktracer/module/hub/section/CreateSection.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/arithmetization/src/main/java/net/consensys/linea/zktracer/module/hub/section/CreateSection.java b/arithmetization/src/main/java/net/consensys/linea/zktracer/module/hub/section/CreateSection.java index 2653d51d06..4e12b255d0 100644 --- a/arithmetization/src/main/java/net/consensys/linea/zktracer/module/hub/section/CreateSection.java +++ b/arithmetization/src/main/java/net/consensys/linea/zktracer/module/hub/section/CreateSection.java @@ -206,6 +206,7 @@ public CreateSection(Hub hub, MessageFrame frame) { if (failedCreate) { finalContextFragment = ContextFragment.nonExecutionProvidesEmptyReturnData(hub); scenarioFragment.setScenario(CREATE_FAILURE_CONDITION_WONT_REVERT); + commonValues.payGasPaidOutOfPocket(hub); hub.failureConditionForCreates = true; return; } @@ -363,8 +364,8 @@ private void finishAbort(final Hub hub) { hub.factories().accountFragment(); final AccountFragment creatorAccountFragment = accountFragmentFactory.make( - preOpcodeCreateeSnapshot, - preOpcodeCreateeSnapshot, + preOpcodeCreatorSnapshot, + preOpcodeCreatorSnapshot, DomSubStampsSubFragment.standardDomSubStamps(this.hubStamp(), 0)); final ContextFragment updatedCurrentContextFragment = From 581a7abd02029479d78e6b0de5239485a6a88450 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Olivier=20B=C3=A9gassat?= Date: Mon, 2 Dec 2024 14:56:15 +0700 Subject: [PATCH 20/44] fix: CREATE2 gas pricing (similar error to CREATE pricing error) fixes GAS_NEXT issues for now --- .../zktracer/module/hub/fragment/imc/StpCall.java | 14 +++++++------- .../zktracer/module/hub/section/CreateSection.java | 2 +- .../module/hub/section/call/CallSection.java | 2 +- .../zktracer/opcode/gas/projector/Create2.java | 11 +++++++---- 4 files changed, 16 insertions(+), 13 deletions(-) diff --git a/arithmetization/src/main/java/net/consensys/linea/zktracer/module/hub/fragment/imc/StpCall.java b/arithmetization/src/main/java/net/consensys/linea/zktracer/module/hub/fragment/imc/StpCall.java index 9abc2d4427..8425d41694 100644 --- a/arithmetization/src/main/java/net/consensys/linea/zktracer/module/hub/fragment/imc/StpCall.java +++ b/arithmetization/src/main/java/net/consensys/linea/zktracer/module/hub/fragment/imc/StpCall.java @@ -59,16 +59,17 @@ public class StpCall implements TraceSubFragment { @EqualsAndHashCode.Include long gasPaidOutOfPocket; @EqualsAndHashCode.Include long stipend; - public StpCall(Hub hub, long memoryExpansionGas) { - this.memoryExpansionGas = memoryExpansionGas; + public StpCall(Hub hub, MessageFrame frame, long memoryExpansionGas) { this.opCode = hub.opCode(); - this.gasActual = hub.messageFrame().getRemainingGas(); checkArgument(this.opCode.isCall() || this.opCode.isCreate()); + this.memoryExpansionGas = memoryExpansionGas; + this.gasActual = frame.getRemainingGas(); + if (this.opCode.isCall()) { this.stpCallForCalls(hub); } else { - this.stpCallForCreates(hub); + this.stpCallForCreates(frame); } } @@ -114,8 +115,7 @@ private long gasPaidOutOfPocketForCalls() { } } - private void stpCallForCreates(Hub hub) { - MessageFrame frame = hub.messageFrame(); + private void stpCallForCreates(MessageFrame frame) { this.gas = ZERO; // irrelevant this.value = EWord.of(frame.getStackItem(0)); @@ -132,7 +132,7 @@ private long computeGasPaidOutOfPocketForCreates() { return 0; } else { long gasMinusUpfrontCost = gasActual - upfrontGasCost; - return gasMinusUpfrontCost - (gasMinusUpfrontCost >> 6); + return gasMinusUpfrontCost - gasMinusUpfrontCost / 64; } } diff --git a/arithmetization/src/main/java/net/consensys/linea/zktracer/module/hub/section/CreateSection.java b/arithmetization/src/main/java/net/consensys/linea/zktracer/module/hub/section/CreateSection.java index 4e12b255d0..0c26d1f1f4 100644 --- a/arithmetization/src/main/java/net/consensys/linea/zktracer/module/hub/section/CreateSection.java +++ b/arithmetization/src/main/java/net/consensys/linea/zktracer/module/hub/section/CreateSection.java @@ -130,7 +130,7 @@ public CreateSection(Hub hub, MessageFrame frame) { return; } - final StpCall stpCall = new StpCall(hub, mxpCall.getGasMxp()); + final StpCall stpCall = new StpCall(hub, frame, mxpCall.getGasMxp()); imcFragment.callStp(stpCall); checkArgument(stpCall.outOfGasException() == Exceptions.outOfGasException(exceptions)); diff --git a/arithmetization/src/main/java/net/consensys/linea/zktracer/module/hub/section/call/CallSection.java b/arithmetization/src/main/java/net/consensys/linea/zktracer/module/hub/section/call/CallSection.java index 7d3b315eec..10337d44b7 100644 --- a/arithmetization/src/main/java/net/consensys/linea/zktracer/module/hub/section/call/CallSection.java +++ b/arithmetization/src/main/java/net/consensys/linea/zktracer/module/hub/section/call/CallSection.java @@ -175,7 +175,7 @@ public CallSection(Hub hub, MessageFrame frame) { return; } - stpCall = new StpCall(hub, mxpCall.gasMxp); + stpCall = new StpCall(hub, frame, mxpCall.gasMxp); firstImcFragment.callStp(stpCall); checkArgument( stpCall.outOfGasException() == Exceptions.outOfGasException(exceptions), diff --git a/arithmetization/src/main/java/net/consensys/linea/zktracer/opcode/gas/projector/Create2.java b/arithmetization/src/main/java/net/consensys/linea/zktracer/opcode/gas/projector/Create2.java index 52f3ed6a85..8a602e1bb7 100644 --- a/arithmetization/src/main/java/net/consensys/linea/zktracer/opcode/gas/projector/Create2.java +++ b/arithmetization/src/main/java/net/consensys/linea/zktracer/opcode/gas/projector/Create2.java @@ -15,6 +15,7 @@ package net.consensys.linea.zktracer.opcode.gas.projector; +import static com.google.common.base.Preconditions.checkState; import static org.hyperledger.besu.evm.internal.Words.clampedToLong; import net.consensys.linea.zktracer.module.constants.GlobalConstants; @@ -57,13 +58,15 @@ public long linearPerWord() { @Override public long gasPaidOutOfPocket() { long currentGas = frame.getRemainingGas(); - long gasCost = this.staticGas() + this.memoryExpansion() + this.linearPerWord(); + long upfrontGasCost = this.upfrontGasCost(); - if (gasCost > currentGas) { + if (upfrontGasCost > currentGas) { return 0; - } else { - return currentGas - currentGas / 64; } + + final long gasMinusUpfrontGasCost = currentGas - upfrontGasCost; + + return gasMinusUpfrontGasCost - gasMinusUpfrontGasCost / 64; } @Override From 1cf202eb3d271a3e0aaaf2c7b2082d2bb10ce242 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Olivier=20B=C3=A9gassat?= Date: Mon, 2 Dec 2024 16:01:18 +0700 Subject: [PATCH 21/44] fix: CREATE2 address computations now trace the nonce Not that the nonce is required, but it's part of the lookup HUB -> RLPADDR --- .../net/consensys/linea/zktracer/module/rlpaddr/RlpAddr.java | 5 ++++- .../linea/zktracer/module/rlpaddr/RlpAddrOperation.java | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/arithmetization/src/main/java/net/consensys/linea/zktracer/module/rlpaddr/RlpAddr.java b/arithmetization/src/main/java/net/consensys/linea/zktracer/module/rlpaddr/RlpAddr.java index 46980af5f1..df81dcfd41 100644 --- a/arithmetization/src/main/java/net/consensys/linea/zktracer/module/rlpaddr/RlpAddr.java +++ b/arithmetization/src/main/java/net/consensys/linea/zktracer/module/rlpaddr/RlpAddr.java @@ -109,7 +109,7 @@ public void callRlpAddrCreate2(MessageFrame frame, Bytes32 salt, Bytes32 hash) { final Address currentAddress = frame.getRecipientAddress(); final Bytes32 rawCreate2Address = getCreate2RawAddress(currentAddress, salt, hash); final RlpAddrOperation operation = - new RlpAddrOperation(rawCreate2Address, OpCode.CREATE2, currentAddress, salt, hash); + new RlpAddrOperation(rawCreate2Address, OpCode.CREATE2, currentAddress, salt, hash, longToUnsignedBigInteger(frame.getWorldUpdater().get(currentAddress).getNonce())); operations.add(operation); hub.trm().callTrimming(rawCreate2Address); } @@ -118,6 +118,8 @@ private void traceCreate2(int stamp, RlpAddrOperation chunk, Trace trace) { final Bytes rawAddressHi = chunk.rawHash().slice(0, LLARGE); final long depAddressHi = rawAddressHi.slice(12, 4).toLong(); final Bytes depAddressLo = chunk.rawHash().slice(LLARGE, LLARGE); + final BigInteger nonce = chunk.nonce().orElseThrow(); + final Bytes nonceBytes = bigIntegerToBytes(nonce); for (int ct = 0; ct <= MAX_CT_CREATE2; ct++) { trace @@ -134,6 +136,7 @@ private void traceCreate2(int stamp, RlpAddrOperation chunk, Trace trace) { .saltLo(chunk.salt().orElseThrow().slice(LLARGE, LLARGE)) .kecHi(chunk.keccak().orElseThrow().slice(0, LLARGE)) .kecLo(chunk.keccak().orElseThrow().slice(LLARGE, LLARGE)) + .nonce(nonceBytes) .lc(true) .index(UnsignedByte.of(ct)) .counter(UnsignedByte.of(ct)); diff --git a/arithmetization/src/main/java/net/consensys/linea/zktracer/module/rlpaddr/RlpAddrOperation.java b/arithmetization/src/main/java/net/consensys/linea/zktracer/module/rlpaddr/RlpAddrOperation.java index d54920c1dc..a355f9d498 100644 --- a/arithmetization/src/main/java/net/consensys/linea/zktracer/module/rlpaddr/RlpAddrOperation.java +++ b/arithmetization/src/main/java/net/consensys/linea/zktracer/module/rlpaddr/RlpAddrOperation.java @@ -49,8 +49,8 @@ public RlpAddrOperation(Bytes32 rawDepAddress, OpCode opCode, BigInteger nonce, // CREATE2 operation public RlpAddrOperation( - Bytes32 rawHash, OpCode opCode, Address address, Bytes32 salt, Bytes32 kec) { - this(rawHash, opCode, Optional.empty(), address, Optional.of(salt), Optional.of(kec)); + Bytes32 rawHash, OpCode opCode, Address address, Bytes32 salt, Bytes32 kec, BigInteger nonce) { + this(rawHash, opCode, Optional.of(nonce), address, Optional.of(salt), Optional.of(kec)); } @Override From 64fe94b75f3be0ffacb82412f36ab26e04e030f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Olivier=20B=C3=A9gassat?= Date: Mon, 2 Dec 2024 16:01:28 +0700 Subject: [PATCH 22/44] ras --- .../createTests/trivial/RootLevel.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/trivial/RootLevel.java b/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/trivial/RootLevel.java index 8fb678de69..c8a03372d2 100644 --- a/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/trivial/RootLevel.java +++ b/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/trivial/RootLevel.java @@ -26,6 +26,7 @@ import net.consensys.linea.testing.BytecodeRunner; import net.consensys.linea.zktracer.instructionprocessing.createTests.*; import net.consensys.linea.zktracer.opcode.OpCode; +import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.EnumSource; @@ -36,6 +37,20 @@ public class RootLevel { public static String salt01 = "5a1701"; public static String salt02 = "5a1702"; + @Test + void basicCreate2Test() { + + BytecodeCompiler program = BytecodeCompiler.newProgram(); + program + .push(0xadd7) // salt + .push(1) // size + .push(0) // offset + .push(1) // value + .op(CREATE2); + + run(program); + } + @ParameterizedTest @MethodSource("createParametersForEmptyCreates") void rootLevelCreateTests( From ba8e12c37655916ac74a2c0bee83fd3d20f50da6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Olivier=20B=C3=A9gassat?= Date: Mon, 2 Dec 2024 18:47:01 +0700 Subject: [PATCH 23/44] spotless --- .../linea/zktracer/module/rlpaddr/RlpAddr.java | 8 +++++++- .../zktracer/module/rlpaddr/RlpAddrOperation.java | 7 ++++++- .../linea/zktracer/opcode/gas/projector/Create2.java | 1 - .../createTests/abort/Balance.java | 12 ++++++------ .../createTests/trivial/RootLevel.java | 10 +++++----- linea-constraints | 2 +- 6 files changed, 25 insertions(+), 15 deletions(-) diff --git a/arithmetization/src/main/java/net/consensys/linea/zktracer/module/rlpaddr/RlpAddr.java b/arithmetization/src/main/java/net/consensys/linea/zktracer/module/rlpaddr/RlpAddr.java index df81dcfd41..034801744f 100644 --- a/arithmetization/src/main/java/net/consensys/linea/zktracer/module/rlpaddr/RlpAddr.java +++ b/arithmetization/src/main/java/net/consensys/linea/zktracer/module/rlpaddr/RlpAddr.java @@ -109,7 +109,13 @@ public void callRlpAddrCreate2(MessageFrame frame, Bytes32 salt, Bytes32 hash) { final Address currentAddress = frame.getRecipientAddress(); final Bytes32 rawCreate2Address = getCreate2RawAddress(currentAddress, salt, hash); final RlpAddrOperation operation = - new RlpAddrOperation(rawCreate2Address, OpCode.CREATE2, currentAddress, salt, hash, longToUnsignedBigInteger(frame.getWorldUpdater().get(currentAddress).getNonce())); + new RlpAddrOperation( + rawCreate2Address, + OpCode.CREATE2, + currentAddress, + salt, + hash, + longToUnsignedBigInteger(frame.getWorldUpdater().get(currentAddress).getNonce())); operations.add(operation); hub.trm().callTrimming(rawCreate2Address); } diff --git a/arithmetization/src/main/java/net/consensys/linea/zktracer/module/rlpaddr/RlpAddrOperation.java b/arithmetization/src/main/java/net/consensys/linea/zktracer/module/rlpaddr/RlpAddrOperation.java index a355f9d498..4c44e7ac57 100644 --- a/arithmetization/src/main/java/net/consensys/linea/zktracer/module/rlpaddr/RlpAddrOperation.java +++ b/arithmetization/src/main/java/net/consensys/linea/zktracer/module/rlpaddr/RlpAddrOperation.java @@ -49,7 +49,12 @@ public RlpAddrOperation(Bytes32 rawDepAddress, OpCode opCode, BigInteger nonce, // CREATE2 operation public RlpAddrOperation( - Bytes32 rawHash, OpCode opCode, Address address, Bytes32 salt, Bytes32 kec, BigInteger nonce) { + Bytes32 rawHash, + OpCode opCode, + Address address, + Bytes32 salt, + Bytes32 kec, + BigInteger nonce) { this(rawHash, opCode, Optional.of(nonce), address, Optional.of(salt), Optional.of(kec)); } diff --git a/arithmetization/src/main/java/net/consensys/linea/zktracer/opcode/gas/projector/Create2.java b/arithmetization/src/main/java/net/consensys/linea/zktracer/opcode/gas/projector/Create2.java index 8a602e1bb7..ac961ea6a8 100644 --- a/arithmetization/src/main/java/net/consensys/linea/zktracer/opcode/gas/projector/Create2.java +++ b/arithmetization/src/main/java/net/consensys/linea/zktracer/opcode/gas/projector/Create2.java @@ -15,7 +15,6 @@ package net.consensys.linea.zktracer.opcode.gas.projector; -import static com.google.common.base.Preconditions.checkState; import static org.hyperledger.besu.evm.internal.Words.clampedToLong; import net.consensys.linea.zktracer.module.constants.GlobalConstants; diff --git a/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/abort/Balance.java b/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/abort/Balance.java index c880a15335..a0230bbe92 100644 --- a/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/abort/Balance.java +++ b/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/abort/Balance.java @@ -98,12 +98,12 @@ void rootLevelAbortThenSuccessCreateTest() { BytecodeCompiler program = BytecodeCompiler.newProgram(); genericCreate( - program, - createType, - ValueParameter.SELFBALANCE_PLUS_ONE, - offsetParameter, - sizeParameter, - salt01); // aborts + program, + createType, + ValueParameter.SELFBALANCE_PLUS_ONE, + offsetParameter, + sizeParameter, + salt01); // aborts genericCreate(program, createType, ValueParameter.ONE, offsetParameter, sizeParameter, salt01); if (reverts) { diff --git a/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/trivial/RootLevel.java b/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/trivial/RootLevel.java index c8a03372d2..f40e711c0b 100644 --- a/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/trivial/RootLevel.java +++ b/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/trivial/RootLevel.java @@ -42,11 +42,11 @@ void basicCreate2Test() { BytecodeCompiler program = BytecodeCompiler.newProgram(); program - .push(0xadd7) // salt - .push(1) // size - .push(0) // offset - .push(1) // value - .op(CREATE2); + .push(0xadd7) // salt + .push(1) // size + .push(0) // offset + .push(1) // value + .op(CREATE2); run(program); } diff --git a/linea-constraints b/linea-constraints index f0ce0da1e1..beca2079b9 160000 --- a/linea-constraints +++ b/linea-constraints @@ -1 +1 @@ -Subproject commit f0ce0da1e102ecff0ed1d83e6ece0e2874cc07ad +Subproject commit beca2079b916725bdd3f2b0cdc42742ce750db35 From 4a45440c5a34edac4a44b84ff5ba4c437055b040 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Olivier=20B=C3=A9gassat?= Date: Mon, 2 Dec 2024 20:33:53 +0700 Subject: [PATCH 24/44] feat: upgraded the todo.md's to GitHub issues --- .../createTests/abort/todo.md | 18 ---- .../createTests/failure/todo.md | 93 ------------------- .../createTests/nontrivial/todo.md | 62 ------------- .../createTests/trivial/todo.md | 28 ------ 4 files changed, 201 deletions(-) delete mode 100644 arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/abort/todo.md delete mode 100644 arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/failure/todo.md delete mode 100644 arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/nontrivial/todo.md delete mode 100644 arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/trivial/todo.md diff --git a/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/abort/todo.md b/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/abort/todo.md deleted file mode 100644 index 6fe8b53714..0000000000 --- a/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/abort/todo.md +++ /dev/null @@ -1,18 +0,0 @@ -# Definitions - -Aborted CREATE's are those CREATE's that are -- unexceptional -- attempt to provide more balance than is avaiable or happen at CSD = 1024 - -# Parameters - -- [ ] fail because of BALANCE -- [ ] fail because of CALL_STACK_DEPTH - -We can then -- [ ] do an EXTCODEHASH on the deployment address to test - - warmth (shouldn't be warm) - - existence (should exist or not depending on balance alone unless collision) -- [ ] two deployment tests - - [ ] first deployment aborts with CREATE(2), a second deployment at this place doesn't abort - - [ ] first deployment succeeds with CREATE2, a second attempt aborts before FailureCondition **F** can be raised. \ No newline at end of file diff --git a/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/failure/todo.md b/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/failure/todo.md deleted file mode 100644 index 8837a48477..0000000000 --- a/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/failure/todo.md +++ /dev/null @@ -1,93 +0,0 @@ -# Definitions - -Failure Condition **F** CREATE's are those CREATE's that -- are unexceptional -- don't abort -- but raise Failure Condition **F** - -Recall that this condition is triggered when the deployment address has one or more of the following properties -- nonzero nonce -- nonempty code - -**Note.** Nonzero balance isn't an issue. - -There are two main ways to produce the Failure Condition **F**. -- simple: address collisions are trivial to produce via CREATE2; here we have two ways to deploy: - - [ ] empty deployed code - - [ ] nonempty deployed code -- harder: address collisions via CREATE - -This is classical by now: -- contract A does a CREATE2 deploying contract B - - contract B should be able to do a SELFDESTRUCT / CREATE -- contract B does a CREATE deploying contract C while it has nonce n (e.g. n = 1) -- contract B selfdestructs -- contract A re-deploys contract B using CREATE2 again -- contract B attempts a CREATE at the same nonce n as previously, effectively attempting to re-deploy at contract C's address - -I guess the simplest way to achieve this would be to have B have the following code - -```asm -// contract B deployed code -PUSH1 0 -PUSH1 0 -PUSH1 0 -PUSH1 0 -PUSH1 0 -CALLDATALOAD // expecting to find an address in call data -GAS -DELEGATECALL -``` - -This byte code measures 13 bytes. The associated init code would be -```asm -PUSH13 ... -PUSH1 0 -MSTORE -PUSH1 13 -PUSH1 0 -RETURN -``` - -which is 22 bytes. It should be deployed in a CREATE2 with 1 Wei of value. - -We then need two contracts: -- one that simply selfdestructs -- another one that CREATEs. - -E.g. - -```asm -// basic CREATE-or contract (deploys 0x) -PUSH1 0 -PUSH1 0 -PUSH1 0 -CREATE -``` -or -```asm -// alternative basic CREATE-or contract (deploys 0x00 .. 00) -PUSH1 32 -PUSH1 0 -PUSH1 0 -CREATE -``` - -```asm -// basic SELFDESTRUCT-or -ORIGIN -SELFDESTRUCT -``` - -The simplest scenario would be -- transaction 1: - - to contract A - - deploy contract B - - get back to A - - CALL contract B with call data the address of the basic CREATE-or - - CALL contract B with call data the address of the basic SELFDESTRUCT-or -- transaction 2: - - to contract A - - deploy contract B (which is clean) - - CALL contract B with call data the address of the basic CREATE-or - - raise failure condition F diff --git a/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/nontrivial/todo.md b/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/nontrivial/todo.md deleted file mode 100644 index fee80001d6..0000000000 --- a/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/nontrivial/todo.md +++ /dev/null @@ -1,62 +0,0 @@ -# Definitions - -Nontrivial CREATE's are those CREATE's that are -- unexceptional -- don't abort -- don't raise the failure condition **F** -- but deploy with nonempty initialization code - -# Parameters - -In terms of the parameters we can play with we find a lot, so many that breaking them up into orthogonal subsets is mandatory - -The first distinction is wrt its **initiation** -- [ ] deployment transaction -- [ ] CREATE-induced deployment -- [ ] CREATE2-induced deployment - -And we must explore the option where said deployment gets reverted later or not -- [ ] WILL_REVERT -- [ ] WONT_REVERT - -Then **during deployment** we can play around with -- [ ] modifying its own storage during deployment phase -- [ ] (using CREATE2) calling its own creator to attempt a second CREATE2 deployment within the deployment at the current deployment address - -In terms of how we **terminate deployment** we must explore those terminations that **revoke it altogether** -- [ ] exception terminates deployment - - [ ] standard exception - - [ ] maxCodeSizeException - - [ ] invalidCodePrefixException -- [ ] REVERT terminates deployment, revoking it altogether - -In terms of how we **terminate deployment** we must explore those terminations that **lead to (temporary) deployment** -- [ ] STOP terminates deployment (leading to empty deployment) -- [ ] SELFDESTRUCT terminates deployment (leading to empty deployment) -- [ ] RETURN terminates deployment - - [ ] empty deployment - - [ ] nonempty deployment - -Once we are in the realm of successful deployments we must explore deployed byte code that -- [ ] allows for modifying its own storage -- [ ] allows for SELFDESTRUCT through its own code -- [ ] ability to DELEGATECALL into other accounts - -# Specific scenarios that we need to test - -- [ ] deployment transaction - - [ ] COINBASE is the deployment address [yes / no] - - [ ] deployment address already has funds [yes / no] - - [ ] deployment success [yes / no] - - [ ] 0th transaction CALL's future deployment address with value [yes / no] - - [ ] 2nd transaction CALL's failed deployment address with value [yes / no] - - [ ] 2nd transaction EXTCODEHASH's failed deployment address [yes / no] - - [ ] 2nd transaction SELFDESTRUCT's and targets failed deployment address with value [yes / no] -- [ ] same thing with CREATE-induced deployment (though this should be working fine as is) - -The rationale for the last points: the recent change that we made to TX_INIT / TX_FINL solved an issue whereby -after a failed deployment transaction the deployment address would still have a nonzero nonce (≥ 1) and thus would -EXIST in the state σ after transaction end. This would have down stream effects such as -- EXTCODEHASH would not behave the same -- CALL with value may cost 25k less gas -- sending funds via SELFDESTRUCT would cost 25k less gas \ No newline at end of file diff --git a/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/trivial/todo.md b/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/trivial/todo.md deleted file mode 100644 index 66d1b0cafe..0000000000 --- a/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/trivial/todo.md +++ /dev/null @@ -1,28 +0,0 @@ -# Definitions - -Trivial CREATE's are those CREATE's that are -- unexceptional -- don't abort -- don't raise the failure condition **F** -- but deploy with empty initialization code - -# Parameters - -In terms of the parameters we can play with we find: -- [ ] level - - [x] root level - - [ ] higher level -- [x] CREATE vs CREATE2 -- [x] zero value vs nonzero value -- [x] WILL_REVERT vs WONT_REVERT -- [ ] zero size - - [ ] 'zero size, huge offset' shenanigans -- [ ] nonzero size - -We _could_ also consider collisions via CREATE2 or through multi transactions and SELFDESTRUCT's. -This will be the focus of other tests. We should also measure the interaction that these trivial deployments have with EXTCODEHASH. -Furthermore, we should see how these deployments squash any return data (if present.) And then there is obviously the question of deployment numbers, deployment statuses. - -- EXTCODEHASH before and after -- squashing of return data and RETURNDATASIZE -- warmth post deployment (EXTCODEXXX + BALANCE + CALL's + SELFDESTRUCT heir + ...) From 117b7766087810c9262668f1a047a85c17861ddb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Olivier=20B=C3=A9gassat?= Date: Mon, 2 Dec 2024 23:16:53 +0700 Subject: [PATCH 25/44] fix: RLPADDR needs to hash the nonce to disambiguate CREATE2's We unconditionally import account.nonce() to the RLPADDR module. We must therefore also include the nonce to disambiguate duplicate CREATE2's --- .../zktracer/module/rlpaddr/RlpAddr.java | 20 +++++++++---------- .../module/rlpaddr/RlpAddrOperation.java | 10 +++++----- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/arithmetization/src/main/java/net/consensys/linea/zktracer/module/rlpaddr/RlpAddr.java b/arithmetization/src/main/java/net/consensys/linea/zktracer/module/rlpaddr/RlpAddr.java index 034801744f..3d862b4305 100644 --- a/arithmetization/src/main/java/net/consensys/linea/zktracer/module/rlpaddr/RlpAddr.java +++ b/arithmetization/src/main/java/net/consensys/linea/zktracer/module/rlpaddr/RlpAddr.java @@ -124,7 +124,7 @@ private void traceCreate2(int stamp, RlpAddrOperation chunk, Trace trace) { final Bytes rawAddressHi = chunk.rawHash().slice(0, LLARGE); final long depAddressHi = rawAddressHi.slice(12, 4).toLong(); final Bytes depAddressLo = chunk.rawHash().slice(LLARGE, LLARGE); - final BigInteger nonce = chunk.nonce().orElseThrow(); + final BigInteger nonce = chunk.nonce(); final Bytes nonceBytes = bigIntegerToBytes(nonce); for (int ct = 0; ct <= MAX_CT_CREATE2; ct++) { @@ -138,10 +138,10 @@ private void traceCreate2(int stamp, RlpAddrOperation chunk, Trace trace) { .depAddrLo(depAddressLo) .addrHi(chunk.address().slice(0, 4).toLong()) .addrLo(chunk.address().slice(4, LLARGE)) - .saltHi(chunk.salt().orElseThrow().slice(0, LLARGE)) - .saltLo(chunk.salt().orElseThrow().slice(LLARGE, LLARGE)) - .kecHi(chunk.keccak().orElseThrow().slice(0, LLARGE)) - .kecLo(chunk.keccak().orElseThrow().slice(LLARGE, LLARGE)) + .saltHi(chunk.salt().slice(0, LLARGE)) + .saltLo(chunk.salt().slice(LLARGE, LLARGE)) + .kecHi(chunk.keccak().slice(0, LLARGE)) + .kecLo(chunk.keccak().slice(LLARGE, LLARGE)) .nonce(nonceBytes) .lc(true) .index(UnsignedByte.of(ct)) @@ -158,19 +158,19 @@ private void traceCreate2(int stamp, RlpAddrOperation chunk, Trace trace) { .nBytes(BYTES_LLARGE) .selectorKeccakRes(false); case 2 -> trace - .limb(chunk.salt().orElseThrow().slice(0, LLARGE)) + .limb(chunk.salt().slice(0, LLARGE)) .nBytes(BYTES_LLARGE) .selectorKeccakRes(false); case 3 -> trace - .limb(chunk.salt().orElseThrow().slice(LLARGE, LLARGE)) + .limb(chunk.salt().slice(LLARGE, LLARGE)) .nBytes(BYTES_LLARGE) .selectorKeccakRes(false); case 4 -> trace - .limb(chunk.keccak().orElseThrow().slice(0, LLARGE)) + .limb(chunk.keccak().slice(0, LLARGE)) .nBytes(BYTES_LLARGE) .selectorKeccakRes(false); case 5 -> trace - .limb(chunk.keccak().orElseThrow().slice(LLARGE, LLARGE)) + .limb(chunk.keccak().slice(LLARGE, LLARGE)) .nBytes(BYTES_LLARGE) .selectorKeccakRes(false); } @@ -181,7 +181,7 @@ private void traceCreate2(int stamp, RlpAddrOperation chunk, Trace trace) { } private void traceCreate(int stamp, RlpAddrOperation chunk, Trace trace) { - final BigInteger nonce = chunk.nonce().orElseThrow(); + final BigInteger nonce = chunk.nonce(); Bytes nonceShifted = leftPadTo(bigIntegerToBytes(nonce), recipe1NbRows); Boolean tinyNonZeroNonce = true; diff --git a/arithmetization/src/main/java/net/consensys/linea/zktracer/module/rlpaddr/RlpAddrOperation.java b/arithmetization/src/main/java/net/consensys/linea/zktracer/module/rlpaddr/RlpAddrOperation.java index 4c44e7ac57..3c36933e53 100644 --- a/arithmetization/src/main/java/net/consensys/linea/zktracer/module/rlpaddr/RlpAddrOperation.java +++ b/arithmetization/src/main/java/net/consensys/linea/zktracer/module/rlpaddr/RlpAddrOperation.java @@ -37,14 +37,14 @@ public final class RlpAddrOperation extends ModuleOperation { @EqualsAndHashCode.Include private final Bytes32 rawHash; private final OpCode opCode; - private final Optional nonce; + @EqualsAndHashCode.Include private final BigInteger nonce; private final Address address; - private final Optional salt; - private final Optional keccak; + private final Bytes32 salt; + private final Bytes32 keccak; // CREATE operation public RlpAddrOperation(Bytes32 rawDepAddress, OpCode opCode, BigInteger nonce, Address address) { - this(rawDepAddress, opCode, Optional.of(nonce), address, Optional.empty(), Optional.empty()); + this(rawDepAddress, opCode, nonce, address, Bytes32.ZERO, Bytes32.ZERO); } // CREATE2 operation @@ -55,7 +55,7 @@ public RlpAddrOperation( Bytes32 salt, Bytes32 kec, BigInteger nonce) { - this(rawHash, opCode, Optional.of(nonce), address, Optional.of(salt), Optional.of(kec)); + this(rawHash, opCode, nonce, address, salt, kec); } @Override From ce0677d7e81b7359876113eb0ef9ba39f2c0e78d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Olivier=20B=C3=A9gassat?= Date: Thu, 5 Dec 2024 11:21:38 +0700 Subject: [PATCH 26/44] fix: documentation for CreateInducedFailureTest --- .../createTests/failure/Create.java | 236 --------------- ...2.java => Create2InducedFailureTests.java} | 2 +- .../failure/CreateInducedFailureTest.java | 271 ++++++++++++++++++ 3 files changed, 272 insertions(+), 237 deletions(-) delete mode 100644 arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/failure/Create.java rename arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/failure/{Create2.java => Create2InducedFailureTests.java} (98%) create mode 100644 arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/failure/CreateInducedFailureTest.java diff --git a/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/failure/Create.java b/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/failure/Create.java deleted file mode 100644 index 34ef668f04..0000000000 --- a/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/failure/Create.java +++ /dev/null @@ -1,236 +0,0 @@ -/* - * Copyright Consensys Software Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - * - * SPDX-License-Identifier: Apache-2.0 - */ -package net.consensys.linea.zktracer.instructionprocessing.createTests.failure; - -import static net.consensys.linea.zktracer.instructionprocessing.createTests.trivial.RootLevel.salt01; -import static net.consensys.linea.zktracer.instructionprocessing.utilities.MonoOpCodeSmcs.keyPair; -import static net.consensys.linea.zktracer.instructionprocessing.utilities.MonoOpCodeSmcs.userAccount; -import static net.consensys.linea.zktracer.opcode.OpCode.*; -import static net.consensys.linea.zktracer.types.Utils.leftPadTo; - -import java.util.List; - -import net.consensys.linea.testing.BytecodeCompiler; -import net.consensys.linea.testing.ToyAccount; -import net.consensys.linea.testing.ToyExecutionEnvironmentV2; -import net.consensys.linea.testing.ToyTransaction; -import org.apache.tuweni.bytes.Bytes; -import org.hyperledger.besu.datatypes.Address; -import org.hyperledger.besu.datatypes.Wei; -import org.hyperledger.besu.ethereum.core.Transaction; -import org.junit.jupiter.api.Test; - -public class Create { - - final Bytes tinyAddress1 = Bytes.fromHexString("badd1ec0de"); - final Bytes tinyAddress2 = Bytes.fromHexString("900d1ec0de"); - final Bytes leftPaddedAddress1 = leftPadTo(tinyAddress1, 32); - final Bytes leftPaddedAddress2 = leftPadTo(tinyAddress2, 32); - final Address address1 = Address.wrap(leftPadTo(tinyAddress1, 20)); - final Address address2 = Address.wrap(leftPadTo(tinyAddress2, 20)); - final Address targetAddress = Address.fromHexString("797add7e55"); - - final BytecodeCompiler simpleSelfDestruct = - BytecodeCompiler.newProgram().op(ORIGIN).op(SELFDESTRUCT); - - final ToyAccount simpleSelfDestructor = - ToyAccount.builder() - .code(simpleSelfDestruct.compile()) - .nonce(91) - .balance(Wei.of(1234L)) - .address(address1) - .build(); - - final BytecodeCompiler simpleCreate = - BytecodeCompiler.newProgram() - .push(0) // empty init code - .push(0) - .push(1) // value - .op(CREATE); - - final ToyAccount simpleCreator = - ToyAccount.builder() - .code(simpleCreate.compile()) - .nonce(512) - .balance(Wei.of(73L)) - .address(address2) - .build(); - - final BytecodeCompiler codeToDeploy = - BytecodeCompiler.newProgram() - .push(0) // rac - .push(0) // rao - .push(0) // cds - .push(0) // cdo - .push(0) - .op(CALLDATALOAD) // should be an address - .op(GAS) - .op(DELEGATECALL); - - final BytecodeCompiler initCodeThatDeploysTheDesiredCode = - BytecodeCompiler.newProgram() - .push(codeToDeploy.compile()) - .push(8 * (32 - codeToDeploy.compile().size())) - .op(SHL) - .push(0) - .op(MSTORE) - .push(codeToDeploy.compile().size()) // code size - .push(0) - .op(RETURN); - - int addressKey = 0xad; - - final BytecodeCompiler targetByteCode = - BytecodeCompiler.newProgram() - .op(CALLDATASIZE) - .op(ISZERO) - .push(1) - .op(SUB) // ¬ [CALLDATASIZE == 0] - .push( - 1 - + 1 - + (1 + 1) - + 1 - + (1 + 1) - + 1 // - + (1 + initCodeThatDeploysTheDesiredCode.compile().size()) - + (1 + 1) - + 1 - + (1 + 1) - + 1 - + (1 + salt01.length() / 2) - + 1 - + (1 + 1) - + (1 + 1) - + (1 + 1) - + 1 - + (1 + 1) - + 1 - + 1 // - ) - .op(JUMPI) - // - .push(initCodeThatDeploysTheDesiredCode.compile()) - .push(8 * (32 - initCodeThatDeploysTheDesiredCode.compile().size())) - .op(SHL) - .push(0) - .op(MSTORE) - .push(salt01) - .push(initCodeThatDeploysTheDesiredCode.compile().size()) // init code size - .push(0) // offset - .push(0xff) // value - .op(CREATE2) - .push(addressKey) - .op(SSTORE) - .op(STOP) - // - .op(JUMPDEST) - .push(0) - .op(CALLDATALOAD) // extracts (address) from call data - .push(0) - .op(MSTORE) - .push(0) // rac - .push(0) // rao - .push(0x20) // cds - .push(0) // cdo - .push(addressKey) - .op(SLOAD) // extract stored address - .push(0xef) // value - .op(GAS) // gas - .op(CALL); - - final ToyAccount targetAccount = - ToyAccount.builder() - .code(targetByteCode.compile()) - .nonce(1337) - .balance(Wei.of(73L)) - .address(targetAddress) - .build(); - - final Transaction deploymentTransactionNumber1 = - ToyTransaction.builder() - .sender(userAccount) - .to(targetAccount) - .keyPair(keyPair) - .value(Wei.of(0xffff)) - .gasLimit(1_000_000L) - .gasPrice(Wei.of(8)) - .build(); - - final Transaction createTransactionNumber1 = - ToyTransaction.builder() - .sender(userAccount.raiseNonceBy(1)) - .to(targetAccount) - .keyPair(keyPair) - .value(Wei.of(0xeeee)) - .gasLimit(1_000_000L) - .gasPrice(Wei.of(8)) - .payload(leftPaddedAddress1) - .build(); - - final Transaction selfDestructTransaction = - ToyTransaction.builder() - .sender(userAccount.raiseNonceBy(2)) - .to(targetAccount) - .keyPair(keyPair) - .value(Wei.of(0xdddd)) - .gasLimit(1_000_000L) - .gasPrice(Wei.of(8)) - .payload(leftPaddedAddress2) - .build(); - - final Transaction deploymentTransactionNumber2 = - ToyTransaction.builder() - .sender(userAccount.raiseNonceBy(3)) - .to(targetAccount) - .keyPair(keyPair) - .value(Wei.of(0xcccc)) - .gasLimit(1_000_000L) - .gasPrice(Wei.of(8)) - .build(); - - final Transaction createTransactionNumber2 = - ToyTransaction.builder() - .sender(userAccount.raiseNonceBy(4)) - .to(targetAccount) - .keyPair(keyPair) - .value(Wei.of(0xbbbb)) - .gasLimit(1_000_000L) - .gasPrice(Wei.of(8)) - .payload(leftPaddedAddress1) - .build(); - - final List transactions = - List.of( - deploymentTransactionNumber1, - createTransactionNumber1, - selfDestructTransaction, - deploymentTransactionNumber2, - createTransactionNumber2); - - final List accounts = - List.of(userAccount, targetAccount, simpleSelfDestructor, simpleCreator); - - @Test - void complexFailureConditionTest() { - - ToyExecutionEnvironmentV2.builder() - .accounts(accounts) - .transactions(transactions) - .zkTracerValidator(zkTracer -> {}) - .build() - .run(); - } -} diff --git a/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/failure/Create2.java b/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/failure/Create2InducedFailureTests.java similarity index 98% rename from arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/failure/Create2.java rename to arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/failure/Create2InducedFailureTests.java index 6c466af051..0f66bbb294 100644 --- a/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/failure/Create2.java +++ b/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/failure/Create2InducedFailureTests.java @@ -22,7 +22,7 @@ import org.junit.jupiter.api.Test; /** The following tests raise the Failure Condition F CREATE2. */ -public class Create2 { +public class Create2InducedFailureTests { @Test void failureConditionNonceTest() { diff --git a/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/failure/CreateInducedFailureTest.java b/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/failure/CreateInducedFailureTest.java new file mode 100644 index 0000000000..e9a28ec6bd --- /dev/null +++ b/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/failure/CreateInducedFailureTest.java @@ -0,0 +1,271 @@ +/* + * Copyright Consensys Software Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 + */ +package net.consensys.linea.zktracer.instructionprocessing.createTests.failure; + +import static net.consensys.linea.zktracer.instructionprocessing.createTests.trivial.RootLevel.salt01; +import static net.consensys.linea.zktracer.instructionprocessing.utilities.MonoOpCodeSmcs.keyPair; +import static net.consensys.linea.zktracer.instructionprocessing.utilities.MonoOpCodeSmcs.userAccount; +import static net.consensys.linea.zktracer.module.constants.GlobalConstants.WORD_SIZE; +import static net.consensys.linea.zktracer.opcode.OpCode.*; +import static net.consensys.linea.zktracer.types.Utils.leftPadTo; + +import java.util.List; + +import net.consensys.linea.testing.BytecodeCompiler; +import net.consensys.linea.testing.ToyAccount; +import net.consensys.linea.testing.ToyExecutionEnvironmentV2; +import net.consensys.linea.testing.ToyTransaction; +import org.apache.tuweni.bytes.Bytes; +import org.hyperledger.besu.datatypes.Address; +import org.hyperledger.besu.datatypes.Wei; +import org.hyperledger.besu.ethereum.core.Transaction; +import org.junit.jupiter.api.Test; + +/** + * The present test case tests the ZKEVM's reaction to triggering the Failure Condition F + * with a CREATE opcode. It's not straightforward. The sequence of events is as follows: + * + *

- we start with an account {@link #entryPoint}; + * + *

- in {@link #transactionDeployingDelegateCaller} we call {@link #entryPoint} with empty call data which + * leads to the deployment of {@link #delegateCaller}; + * + *

- in {@link #transactionLeadingDelegateCallerToCreateAnAccount} we call {@link #entryPoint} with nonempty call data which + * leads it calling {@link #delegateCaller} which leads to it doing a DELEGATECALL to {@link #simpleCreator} thus + * deploying a new account with {@link #delegateCaller}'s nonce =1; + * + *

- in {@link #transactionLeadingDelegateCallerToSelfDestruct} we call {@link #entryPoint} with nonempty call data which + * leads it calling {@link #delegateCaller} which leads to it doing a DELEGATECALL to {@link #simpleSelfDestructor} self destructing; + * + *

- in {@link #transactionDeployingDelegateCallerAgain} we call {@link #entryPoint} with empty call data again which + * leads to the deployment of {@link #delegateCaller} again; + * + *

- in {@link #transactionLeadingDelegateCallerToAttemptCreateAgainThusRaisingFailureConditionF} we call {@link #entryPoint} with nonempty call data which + * leads it calling {@link #delegateCaller} which leads to it doing a DELEGATECALL to {@link #simpleCreator} thus + * attempting to redeploy at the same address where it did the first deployment; indeed {@link #delegateCaller}'s nonce is again =1; + * deploying a new account at nonce 1; + */ +public class CreateInducedFailureTest { + + final Bytes tinyAddress1 = Bytes.fromHexString("badd1ec0de"); + final Bytes tinyAddress2 = Bytes.fromHexString("900d1ec0de"); + final Address address1 = Address.wrap(leftPadTo(tinyAddress1, 20)); + final Address address2 = Address.wrap(leftPadTo(tinyAddress2, 20)); + final Bytes leftPaddedAddress1 = leftPadTo(tinyAddress1, WORD_SIZE); + final Bytes leftPaddedAddress2 = leftPadTo(tinyAddress2, WORD_SIZE); + final Address targetAddress = Address.fromHexString("797add7e55"); + + final BytecodeCompiler simpleSelfDestruct = + BytecodeCompiler.newProgram().op(ORIGIN).op(SELFDESTRUCT); + + /** + * Account that can only do one thing: do a SELFDESTRUCT sending the funds to the + * ORIGIN.. Its raison d'être is to be called by the {@link #delegateCaller}. + */ + final ToyAccount simpleSelfDestructor = + ToyAccount.builder() + .code(simpleSelfDestruct.compile()) + .nonce(91) + .balance(Wei.of(1234L)) + .address(address1) + .build(); + + final BytecodeCompiler simpleCreate = + BytecodeCompiler.newProgram() + .push(0) // empty init code + .push(0) + .push(1) // value + .op(CREATE); + + /** + * Account that can only do one thing: do a CREATE with 1 Wei of value. Its raison + * d'être is to be called by the {@link #delegateCaller}. + */ + final ToyAccount simpleCreator = + ToyAccount.builder() + .code(simpleCreate.compile()) + .nonce(512) + .balance(Wei.of(73L)) + .address(address2) + .build(); + + /** Does a DELEGATECALL to an address extracted from the call data. */ + final BytecodeCompiler delegateCaller = + BytecodeCompiler.newProgram() + .push(0) // rac + .push(0) // rao + .push(0) // cds + .push(0) // cdo + .push(0) + .op(CALLDATALOAD) // should be an address + .op(GAS) + .op(DELEGATECALL); + + /** Initialization code that deploys {@link #delegateCaller}. */ + final BytecodeCompiler initCode = + BytecodeCompiler.newProgram() + .push(delegateCaller.compile()) + .push(8 * (32 - delegateCaller.compile().size())) + .op(SHL) + .push(0) + .op(MSTORE) + .push(delegateCaller.compile().size()) // code size + .push(0) + .op(RETURN); + + int keyToDeploymentAddress = 0xad; + int emptyCallDataExecutionPathProgramCounter = 27; + + /** + * This bytecode behaves in two different possible ways: + * + *

- if called with empty call data it performs a predetermined CREATE2 using {@link + * #initCode} as initialization code, which deploys {@link #delegateCaller}, and then stores the + * deployment address at key {@link #keyToDeploymentAddress}; + * + *

- if called with nonempty call data it writes the call data into memory, SLOAD's an + * item from storage (the aforementioned CREATE2 deployment address stored at {@link + * #keyToDeploymentAddress}), and performs a CALL to said address providing it with the + * same call data it was given itself; this assumes that call data fit into a single EVM word; + * + *

Thus the {@link #entryPoint} serves as the entry point for the {@link #delegateCaller} account + * + *

N.B. For the SLOAD to work as expected it is necessary that the CREATE2 + * step have been taken first. Otherwise, it will SLOAD the value 0x00 ... 00 which is of + * no use. + */ + final BytecodeCompiler entryPointByteCode = + BytecodeCompiler.newProgram() + .op(CALLDATASIZE) // + 1 + .op(ISZERO) // [CALLDATASIZE == 0] // + 1 + .push(emptyCallDataExecutionPathProgramCounter) // + 2 + .op(JUMPI) // + 1 + //////////////////////////////////////////// + // The nonempty call data execution route // + //////////////////////////////////////////// + .push(0) // + 2 + .op(CALLDATALOAD) // extracts (address) from call data // + 1 + .push(0) // + 2 + .op(MSTORE) // + 1 + .push(0) // rac // + 2 + .push(0) // rao // + 2 + .push(0x20) // cds // + 2 + .push(0) // cdo // + 2 + .push(keyToDeploymentAddress) // + 2 + .op(SLOAD) // extract stored address // + 1 + .push(0xef) // value // + 2 + .op(GAS) // gas // + 1 + .op(CALL) // + 1 + .op(STOP) // + 1 + ///////////////////////////////////////// + // The empty call data execution route // + ///////////////////////////////////////// + .op(JUMPDEST) // PC = 27 + .push(initCode.compile()) + .push(8 * (32 - initCode.compile().size())) + .op(SHL) + .push(0) + .op(MSTORE) + .push(salt01) + .push(initCode.compile().size()) // init code size + .push(0) // offset + .push(0xff) // value + .op(CREATE2) + .push(keyToDeploymentAddress) + .op(SSTORE); + + final ToyAccount entryPoint = + ToyAccount.builder() + .code(entryPointByteCode.compile()) + .nonce(1337) + .balance(Wei.of(73L)) + .address(targetAddress) + .build(); + + final Transaction transactionDeployingDelegateCaller = + ToyTransaction.builder() + .sender(userAccount) + .to(entryPoint) + .keyPair(keyPair) + .value(Wei.of(0xffff)) + .gasLimit(1_000_000L) + .gasPrice(Wei.of(8)) + .build(); + + final Transaction transactionLeadingDelegateCallerToCreateAnAccount = + ToyTransaction.builder() + .sender(userAccount.raiseNonceBy(1)) + .to(entryPoint) + .keyPair(keyPair) + .value(Wei.of(0xeeee)) + .gasLimit(1_000_000L) + .gasPrice(Wei.of(8)) + .payload(leftPaddedAddress1) + .build(); + + final Transaction transactionLeadingDelegateCallerToSelfDestruct = + ToyTransaction.builder() + .sender(userAccount.raiseNonceBy(2)) + .to(entryPoint) + .keyPair(keyPair) + .value(Wei.of(0xdddd)) + .gasLimit(1_000_000L) + .gasPrice(Wei.of(8)) + .payload(leftPaddedAddress2) + .build(); + + final Transaction transactionDeployingDelegateCallerAgain = + ToyTransaction.builder() + .sender(userAccount.raiseNonceBy(3)) + .to(entryPoint) + .keyPair(keyPair) + .value(Wei.of(0xcccc)) + .gasLimit(1_000_000L) + .gasPrice(Wei.of(8)) + .build(); + + final Transaction transactionLeadingDelegateCallerToAttemptCreateAgainThusRaisingFailureConditionF = + ToyTransaction.builder() + .sender(userAccount.raiseNonceBy(4)) + .to(entryPoint) + .keyPair(keyPair) + .value(Wei.of(0xbbbb)) + .gasLimit(1_000_000L) + .gasPrice(Wei.of(8)) + .payload(leftPaddedAddress1) + .build(); + + final List transactions = + List.of( + transactionDeployingDelegateCaller, + transactionLeadingDelegateCallerToCreateAnAccount, + transactionLeadingDelegateCallerToSelfDestruct, + transactionDeployingDelegateCallerAgain, + transactionLeadingDelegateCallerToAttemptCreateAgainThusRaisingFailureConditionF); + + final List accounts = + List.of(userAccount, entryPoint, simpleSelfDestructor, simpleCreator); + + @Test + void complexFailureConditionTest() { + + ToyExecutionEnvironmentV2.builder() + .accounts(accounts) + .transactions(transactions) + .zkTracerValidator(zkTracer -> {}) + .build() + .run(); + } +} From f201cc327a690229198841a5a4430ea465c4de58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Olivier=20B=C3=A9gassat?= Date: Thu, 5 Dec 2024 11:26:08 +0700 Subject: [PATCH 27/44] spotless --- .../module/rlpaddr/RlpAddrOperation.java | 1 - .../failure/CreateInducedFailureTest.java | 67 ++++++++++--------- 2 files changed, 36 insertions(+), 32 deletions(-) diff --git a/arithmetization/src/main/java/net/consensys/linea/zktracer/module/rlpaddr/RlpAddrOperation.java b/arithmetization/src/main/java/net/consensys/linea/zktracer/module/rlpaddr/RlpAddrOperation.java index 3c36933e53..0eda324031 100644 --- a/arithmetization/src/main/java/net/consensys/linea/zktracer/module/rlpaddr/RlpAddrOperation.java +++ b/arithmetization/src/main/java/net/consensys/linea/zktracer/module/rlpaddr/RlpAddrOperation.java @@ -19,7 +19,6 @@ import static net.consensys.linea.zktracer.module.rlpaddr.Trace.MAX_CT_CREATE2; import java.math.BigInteger; -import java.util.Optional; import lombok.EqualsAndHashCode; import lombok.Getter; diff --git a/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/failure/CreateInducedFailureTest.java b/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/failure/CreateInducedFailureTest.java index e9a28ec6bd..df89da752b 100644 --- a/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/failure/CreateInducedFailureTest.java +++ b/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/failure/CreateInducedFailureTest.java @@ -39,23 +39,26 @@ * *

- we start with an account {@link #entryPoint}; * - *

- in {@link #transactionDeployingDelegateCaller} we call {@link #entryPoint} with empty call data which - * leads to the deployment of {@link #delegateCaller}; + *

- in {@link #transactionDeployingDelegateCaller} we call {@link #entryPoint} with empty call + * data which leads to the deployment of {@link #delegateCaller}; * - *

- in {@link #transactionLeadingDelegateCallerToCreateAnAccount} we call {@link #entryPoint} with nonempty call data which - * leads it calling {@link #delegateCaller} which leads to it doing a DELEGATECALL to {@link #simpleCreator} thus - * deploying a new account with {@link #delegateCaller}'s nonce =1; + *

- in {@link #transactionLeadingDelegateCallerToCreateAnAccount} we call {@link #entryPoint} + * with nonempty call data which leads it calling {@link #delegateCaller} which leads to it doing a + * DELEGATECALL to {@link #simpleCreator} thus deploying a new account with {@link + * #delegateCaller}'s nonce =1; * - *

- in {@link #transactionLeadingDelegateCallerToSelfDestruct} we call {@link #entryPoint} with nonempty call data which - * leads it calling {@link #delegateCaller} which leads to it doing a DELEGATECALL to {@link #simpleSelfDestructor} self destructing; + *

- in {@link #transactionLeadingDelegateCallerToSelfDestruct} we call {@link #entryPoint} with + * nonempty call data which leads it calling {@link #delegateCaller} which leads to it doing a + * DELEGATECALL to {@link #simpleSelfDestructor} self destructing; * - *

- in {@link #transactionDeployingDelegateCallerAgain} we call {@link #entryPoint} with empty call data again which - * leads to the deployment of {@link #delegateCaller} again; + *

- in {@link #transactionDeployingDelegateCallerAgain} we call {@link #entryPoint} with empty + * call data again which leads to the deployment of {@link #delegateCaller} again; * - *

- in {@link #transactionLeadingDelegateCallerToAttemptCreateAgainThusRaisingFailureConditionF} we call {@link #entryPoint} with nonempty call data which - * leads it calling {@link #delegateCaller} which leads to it doing a DELEGATECALL to {@link #simpleCreator} thus - * attempting to redeploy at the same address where it did the first deployment; indeed {@link #delegateCaller}'s nonce is again =1; - * deploying a new account at nonce 1; + *

- in {@link #transactionLeadingDelegateCallerToAttemptCreateAgainThusRaisingFailureConditionF} + * we call {@link #entryPoint} with nonempty call data which leads it calling {@link + * #delegateCaller} which leads to it doing a DELEGATECALL to {@link #simpleCreator} thus + * attempting to redeploy at the same address where it did the first deployment; indeed + * {@link #delegateCaller}'s nonce is again =1; deploying a new account at nonce 1; */ public class CreateInducedFailureTest { @@ -140,11 +143,12 @@ public class CreateInducedFailureTest { * #keyToDeploymentAddress}), and performs a CALL to said address providing it with the * same call data it was given itself; this assumes that call data fit into a single EVM word; * - *

Thus the {@link #entryPoint} serves as the entry point for the {@link #delegateCaller} account + *

Thus the {@link #entryPoint} serves as the entry point for the {@link #delegateCaller} + * account * *

N.B. For the SLOAD to work as expected it is necessary that the CREATE2 - * step have been taken first. Otherwise, it will SLOAD the value 0x00 ... 00 which is of - * no use. + * step have been taken first. Otherwise, it will SLOAD the value 0x00 ... 00 which + * is of no use. */ final BytecodeCompiler entryPointByteCode = BytecodeCompiler.newProgram() @@ -236,24 +240,25 @@ public class CreateInducedFailureTest { .gasPrice(Wei.of(8)) .build(); - final Transaction transactionLeadingDelegateCallerToAttemptCreateAgainThusRaisingFailureConditionF = - ToyTransaction.builder() - .sender(userAccount.raiseNonceBy(4)) - .to(entryPoint) - .keyPair(keyPair) - .value(Wei.of(0xbbbb)) - .gasLimit(1_000_000L) - .gasPrice(Wei.of(8)) - .payload(leftPaddedAddress1) - .build(); + final Transaction + transactionLeadingDelegateCallerToAttemptCreateAgainThusRaisingFailureConditionF = + ToyTransaction.builder() + .sender(userAccount.raiseNonceBy(4)) + .to(entryPoint) + .keyPair(keyPair) + .value(Wei.of(0xbbbb)) + .gasLimit(1_000_000L) + .gasPrice(Wei.of(8)) + .payload(leftPaddedAddress1) + .build(); final List transactions = List.of( - transactionDeployingDelegateCaller, - transactionLeadingDelegateCallerToCreateAnAccount, - transactionLeadingDelegateCallerToSelfDestruct, - transactionDeployingDelegateCallerAgain, - transactionLeadingDelegateCallerToAttemptCreateAgainThusRaisingFailureConditionF); + transactionDeployingDelegateCaller, + transactionLeadingDelegateCallerToCreateAnAccount, + transactionLeadingDelegateCallerToSelfDestruct, + transactionDeployingDelegateCallerAgain, + transactionLeadingDelegateCallerToAttemptCreateAgainThusRaisingFailureConditionF); final List accounts = List.of(userAccount, entryPoint, simpleSelfDestructor, simpleCreator); From e128e9947c0a5a5772ce686a816e67bc68be9814 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Olivier=20B=C3=A9gassat?= Date: Thu, 5 Dec 2024 13:53:50 +0700 Subject: [PATCH 28/44] feat: Failure Condition F via nested CREATE2's --- .../callTests/Utilities.java | 16 +++ .../callTests/prc/identity/Tests.java | 2 +- .../failure/Create2InducedFailureTests.java | 5 +- .../failure/NestedFailureTest.java | 126 ++++++++++++++++++ 4 files changed, 147 insertions(+), 2 deletions(-) create mode 100644 arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/failure/NestedFailureTest.java diff --git a/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/callTests/Utilities.java b/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/callTests/Utilities.java index 12cb49a107..4dd9cd93bf 100644 --- a/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/callTests/Utilities.java +++ b/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/callTests/Utilities.java @@ -62,6 +62,22 @@ public static void simpleCall( program.push(to).push(gas).op(callOpcode); } + public static void callCaller( + BytecodeCompiler program, + OpCode callOpcode, + int gas, + int value, + int cdo, + int cds, + int rao, + int rac) { + program.push(rac).push(rao).push(cds).push(cdo); + if (callOpcode.callHasValueArgument()) { + program.push(value); + } + program.op(CALLER).push(gas).op(callOpcode); + } + public static void appendInsufficientBalanceCall( BytecodeCompiler program, OpCode callOpcode, diff --git a/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/callTests/prc/identity/Tests.java b/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/callTests/prc/identity/Tests.java index 264b254ce6..3ade253a25 100644 --- a/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/callTests/prc/identity/Tests.java +++ b/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/callTests/prc/identity/Tests.java @@ -98,7 +98,7 @@ void nontrivialCallDataIdentityTest(OpCode callOpCode) { * @param program * @param account */ - public void fullCodeCopyOf(BytecodeCompiler program, ToyAccount account) { + public static void fullCodeCopyOf(BytecodeCompiler program, ToyAccount account) { final Address address = account.getAddress(); program .push(address) diff --git a/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/failure/Create2InducedFailureTests.java b/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/failure/Create2InducedFailureTests.java index 0f66bbb294..38409483d6 100644 --- a/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/failure/Create2InducedFailureTests.java +++ b/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/failure/Create2InducedFailureTests.java @@ -21,7 +21,10 @@ import org.apache.tuweni.bytes.Bytes; import org.junit.jupiter.api.Test; -/** The following tests raise the Failure Condition F CREATE2. */ +/** + * The following tests raise the Failure Condition F with the CREATE2 opcode. These + * tests are sequential in nature: one CREATE2 after another. + */ public class Create2InducedFailureTests { @Test diff --git a/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/failure/NestedFailureTest.java b/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/failure/NestedFailureTest.java new file mode 100644 index 0000000000..5b7d3eaab6 --- /dev/null +++ b/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/failure/NestedFailureTest.java @@ -0,0 +1,126 @@ +/* + * Copyright Consensys Software Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 + */ +package net.consensys.linea.zktracer.instructionprocessing.createTests.failure; + +import net.consensys.linea.testing.BytecodeCompiler; +import net.consensys.linea.testing.ToyAccount; +import net.consensys.linea.testing.ToyExecutionEnvironmentV2; +import net.consensys.linea.testing.ToyTransaction; +import net.consensys.linea.zktracer.opcode.OpCode; +import org.hyperledger.besu.datatypes.Address; +import org.hyperledger.besu.datatypes.Wei; +import org.hyperledger.besu.ethereum.core.Transaction; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.Arguments; +import org.junit.jupiter.params.provider.EnumSource; +import org.junit.jupiter.params.provider.MethodSource; + +import java.util.ArrayList; +import java.util.List; +import java.util.stream.Stream; + +import static net.consensys.linea.zktracer.instructionprocessing.callTests.Utilities.callCaller; +import static net.consensys.linea.zktracer.instructionprocessing.callTests.prc.identity.Tests.fullCodeCopyOf; +import static net.consensys.linea.zktracer.instructionprocessing.createTests.trivial.RootLevel.salt02; +import static net.consensys.linea.zktracer.instructionprocessing.utilities.MonoOpCodeSmcs.keyPair; +import static net.consensys.linea.zktracer.instructionprocessing.utilities.MonoOpCodeSmcs.userAccount; +import static net.consensys.linea.zktracer.module.constants.GlobalConstants.WORD_SIZE; +import static net.consensys.linea.zktracer.opcode.OpCode.*; + +/** + * The purpose of this class is to tests Failure Condition F's arising from nested + * CREATE2's. + */ +public class NestedFailureTest { + + @ParameterizedTest + @EnumSource( + value = OpCode.class, + names = {"CALL", "CALLCODE", "DELEGATECALL", "STATICCALL"}) + public void nestedFailureTest(OpCode callOpCode) { + + final String deployedCode = "deadbeefc0de"; + final int deployedCodeLengthInBytes = deployedCode.length() / 2; + final String errorString = "0e7707"; + final int errorStringLengthInBytes = errorString.length() / 2; + + BytecodeCompiler initCode = BytecodeCompiler.newProgram(); + callCaller(initCode, callOpCode, 0xffffff, 1, 0xa, 0xb, 0xc, 0xd); + final int sizeUpToCall = initCode.compile().size(); + initCode + .op(ISZERO) + .push(sizeUpToCall + (1 + 2 + 1) + ((1 + deployedCodeLengthInBytes) + 2 + 1 + 2 + 2 + 1)) + .op(JUMPI) + ////////////////////////// + // successful CALL path // + ////////////////////////// + .push(deployedCode) + .push(0) + .op(MSTORE) + .push(deployedCodeLengthInBytes) + .push(WORD_SIZE - deployedCodeLengthInBytes) + .op(RETURN) + //////////////////////////// + // unsuccessful CALL path // + //////////////////////////// + .op(JUMPDEST) + .push(errorString) + .push(0) + .op(MSTORE) + .push(errorStringLengthInBytes) // size + .push(WORD_SIZE - errorStringLengthInBytes) // offset + .op(REVERT) + ; + + ToyAccount accountContainingInitCode = ToyAccount.builder() + .address(Address.fromHexString("c0ffeec0deadd7")) + .code(initCode.compile()) + .nonce(0xffff) + .balance(Wei.of(0xffffff)) + .build(); + + BytecodeCompiler entryPoint = BytecodeCompiler.newProgram(); + fullCodeCopyOf(entryPoint, accountContainingInitCode); + entryPoint + .push(salt02) // salt + .op(MSIZE) // size + .push(0) // offset + .op(SELFBALANCE) // value + .op(CREATE2); + + ToyAccount entryPointAccount = ToyAccount.builder() + .address(Address.fromHexString("add7e55")) + .balance(Wei.of(0xeeeeee)) + .nonce(0x777777) + .code(entryPoint.compile()) + .build(); + + + Transaction transaction = + ToyTransaction.builder() + .sender(userAccount) + .keyPair(keyPair) + .to(entryPointAccount) + .value(Wei.of(7_000_000_000L)) + .gasLimit(0xffffffL) + .build(); + + ToyExecutionEnvironmentV2.builder() + .accounts(List.of(userAccount, entryPointAccount, accountContainingInitCode)) + .transaction(transaction) + .build() + .run(); + } +} From 39b017a44ec7af83a41d8b8300682f45c38b94e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Olivier=20B=C3=A9gassat?= Date: Thu, 5 Dec 2024 17:45:24 +0700 Subject: [PATCH 29/44] fix: the OOB related call for CREATE's only requires NONCE and HAS_CODE of the createe if the createe gets loaded into the trace --- .../linea/zktracer/module/oob/OobOperation.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/arithmetization/src/main/java/net/consensys/linea/zktracer/module/oob/OobOperation.java b/arithmetization/src/main/java/net/consensys/linea/zktracer/module/oob/OobOperation.java index 737fe1ebe4..d2416b164f 100644 --- a/arithmetization/src/main/java/net/consensys/linea/zktracer/module/oob/OobOperation.java +++ b/arithmetization/src/main/java/net/consensys/linea/zktracer/module/oob/OobOperation.java @@ -93,6 +93,7 @@ import net.consensys.linea.zktracer.module.hub.fragment.imc.oob.precompiles.ModexpPricingOobCall; import net.consensys.linea.zktracer.module.hub.fragment.imc.oob.precompiles.ModexpXbsOobCall; import net.consensys.linea.zktracer.module.hub.fragment.imc.oob.precompiles.PrecompileCommonOobCall; +import net.consensys.linea.zktracer.module.hub.section.CreateSection; import net.consensys.linea.zktracer.module.mod.Mod; import net.consensys.linea.zktracer.module.wcp.Wcp; import net.consensys.linea.zktracer.opcode.OpCode; @@ -273,8 +274,13 @@ private void populateColumnsForEvmInstruction(MessageFrame frame) { final Address deploymentAddress = getDeploymentAddress(frame); final Account deployedAccount = frame.getWorldUpdater().get(deploymentAddress); - final long nonce = (deployedAccount != null) ? deployedAccount.getNonce() : 0; - final boolean hasCode = deployedAccount != null && deployedAccount.hasCode(); + checkState(hub.currentTraceSection() instanceof CreateSection); + final boolean unexceptional = hub.isUnexceptional(); + final boolean unaborted = hub.pch().abortingConditions().snapshot().none(); + final boolean unexcepationalAndUnabortedCreateAndDeploymentAccountExists = ((deployedAccount != null) && unexceptional && unaborted); + + final long nonce = unexcepationalAndUnabortedCreateAndDeploymentAccountExists ? deployedAccount.getNonce() : 0; + final boolean hasCode = unexcepationalAndUnabortedCreateAndDeploymentAccountExists && deployedAccount.hasCode(); final CreateOobCall createOobCall = (CreateOobCall) oobCall; createOobCall.setValue(EWord.of(frame.getStackItem(0))); From 7b83f144c036fd057f5f5d015ccd7503f8563076 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Olivier=20B=C3=A9gassat?= Date: Thu, 5 Dec 2024 17:46:52 +0700 Subject: [PATCH 30/44] fix: minor test stuff --- .../callTests/Utilities.java | 16 +- .../createTests/abort/Balance.java | 21 ++- .../failure/NestedFailureTest.java | 164 +++++++++--------- 3 files changed, 108 insertions(+), 93 deletions(-) diff --git a/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/callTests/Utilities.java b/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/callTests/Utilities.java index 4dd9cd93bf..6f0b353904 100644 --- a/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/callTests/Utilities.java +++ b/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/callTests/Utilities.java @@ -63,14 +63,14 @@ public static void simpleCall( } public static void callCaller( - BytecodeCompiler program, - OpCode callOpcode, - int gas, - int value, - int cdo, - int cds, - int rao, - int rac) { + BytecodeCompiler program, + OpCode callOpcode, + int gas, + int value, + int cdo, + int cds, + int rao, + int rac) { program.push(rac).push(rao).push(cds).push(cdo); if (callOpcode.callHasValueArgument()) { program.push(value); diff --git a/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/abort/Balance.java b/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/abort/Balance.java index a0230bbe92..c5ccc80e84 100644 --- a/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/abort/Balance.java +++ b/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/abort/Balance.java @@ -125,6 +125,25 @@ void rootLevelSuccessThenAbortCreateTest( OffsetParameter offsetParameter, SizeParameter sizeParameter, boolean reverts) { + BytecodeCompiler program = + rootLevelSuccessThenAbortCreateByteCodeCompiler( + createType, offsetParameter, sizeParameter, reverts); + run(program); + } + + @Test + void specificRootLevelSuccessThenAbortCreateTest() { + BytecodeCompiler program = + rootLevelSuccessThenAbortCreateByteCodeCompiler( + CreateType.CREATE2, OffsetParameter.ZERO, SizeParameter.ZERO, false); + run(program); + } + + BytecodeCompiler rootLevelSuccessThenAbortCreateByteCodeCompiler( + CreateType createType, + OffsetParameter offsetParameter, + SizeParameter sizeParameter, + boolean reverts) { BytecodeCompiler program = BytecodeCompiler.newProgram(); genericCreate(program, createType, ValueParameter.ONE, offsetParameter, sizeParameter, salt01); genericCreate( @@ -137,7 +156,7 @@ void rootLevelSuccessThenAbortCreateTest( if (reverts) { appendRevert(program, 2, 13); } - run(program); + return program; } private static Stream offsetAndSizeParameters() { diff --git a/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/failure/NestedFailureTest.java b/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/failure/NestedFailureTest.java index 5b7d3eaab6..f84b07be8e 100644 --- a/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/failure/NestedFailureTest.java +++ b/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/failure/NestedFailureTest.java @@ -14,6 +14,16 @@ */ package net.consensys.linea.zktracer.instructionprocessing.createTests.failure; +import static net.consensys.linea.zktracer.instructionprocessing.callTests.Utilities.callCaller; +import static net.consensys.linea.zktracer.instructionprocessing.callTests.prc.identity.Tests.fullCodeCopyOf; +import static net.consensys.linea.zktracer.instructionprocessing.createTests.trivial.RootLevel.salt02; +import static net.consensys.linea.zktracer.instructionprocessing.utilities.MonoOpCodeSmcs.keyPair; +import static net.consensys.linea.zktracer.instructionprocessing.utilities.MonoOpCodeSmcs.userAccount; +import static net.consensys.linea.zktracer.module.constants.GlobalConstants.WORD_SIZE; +import static net.consensys.linea.zktracer.opcode.OpCode.*; + +import java.util.List; + import net.consensys.linea.testing.BytecodeCompiler; import net.consensys.linea.testing.ToyAccount; import net.consensys.linea.testing.ToyExecutionEnvironmentV2; @@ -23,21 +33,7 @@ import org.hyperledger.besu.datatypes.Wei; import org.hyperledger.besu.ethereum.core.Transaction; import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.EnumSource; -import org.junit.jupiter.params.provider.MethodSource; - -import java.util.ArrayList; -import java.util.List; -import java.util.stream.Stream; - -import static net.consensys.linea.zktracer.instructionprocessing.callTests.Utilities.callCaller; -import static net.consensys.linea.zktracer.instructionprocessing.callTests.prc.identity.Tests.fullCodeCopyOf; -import static net.consensys.linea.zktracer.instructionprocessing.createTests.trivial.RootLevel.salt02; -import static net.consensys.linea.zktracer.instructionprocessing.utilities.MonoOpCodeSmcs.keyPair; -import static net.consensys.linea.zktracer.instructionprocessing.utilities.MonoOpCodeSmcs.userAccount; -import static net.consensys.linea.zktracer.module.constants.GlobalConstants.WORD_SIZE; -import static net.consensys.linea.zktracer.opcode.OpCode.*; /** * The purpose of this class is to tests Failure Condition F's arising from nested @@ -45,82 +41,82 @@ */ public class NestedFailureTest { - @ParameterizedTest - @EnumSource( - value = OpCode.class, - names = {"CALL", "CALLCODE", "DELEGATECALL", "STATICCALL"}) - public void nestedFailureTest(OpCode callOpCode) { + @ParameterizedTest + @EnumSource( + value = OpCode.class, + names = {"CALL", "CALLCODE", "DELEGATECALL", "STATICCALL"}) + public void nestedFailureTest(OpCode callOpCode) { - final String deployedCode = "deadbeefc0de"; - final int deployedCodeLengthInBytes = deployedCode.length() / 2; - final String errorString = "0e7707"; - final int errorStringLengthInBytes = errorString.length() / 2; + final String deployedCode = "deadbeefc0de"; + final int deployedCodeLengthInBytes = deployedCode.length() / 2; + final String errorString = "0e7707"; + final int errorStringLengthInBytes = errorString.length() / 2; - BytecodeCompiler initCode = BytecodeCompiler.newProgram(); - callCaller(initCode, callOpCode, 0xffffff, 1, 0xa, 0xb, 0xc, 0xd); - final int sizeUpToCall = initCode.compile().size(); - initCode - .op(ISZERO) - .push(sizeUpToCall + (1 + 2 + 1) + ((1 + deployedCodeLengthInBytes) + 2 + 1 + 2 + 2 + 1)) - .op(JUMPI) - ////////////////////////// - // successful CALL path // - ////////////////////////// - .push(deployedCode) - .push(0) - .op(MSTORE) - .push(deployedCodeLengthInBytes) - .push(WORD_SIZE - deployedCodeLengthInBytes) - .op(RETURN) - //////////////////////////// - // unsuccessful CALL path // - //////////////////////////// - .op(JUMPDEST) - .push(errorString) - .push(0) - .op(MSTORE) - .push(errorStringLengthInBytes) // size - .push(WORD_SIZE - errorStringLengthInBytes) // offset - .op(REVERT) - ; + BytecodeCompiler initCode = BytecodeCompiler.newProgram(); + callCaller(initCode, callOpCode, 0xffffff, 1, 0xa, 0xb, 0xc, 0xd); + final int sizeUpToCall = initCode.compile().size(); + initCode + .op(ISZERO) + .push(sizeUpToCall + (1 + 2 + 1) + ((1 + deployedCodeLengthInBytes) + 2 + 1 + 2 + 2 + 1)) + .op(JUMPI) + ////////////////////////// + // successful CALL path // + ////////////////////////// + .push(deployedCode) + .push(0) + .op(MSTORE) + .push(deployedCodeLengthInBytes) + .push(WORD_SIZE - deployedCodeLengthInBytes) + .op(RETURN) + //////////////////////////// + // unsuccessful CALL path // + //////////////////////////// + .op(JUMPDEST) + .push(errorString) + .push(0) + .op(MSTORE) + .push(errorStringLengthInBytes) // size + .push(WORD_SIZE - errorStringLengthInBytes) // offset + .op(REVERT); - ToyAccount accountContainingInitCode = ToyAccount.builder() - .address(Address.fromHexString("c0ffeec0deadd7")) - .code(initCode.compile()) - .nonce(0xffff) - .balance(Wei.of(0xffffff)) - .build(); + ToyAccount accountContainingInitCode = + ToyAccount.builder() + .address(Address.fromHexString("c0ffeec0deadd7")) + .code(initCode.compile()) + .nonce(0xffff) + .balance(Wei.of(0xffffff)) + .build(); - BytecodeCompiler entryPoint = BytecodeCompiler.newProgram(); - fullCodeCopyOf(entryPoint, accountContainingInitCode); - entryPoint - .push(salt02) // salt - .op(MSIZE) // size - .push(0) // offset - .op(SELFBALANCE) // value - .op(CREATE2); + BytecodeCompiler entryPoint = BytecodeCompiler.newProgram(); + fullCodeCopyOf(entryPoint, accountContainingInitCode); // loading init code into memory + entryPoint + .push(salt02) // salt + .op(MSIZE) // size + .push(0) // offset + .op(SELFBALANCE) // value + .op(CREATE2); - ToyAccount entryPointAccount = ToyAccount.builder() + ToyAccount entryPointAccount = + ToyAccount.builder() .address(Address.fromHexString("add7e55")) - .balance(Wei.of(0xeeeeee)) - .nonce(0x777777) - .code(entryPoint.compile()) - .build(); - + .balance(Wei.of(0xeeeeee)) + .nonce(0x777777) + .code(entryPoint.compile()) + .build(); - Transaction transaction = - ToyTransaction.builder() - .sender(userAccount) - .keyPair(keyPair) - .to(entryPointAccount) - .value(Wei.of(7_000_000_000L)) - .gasLimit(0xffffffL) - .build(); + Transaction transaction = + ToyTransaction.builder() + .sender(userAccount) + .keyPair(keyPair) + .to(entryPointAccount) + .value(Wei.of(7_000_000_000L)) + .gasLimit(0xffffffL) + .build(); - ToyExecutionEnvironmentV2.builder() - .accounts(List.of(userAccount, entryPointAccount, accountContainingInitCode)) - .transaction(transaction) - .build() - .run(); - } + ToyExecutionEnvironmentV2.builder() + .accounts(List.of(userAccount, entryPointAccount, accountContainingInitCode)) + .transaction(transaction) + .build() + .run(); + } } From 1a5b4cf3312265382d3dae3621aa532a5d2cbf38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Olivier=20B=C3=A9gassat?= Date: Thu, 5 Dec 2024 17:47:02 +0700 Subject: [PATCH 31/44] spotless --- .../module/hub/section/CreateSection.java | 93 +++++++++---------- .../zktracer/module/oob/OobOperation.java | 13 ++- 2 files changed, 51 insertions(+), 55 deletions(-) diff --git a/arithmetization/src/main/java/net/consensys/linea/zktracer/module/hub/section/CreateSection.java b/arithmetization/src/main/java/net/consensys/linea/zktracer/module/hub/section/CreateSection.java index 0c26d1f1f4..4267540dd2 100644 --- a/arithmetization/src/main/java/net/consensys/linea/zktracer/module/hub/section/CreateSection.java +++ b/arithmetization/src/main/java/net/consensys/linea/zktracer/module/hub/section/CreateSection.java @@ -16,16 +16,7 @@ package net.consensys.linea.zktracer.module.hub.section; import static com.google.common.base.Preconditions.*; -import static net.consensys.linea.zktracer.module.hub.fragment.scenario.CreateScenarioFragment.CreateScenario.CREATE_ABORT; -import static net.consensys.linea.zktracer.module.hub.fragment.scenario.CreateScenarioFragment.CreateScenario.CREATE_EMPTY_INIT_CODE_WILL_REVERT; -import static net.consensys.linea.zktracer.module.hub.fragment.scenario.CreateScenarioFragment.CreateScenario.CREATE_EMPTY_INIT_CODE_WONT_REVERT; -import static net.consensys.linea.zktracer.module.hub.fragment.scenario.CreateScenarioFragment.CreateScenario.CREATE_EXCEPTION; -import static net.consensys.linea.zktracer.module.hub.fragment.scenario.CreateScenarioFragment.CreateScenario.CREATE_FAILURE_CONDITION_WILL_REVERT; -import static net.consensys.linea.zktracer.module.hub.fragment.scenario.CreateScenarioFragment.CreateScenario.CREATE_FAILURE_CONDITION_WONT_REVERT; -import static net.consensys.linea.zktracer.module.hub.fragment.scenario.CreateScenarioFragment.CreateScenario.CREATE_NON_EMPTY_INIT_CODE_FAILURE_WILL_REVERT; -import static net.consensys.linea.zktracer.module.hub.fragment.scenario.CreateScenarioFragment.CreateScenario.CREATE_NON_EMPTY_INIT_CODE_FAILURE_WONT_REVERT; -import static net.consensys.linea.zktracer.module.hub.fragment.scenario.CreateScenarioFragment.CreateScenario.CREATE_NON_EMPTY_INIT_CODE_SUCCESS_WILL_REVERT; -import static net.consensys.linea.zktracer.module.hub.fragment.scenario.CreateScenarioFragment.CreateScenario.CREATE_NON_EMPTY_INIT_CODE_SUCCESS_WONT_REVERT; +import static net.consensys.linea.zktracer.module.hub.fragment.scenario.CreateScenarioFragment.CreateScenario.*; import static net.consensys.linea.zktracer.opcode.OpCode.*; import static net.consensys.linea.zktracer.types.AddressUtils.getDeploymentAddress; @@ -71,6 +62,8 @@ public class CreateSection extends TraceSection private Address createeAddress; final ImcFragment imcFragment; + final AccountFragment.AccountFragmentFactory accountFragmentFactory; + // Just before create private AccountSnapshot preOpcodeCreatorSnapshot; private AccountSnapshot preOpcodeCreateeSnapshot; @@ -92,6 +85,7 @@ public class CreateSection extends TraceSection private boolean requiresRomLex; private Wei value; + private boolean success = false; // TODO: according to our preliminary conclusion in issue #866 // CREATE's that raise a failure condition _do spawn a child context_. @@ -99,6 +93,8 @@ public CreateSection(Hub hub, MessageFrame frame) { super(hub, maxNumberOfLines(hub.pch().exceptions(), hub.pch().abortingConditions())); final short exceptions = hub.pch().exceptions(); + accountFragmentFactory = hub.factories().accountFragment(); + this.addStack(hub); // row i+ 0 @@ -154,10 +150,12 @@ public CreateSection(Hub hub, MessageFrame frame) { final CallFrame callFrame = hub.currentFrame(); creatorAddress = frame.getRecipientAddress(); - preOpcodeCreatorSnapshot = AccountSnapshot.canonical(hub, creatorAddress); - createeAddress = getDeploymentAddress(frame); - preOpcodeCreateeSnapshot = AccountSnapshot.canonical(hub, createeAddress); + + preOpcodeCreatorSnapshot = + AccountSnapshot.canonical(hub, frame.getWorldUpdater(), creatorAddress); + preOpcodeCreateeSnapshot = + AccountSnapshot.canonical(hub, frame.getWorldUpdater(), createeAddress); if (aborts.any()) { scenarioFragment.setScenario(CREATE_ABORT); @@ -212,6 +210,7 @@ public CreateSection(Hub hub, MessageFrame frame) { } if (emptyInitCode) { + success = true; finalContextFragment = ContextFragment.nonExecutionProvidesEmptyReturnData(hub); scenarioFragment.setScenario(CREATE_EMPTY_INIT_CODE_WONT_REVERT); hub.transients().conflation().deploymentInfo().newDeploymentSansExecutionAt(createeAddress); @@ -250,17 +249,14 @@ public CreateSection(Hub hub, MessageFrame frame) { @Override public void resolveUponContextEntry(Hub hub, MessageFrame frame) { childEntryCreatorSnapshot = - AccountSnapshot.canonical(hub, preOpcodeCreatorSnapshot.address()) + AccountSnapshot.canonical(hub, frame.getWorldUpdater(), preOpcodeCreatorSnapshot.address()) // .raiseNonceByOne() // the nonce was already raised .decrementBalanceBy(value); childEntryCreateeSnapshot = - AccountSnapshot.canonical(hub, preOpcodeCreateeSnapshot.address()) + AccountSnapshot.canonical(hub, frame.getWorldUpdater(), preOpcodeCreateeSnapshot.address()) .raiseNonceByOne() .incrementBalanceBy(value); - final AccountFragment.AccountFragmentFactory accountFragmentFactory = - hub.factories().accountFragment(); - final AccountFragment creatorAccountFragment = accountFragmentFactory.make( preOpcodeCreatorSnapshot, @@ -282,46 +278,47 @@ public void resolveUponContextEntry(Hub hub, MessageFrame frame) { @Override public void resolveAtContextReEntry(Hub hub, CallFrame frame) { - final boolean deploymentSuccess = !frame.frame().getStackItem(0).isZero(); + success = !frame.frame().getStackItem(0).isZero(); - if (deploymentSuccess) { + if (success) { scenarioFragment.setScenario(CREATE_NON_EMPTY_INIT_CODE_SUCCESS_WONT_REVERT); - } else { - scenarioFragment.setScenario(CREATE_NON_EMPTY_INIT_CODE_FAILURE_WONT_REVERT); + return; + } - reEntryCreatorSnapshot = AccountSnapshot.canonical(hub, preOpcodeCreatorSnapshot.address()); - reEntryCreateeSnapshot = AccountSnapshot.canonical(hub, preOpcodeCreateeSnapshot.address()); + scenarioFragment.setScenario(CREATE_NON_EMPTY_INIT_CODE_FAILURE_WONT_REVERT); - final AccountFragment.AccountFragmentFactory accountFragmentFactory = - hub.factories().accountFragment(); + reEntryCreatorSnapshot = childEntryCreatorSnapshot.deepCopy().incrementBalanceBy(value); + reEntryCreateeSnapshot = + childEntryCreateeSnapshot + .deepCopy() + .decrementBalanceBy(value) + .deploymentStatus(false) + .deploymentNumber(hub.deploymentNumberOf(createeAddress)) + .nonce(0); - final int childRevertStamp = hub.getLastChildCallFrame(frame).revertStamp(); + final int childRevertStamp = hub.getLastChildCallFrame(frame).revertStamp(); - final AccountFragment undoCreator = - accountFragmentFactory.make( - childEntryCreatorSnapshot, - reEntryCreatorSnapshot, - DomSubStampsSubFragment.revertsWithChildDomSubStamps( - this.hubStamp(), childRevertStamp, 2)); + final AccountFragment undoCreator = + accountFragmentFactory.make( + childEntryCreatorSnapshot, + reEntryCreatorSnapshot, + DomSubStampsSubFragment.revertsWithChildDomSubStamps( + this.hubStamp(), childRevertStamp, 2)); - final AccountFragment undoCreatee = - accountFragmentFactory.make( - childEntryCreateeSnapshot, - reEntryCreateeSnapshot, - DomSubStampsSubFragment.revertsWithChildDomSubStamps( - this.hubStamp(), childRevertStamp, 3)); + final AccountFragment undoCreatee = + accountFragmentFactory.make( + childEntryCreateeSnapshot, + reEntryCreateeSnapshot, + DomSubStampsSubFragment.revertsWithChildDomSubStamps( + this.hubStamp(), childRevertStamp, 3)); - this.addFragments(undoCreator, undoCreatee); - } + this.addFragments(undoCreator, undoCreatee); } @Override public void resolveUponRollback(Hub hub, MessageFrame messageFrame, CallFrame callFrame) { scenarioFragment.setScenario(switchToRevert(scenarioFragment.getScenario())); - final AccountFragment.AccountFragmentFactory accountFragmentFactory = - hub.factories().accountFragment(); - final int revertStamp = callFrame.revertStamp(); final boolean firstUndo = scenarioFragment.getScenario() != CREATE_NON_EMPTY_INIT_CODE_FAILURE_WILL_REVERT; @@ -360,8 +357,6 @@ private static short maxNumberOfLines(final short exceptions, final AbortingCond } private void finishAbort(final Hub hub) { - final AccountFragment.AccountFragmentFactory accountFragmentFactory = - hub.factories().accountFragment(); final AccountFragment creatorAccountFragment = accountFragmentFactory.make( preOpcodeCreatorSnapshot, @@ -385,16 +380,12 @@ private static CreateScenarioFragment.CreateScenario switchToRevert( }; } - public boolean isAbortedCreate() { - return scenarioFragment.isAbortedCreate(); - } - // we unlatched the stack after a CREATE if and only if we don't "contextEnter" the CREATE. // "failure condition CREATE's" do enter the CREATE context. @Override public void resolvePostExecution( Hub hub, MessageFrame frame, Operation.OperationResult operationResult) { - checkState(isAbortedCreate()); + checkState(scenarioFragment.isAbortedCreate()); hub.unlatchStack(frame, this); } } diff --git a/arithmetization/src/main/java/net/consensys/linea/zktracer/module/oob/OobOperation.java b/arithmetization/src/main/java/net/consensys/linea/zktracer/module/oob/OobOperation.java index d2416b164f..75f0a39963 100644 --- a/arithmetization/src/main/java/net/consensys/linea/zktracer/module/oob/OobOperation.java +++ b/arithmetization/src/main/java/net/consensys/linea/zktracer/module/oob/OobOperation.java @@ -277,10 +277,15 @@ private void populateColumnsForEvmInstruction(MessageFrame frame) { checkState(hub.currentTraceSection() instanceof CreateSection); final boolean unexceptional = hub.isUnexceptional(); final boolean unaborted = hub.pch().abortingConditions().snapshot().none(); - final boolean unexcepationalAndUnabortedCreateAndDeploymentAccountExists = ((deployedAccount != null) && unexceptional && unaborted); - - final long nonce = unexcepationalAndUnabortedCreateAndDeploymentAccountExists ? deployedAccount.getNonce() : 0; - final boolean hasCode = unexcepationalAndUnabortedCreateAndDeploymentAccountExists && deployedAccount.hasCode(); + final boolean unexcepationalAndUnabortedCreateAndDeploymentAccountExists = + ((deployedAccount != null) && unexceptional && unaborted); + + final long nonce = + unexcepationalAndUnabortedCreateAndDeploymentAccountExists + ? deployedAccount.getNonce() + : 0; + final boolean hasCode = + unexcepationalAndUnabortedCreateAndDeploymentAccountExists && deployedAccount.hasCode(); final CreateOobCall createOobCall = (CreateOobCall) oobCall; createOobCall.setValue(EWord.of(frame.getStackItem(0))); From 10d01661e06e263291d5422e2e133430dc7eccb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Olivier=20B=C3=A9gassat?= Date: Thu, 5 Dec 2024 21:40:57 +0700 Subject: [PATCH 32/44] feat: a little less messy, but still very messy --- .../module/hub/section/CreateSection.java | 177 ++++++++++++------ 1 file changed, 116 insertions(+), 61 deletions(-) diff --git a/arithmetization/src/main/java/net/consensys/linea/zktracer/module/hub/section/CreateSection.java b/arithmetization/src/main/java/net/consensys/linea/zktracer/module/hub/section/CreateSection.java index 4267540dd2..e89affb163 100644 --- a/arithmetization/src/main/java/net/consensys/linea/zktracer/module/hub/section/CreateSection.java +++ b/arithmetization/src/main/java/net/consensys/linea/zktracer/module/hub/section/CreateSection.java @@ -58,11 +58,10 @@ public class CreateSection extends TraceSection ContextReEntryDefer, PostTransactionDefer { - private Address creatorAddress; - private Address createeAddress; - final ImcFragment imcFragment; + private final Address creatorAddress; + private final Address createeAddress; - final AccountFragment.AccountFragmentFactory accountFragmentFactory; + private final AccountFragment.AccountFragmentFactory accountFragmentFactory; // Just before create private AccountSnapshot preOpcodeCreatorSnapshot; @@ -78,8 +77,9 @@ public class CreateSection extends TraceSection private RlpAddrSubFragment rlpAddrSubFragment; - // row i+0 - final CreateScenarioFragment scenarioFragment; + final CreateScenarioFragment scenarioFragment; // row i + 0 + final ContextFragment currentContextFragment; // row i + 1 + final ImcFragment imcFragment; // row i + 2 // row i+? private ContextFragment finalContextFragment; @@ -91,28 +91,28 @@ public class CreateSection extends TraceSection // CREATE's that raise a failure condition _do spawn a child context_. public CreateSection(Hub hub, MessageFrame frame) { super(hub, maxNumberOfLines(hub.pch().exceptions(), hub.pch().abortingConditions())); - final short exceptions = hub.pch().exceptions(); - accountFragmentFactory = hub.factories().accountFragment(); - this.addStack(hub); + creatorAddress = frame.getRecipientAddress(); + createeAddress = getDeploymentAddress(frame); + value = Wei.of(UInt256.fromBytes(frame.getStackItem(0))); - // row i+ 0 scenarioFragment = new CreateScenarioFragment(); - this.addFragment(scenarioFragment); + currentContextFragment = ContextFragment.readCurrentContextData(hub); + imcFragment = ImcFragment.empty(hub); - // row i + 1 - final ContextFragment currentContextFragment = ContextFragment.readCurrentContextData(hub); + this.addStack(hub); + this.addFragment(scenarioFragment); this.addFragment(currentContextFragment); - - // row: i + 2 - imcFragment = ImcFragment.empty(hub); this.addFragment(imcFragment); + refineCreateScenario(hub, frame); + scheduleSection(hub, frame); + + final short exceptions = hub.pch().exceptions(); + // STATICX case - // Note: in the static case this imc fragment remains empty if (Exceptions.staticFault(exceptions)) { - scenarioFragment.setScenario(CREATE_EXCEPTION); return; } @@ -122,7 +122,6 @@ public CreateSection(Hub hub, MessageFrame frame) { // MXPX case if (mxpCall.mxpx) { - scenarioFragment.setScenario(CREATE_EXCEPTION); return; } @@ -133,7 +132,6 @@ public CreateSection(Hub hub, MessageFrame frame) { // OOGX case if (Exceptions.outOfGasException(exceptions)) { - scenarioFragment.setScenario(CREATE_EXCEPTION); return; } @@ -147,44 +145,40 @@ public CreateSection(Hub hub, MessageFrame frame) { final AbortingConditions aborts = hub.pch().abortingConditions().snapshot(); checkArgument(oobCall.isAbortingCondition() == aborts.any()); - final CallFrame callFrame = hub.currentFrame(); - - creatorAddress = frame.getRecipientAddress(); - createeAddress = getDeploymentAddress(frame); - preOpcodeCreatorSnapshot = AccountSnapshot.canonical(hub, frame.getWorldUpdater(), creatorAddress); preOpcodeCreateeSnapshot = AccountSnapshot.canonical(hub, frame.getWorldUpdater(), createeAddress); - if (aborts.any()) { - scenarioFragment.setScenario(CREATE_ABORT); - this.finishAbort(hub); - hub.defers().scheduleForPostExecution(this); - return; + + switch (scenarioFragment.getScenario()) { + case CREATE_ABORT -> { + this.traceAndScheduleForAbort(hub); + return; + } + case CREATE_FAILURE_CONDITION_WONT_REVERT -> { + this.traceAndScheduleForFailureCondition(hub); + return; + } + case CREATE_EMPTY_INIT_CODE_WONT_REVERT -> this.traceAndScheduleForEmptyInitCode(hub); + case CREATE_NON_EMPTY_INIT_CODE_SUCCESS_WONT_REVERT -> this + .traceAndScheduleForNonemptyInitCode(hub); + case CREATE_EXCEPTION -> {} + default -> throw new IllegalStateException( + CREATE_EXCEPTION.name() + " shouldn't enter this section"); } // The CREATE(2) is now unexceptional and unaborted checkArgument(aborts.none()); - hub.defers().scheduleForContextEntry(this); // when we add the two account fragments - hub.defers().scheduleForPostRollback(this, hub.currentFrame()); // in case of Rollback - hub.defers().scheduleForPostTransaction(this); // when we add the last context row rlpAddrSubFragment = RlpAddrSubFragment.makeFragment(hub, createeAddress); - final Optional deploymentAccount = - Optional.ofNullable(frame.getWorldUpdater().get(createeAddress)); - final boolean createdAddressHasNonZeroNonce = - deploymentAccount.map(a -> a.getNonce() != 0).orElse(false); - final boolean createdAddressHasNonEmptyCode = - deploymentAccount.map(AccountState::hasCode).orElse(false); - - final boolean failedCreate = createdAddressHasNonZeroNonce || createdAddressHasNonEmptyCode; - final boolean emptyInitCode = hub.transients().op().initCodeSegment().isEmpty(); - final long offset = Words.clampedToLong(frame.getStackItem(1)); final long size = Words.clampedToLong(frame.getStackItem(2)); + final boolean failedCreate = raisesFailureCondition(frame); + final boolean emptyInitCode = hasEmptyInitCode(hub); + // Trigger MMU & SHAKIRA to hash the (non-empty) InitCode of CREATE2 - even for failed CREATE2 if (hub.opCode() == CREATE2 && !emptyInitCode) { final Bytes create2InitCode = frame.shadowReadMemory(offset, size); @@ -199,11 +193,8 @@ public CreateSection(Hub hub, MessageFrame frame) { writeHashInfoResult(shakiraDataOperation.result()); } - value = failedCreate ? Wei.ZERO : Wei.of(UInt256.fromBytes(frame.getStackItem(0))); - if (failedCreate) { - finalContextFragment = ContextFragment.nonExecutionProvidesEmptyReturnData(hub); - scenarioFragment.setScenario(CREATE_FAILURE_CONDITION_WONT_REVERT); + finalContextFragmentSquashesReturnData(hub); commonValues.payGasPaidOutOfPocket(hub); hub.failureConditionForCreates = true; return; @@ -211,8 +202,7 @@ public CreateSection(Hub hub, MessageFrame frame) { if (emptyInitCode) { success = true; - finalContextFragment = ContextFragment.nonExecutionProvidesEmptyReturnData(hub); - scenarioFragment.setScenario(CREATE_EMPTY_INIT_CODE_WONT_REVERT); + finalContextFragmentSquashesReturnData(hub); hub.transients().conflation().deploymentInfo().newDeploymentSansExecutionAt(createeAddress); return; } @@ -223,12 +213,6 @@ public CreateSection(Hub hub, MessageFrame frame) { // we charge for the gas paid out of pocket commonValues.payGasPaidOutOfPocket(hub); - // we capture revert information about the child context: CCSR and CCRS - hub.defers().scheduleForContextReEntry(imcFragment, hub.currentFrame()); - - // The current execution context pays (63/64)ths of it current gas to the child context - // To get the success bit of the CREATE(2) operation - hub.defers().scheduleForContextReEntry(this, callFrame); requiresRomLex = true; hub.romLex().callRomLex(frame); @@ -285,8 +269,6 @@ public void resolveAtContextReEntry(Hub hub, CallFrame frame) { return; } - scenarioFragment.setScenario(CREATE_NON_EMPTY_INIT_CODE_FAILURE_WONT_REVERT); - reEntryCreatorSnapshot = childEntryCreatorSnapshot.deepCopy().incrementBalanceBy(value); reEntryCreateeSnapshot = childEntryCreateeSnapshot @@ -356,19 +338,28 @@ private static short maxNumberOfLines(final short exceptions, final AbortingCond return 11; // Note: could be lower for unreverted successful CREATE(s) } - private void finishAbort(final Hub hub) { + private void traceAndScheduleForAbort(final Hub hub) { final AccountFragment creatorAccountFragment = accountFragmentFactory.make( preOpcodeCreatorSnapshot, preOpcodeCreatorSnapshot, DomSubStampsSubFragment.standardDomSubStamps(this.hubStamp(), 0)); - final ContextFragment updatedCurrentContextFragment = - ContextFragment.nonExecutionProvidesEmptyReturnData(hub); + finalContextFragmentSquashesReturnData(hub); + + this.addFragments(creatorAccountFragment, finalContextFragment); + } - this.addFragments(creatorAccountFragment, updatedCurrentContextFragment); + private void finalContextFragmentSquashesReturnData(Hub hub) { + finalContextFragment = ContextFragment.nonExecutionProvidesEmptyReturnData(hub); } + private void traceAndScheduleForFailureCondition(Hub hub) {} + + private void traceAndScheduleForEmptyInitCode(Hub hub) {} + + private void traceAndScheduleForNonemptyInitCode(Hub hub) {} + private static CreateScenarioFragment.CreateScenario switchToRevert( final CreateScenarioFragment.CreateScenario previousScenario) { return switch (previousScenario) { @@ -380,6 +371,70 @@ private static CreateScenarioFragment.CreateScenario switchToRevert( }; } + private boolean hasEmptyInitCode(Hub hub) { + return hub.transients().op().initCodeSegment().isEmpty(); + } + + private void refineCreateScenario(Hub hub, MessageFrame frame) { + if (hub.isExceptional()) { + scenarioFragment.setScenario(CREATE_EXCEPTION); + return; + } + + if (hub.pch().abortingConditions().any()) { + scenarioFragment.setScenario(CREATE_ABORT); + return; + } + + if (raisesFailureCondition(frame)) { + scenarioFragment.setScenario(CREATE_FAILURE_CONDITION_WONT_REVERT); + return; + } + + scenarioFragment.setScenario( + hasEmptyInitCode(hub) + ? CREATE_EMPTY_INIT_CODE_WONT_REVERT + : CREATE_NON_EMPTY_INIT_CODE_SUCCESS_WONT_REVERT); + } + + private void scheduleSection(Hub hub, MessageFrame frame) { + CreateScenarioFragment.CreateScenario scenario = scenarioFragment.getScenario(); + final CallFrame currentFrame = hub.currentFrame(); + switch (scenario) { + case CREATE_EXCEPTION -> {} + case CREATE_ABORT -> hub.defers().scheduleForPostExecution(this); // unlatch the stack + case CREATE_FAILURE_CONDITION_WONT_REVERT, CREATE_EMPTY_INIT_CODE_WONT_REVERT -> { + hub.defers().scheduleForContextEntry(this); + hub.defers().scheduleForPostRollback(this, currentFrame); + hub.defers().scheduleForPostTransaction(this); + } + case CREATE_NON_EMPTY_INIT_CODE_SUCCESS_WONT_REVERT -> { + // The current execution context pays (63/64)ths of it current gas to the child context + // To get the success bit of the CREATE(2) operation + hub.defers().scheduleForContextEntry(this); + hub.defers().scheduleForContextReEntry(this, currentFrame); + hub.defers().scheduleForPostRollback(this, currentFrame); + hub.defers().scheduleForPostTransaction(this); + + // we capture revert information about the child context: CCSR and CCRS + hub.defers().scheduleForContextReEntry(imcFragment, hub.currentFrame()); + } + default -> throw new IllegalStateException(scenario.name() + " not allowed when defining the schedule"); + } + } + + private boolean raisesFailureCondition(MessageFrame frame) { + + final Optional deploymentAccount = + Optional.ofNullable(frame.getWorldUpdater().get(createeAddress)); + final boolean createdAddressHasNonZeroNonce = + deploymentAccount.map(a -> a.getNonce() != 0).orElse(false); + final boolean createdAddressHasNonEmptyCode = + deploymentAccount.map(AccountState::hasCode).orElse(false); + + return createdAddressHasNonZeroNonce || createdAddressHasNonEmptyCode; + } + // we unlatched the stack after a CREATE if and only if we don't "contextEnter" the CREATE. // "failure condition CREATE's" do enter the CREATE context. @Override From 8bafafc03023f55cb6003a3d148cd10e57e8d47f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Olivier=20B=C3=A9gassat?= Date: Thu, 5 Dec 2024 23:51:57 +0700 Subject: [PATCH 33/44] feat: moving stuff around ... --- .../scenario/CreateScenarioFragment.java | 15 +- .../module/hub/section/CreateSection.java | 130 ++++++++++++------ 2 files changed, 104 insertions(+), 41 deletions(-) diff --git a/arithmetization/src/main/java/net/consensys/linea/zktracer/module/hub/fragment/scenario/CreateScenarioFragment.java b/arithmetization/src/main/java/net/consensys/linea/zktracer/module/hub/fragment/scenario/CreateScenarioFragment.java index 3a249c755a..86fcbac675 100644 --- a/arithmetization/src/main/java/net/consensys/linea/zktracer/module/hub/fragment/scenario/CreateScenarioFragment.java +++ b/arithmetization/src/main/java/net/consensys/linea/zktracer/module/hub/fragment/scenario/CreateScenarioFragment.java @@ -18,6 +18,7 @@ import lombok.Setter; import net.consensys.linea.zktracer.module.hub.Trace; import net.consensys.linea.zktracer.module.hub.fragment.TraceFragment; +import net.consensys.linea.zktracer.opcode.OpCode; public class CreateScenarioFragment implements TraceFragment { @@ -32,11 +33,23 @@ public enum CreateScenario { CREATE_NON_EMPTY_INIT_CODE_FAILURE_WILL_REVERT, CREATE_NON_EMPTY_INIT_CODE_FAILURE_WONT_REVERT, CREATE_NON_EMPTY_INIT_CODE_SUCCESS_WILL_REVERT, - CREATE_NON_EMPTY_INIT_CODE_SUCCESS_WONT_REVERT + CREATE_NON_EMPTY_INIT_CODE_SUCCESS_WONT_REVERT; + + + public boolean isAnyOf(CreateScenario... createScenarios) { + for (CreateScenario createScenario : createScenarios) { + if (createScenario.equals(this)) { + return true; + } + } + return false; + } } @Setter @Getter private CreateScenario scenario; + + public CreateScenarioFragment() { this.scenario = CreateScenario.UNDEFINED; } diff --git a/arithmetization/src/main/java/net/consensys/linea/zktracer/module/hub/section/CreateSection.java b/arithmetization/src/main/java/net/consensys/linea/zktracer/module/hub/section/CreateSection.java index e89affb163..ef254b3b23 100644 --- a/arithmetization/src/main/java/net/consensys/linea/zktracer/module/hub/section/CreateSection.java +++ b/arithmetization/src/main/java/net/consensys/linea/zktracer/module/hub/section/CreateSection.java @@ -68,8 +68,8 @@ public class CreateSection extends TraceSection private AccountSnapshot preOpcodeCreateeSnapshot; // Just at the entry child frame - private AccountSnapshot childEntryCreatorSnapshot; - private AccountSnapshot childEntryCreateeSnapshot; + private AccountSnapshot childContextEntryCreatorSnapshot; + private AccountSnapshot childContextEntryCreateeSnapshot; // Just at the entry child frame private AccountSnapshot reEntryCreatorSnapshot; @@ -107,7 +107,7 @@ public CreateSection(Hub hub, MessageFrame frame) { this.addFragment(imcFragment); refineCreateScenario(hub, frame); - scheduleSection(hub, frame); + scheduleSection(hub); final short exceptions = hub.pch().exceptions(); @@ -153,19 +153,12 @@ public CreateSection(Hub hub, MessageFrame frame) { switch (scenarioFragment.getScenario()) { case CREATE_ABORT -> { - this.traceAndScheduleForAbort(hub); + this.traceAbort(hub); return; } - case CREATE_FAILURE_CONDITION_WONT_REVERT -> { - this.traceAndScheduleForFailureCondition(hub); - return; - } - case CREATE_EMPTY_INIT_CODE_WONT_REVERT -> this.traceAndScheduleForEmptyInitCode(hub); - case CREATE_NON_EMPTY_INIT_CODE_SUCCESS_WONT_REVERT -> this - .traceAndScheduleForNonemptyInitCode(hub); - case CREATE_EXCEPTION -> {} + case CREATE_FAILURE_CONDITION_WONT_REVERT, CREATE_EMPTY_INIT_CODE_WONT_REVERT, CREATE_NON_EMPTY_INIT_CODE_SUCCESS_WONT_REVERT -> {} default -> throw new IllegalStateException( - CREATE_EXCEPTION.name() + " shouldn't enter this section"); + scenarioFragment.getScenario().name() + " shouldn't enter this section"); } // The CREATE(2) is now unexceptional and unaborted @@ -232,11 +225,11 @@ public CreateSection(Hub hub, MessageFrame frame) { @Override public void resolveUponContextEntry(Hub hub, MessageFrame frame) { - childEntryCreatorSnapshot = + childContextEntryCreatorSnapshot = AccountSnapshot.canonical(hub, frame.getWorldUpdater(), preOpcodeCreatorSnapshot.address()) // .raiseNonceByOne() // the nonce was already raised .decrementBalanceBy(value); - childEntryCreateeSnapshot = + childContextEntryCreateeSnapshot = AccountSnapshot.canonical(hub, frame.getWorldUpdater(), preOpcodeCreateeSnapshot.address()) .raiseNonceByOne() .incrementBalanceBy(value); @@ -244,15 +237,15 @@ public void resolveUponContextEntry(Hub hub, MessageFrame frame) { final AccountFragment creatorAccountFragment = accountFragmentFactory.make( preOpcodeCreatorSnapshot, - childEntryCreatorSnapshot, + childContextEntryCreatorSnapshot, DomSubStampsSubFragment.standardDomSubStamps(this.hubStamp(), 0)); creatorAccountFragment.rlpAddrSubFragment(rlpAddrSubFragment); final AccountFragment createeAccountFragment = accountFragmentFactory.makeWithTrm( preOpcodeCreateeSnapshot, - childEntryCreateeSnapshot, - preOpcodeCreateeSnapshot.address().trimLeadingZeros(), + childContextEntryCreateeSnapshot, + createeAddress.trimLeadingZeros(), DomSubStampsSubFragment.standardDomSubStamps(this.hubStamp(), 1)); createeAccountFragment.requiresRomlex(requiresRomLex); @@ -264,14 +257,43 @@ public void resolveUponContextEntry(Hub hub, MessageFrame frame) { public void resolveAtContextReEntry(Hub hub, CallFrame frame) { success = !frame.frame().getStackItem(0).isZero(); + CreateScenarioFragment.CreateScenario scenario = scenarioFragment.getScenario(); + + switch (scenario) { + case CREATE_FAILURE_CONDITION_WONT_REVERT, CREATE_EMPTY_INIT_CODE_WONT_REVERT -> { + checkState(success == (scenario == CREATE_EMPTY_INIT_CODE_WONT_REVERT)); + reEntryCreatorSnapshot = AccountSnapshot.canonical(hub, frame.frame().getWorldUpdater(), creatorAddress); + reEntryCreateeSnapshot = AccountSnapshot.canonical(hub, frame.frame().getWorldUpdater(), createeAddress); + final AccountFragment firstCreatorFragment = + accountFragmentFactory.make( + preOpcodeCreatorSnapshot, + reEntryCreatorSnapshot, + DomSubStampsSubFragment.standardDomSubStamps( + this.hubStamp(), 0)); + firstCreatorFragment.rlpAddrSubFragment(rlpAddrSubFragment); + + final AccountFragment firstCreateeFragment = + accountFragmentFactory.makeWithTrm( + preOpcodeCreateeSnapshot, + reEntryCreateeSnapshot, + createeAddress.trimLeadingZeros(), + DomSubStampsSubFragment.standardDomSubStamps( + this.hubStamp(), 1)); + + this.addFragments(firstCreatorFragment, firstCreateeFragment); + return; + } + default -> {} + } + if (success) { scenarioFragment.setScenario(CREATE_NON_EMPTY_INIT_CODE_SUCCESS_WONT_REVERT); return; } - reEntryCreatorSnapshot = childEntryCreatorSnapshot.deepCopy().incrementBalanceBy(value); + reEntryCreatorSnapshot = childContextEntryCreatorSnapshot.deepCopy().incrementBalanceBy(value); reEntryCreateeSnapshot = - childEntryCreateeSnapshot + childContextEntryCreateeSnapshot .deepCopy() .decrementBalanceBy(value) .deploymentStatus(false) @@ -282,14 +304,14 @@ public void resolveAtContextReEntry(Hub hub, CallFrame frame) { final AccountFragment undoCreator = accountFragmentFactory.make( - childEntryCreatorSnapshot, + childContextEntryCreatorSnapshot, reEntryCreatorSnapshot, DomSubStampsSubFragment.revertsWithChildDomSubStamps( this.hubStamp(), childRevertStamp, 2)); final AccountFragment undoCreatee = accountFragmentFactory.make( - childEntryCreateeSnapshot, + childContextEntryCreateeSnapshot, reEntryCreateeSnapshot, DomSubStampsSubFragment.revertsWithChildDomSubStamps( this.hubStamp(), childRevertStamp, 3)); @@ -299,22 +321,55 @@ public void resolveAtContextReEntry(Hub hub, CallFrame frame) { @Override public void resolveUponRollback(Hub hub, MessageFrame messageFrame, CallFrame callFrame) { - scenarioFragment.setScenario(switchToRevert(scenarioFragment.getScenario())); + + final CreateScenarioFragment.CreateScenario scenario = scenarioFragment.getScenario(); + checkState(scenario.isAnyOf( + CREATE_FAILURE_CONDITION_WONT_REVERT, + CREATE_EMPTY_INIT_CODE_WONT_REVERT, + CREATE_NON_EMPTY_INIT_CODE_SUCCESS_WONT_REVERT, + CREATE_NON_EMPTY_INIT_CODE_FAILURE_WONT_REVERT + )); + scenarioFragment.setScenario(switchToRevertingScenario(scenario)); final int revertStamp = callFrame.revertStamp(); + + switch (scenario) { + case CREATE_FAILURE_CONDITION_WONT_REVERT, CREATE_EMPTY_INIT_CODE_WONT_REVERT -> { + final AccountFragment undoCreator = + accountFragmentFactory.make( + reEntryCreatorSnapshot.deepCopy().setDeploymentInfo(hub), + preOpcodeCreatorSnapshot.deepCopy().setDeploymentInfo(hub), + DomSubStampsSubFragment.revertWithCurrentDomSubStamps( + this.hubStamp(), revertStamp, 2)); + + final AccountFragment undoCreatee = + accountFragmentFactory.make( + reEntryCreateeSnapshot.deepCopy().setDeploymentInfo(hub), + preOpcodeCreateeSnapshot.deepCopy().setDeploymentInfo(hub), + DomSubStampsSubFragment.revertWithCurrentDomSubStamps( + this.hubStamp(), revertStamp,3)); + this.addFragments(undoCreator, undoCreatee); + return; + } + // case CREATE_NON_EMPTY_INIT_CODE_SUCCESS_WONT_REVERT -> revertNonEmptyInitCodeDeploymentSuccessCase(); + // case CREATE_NON_EMPTY_INIT_CODE_SUCCESS_WILL_REVERT -> revertNonEmptyInitCodeDeploymentFailureCase(); + default -> {} + } + + final boolean firstUndo = scenarioFragment.getScenario() != CREATE_NON_EMPTY_INIT_CODE_FAILURE_WILL_REVERT; final AccountFragment undoCreator = accountFragmentFactory.make( - firstUndo ? childEntryCreatorSnapshot : reEntryCreatorSnapshot, + firstUndo ? childContextEntryCreatorSnapshot : reEntryCreatorSnapshot, preOpcodeCreatorSnapshot, DomSubStampsSubFragment.revertWithCurrentDomSubStamps( this.hubStamp(), revertStamp, firstUndo ? 2 : 4)); final AccountFragment undoCreatee = accountFragmentFactory.make( - firstUndo ? childEntryCreateeSnapshot : reEntryCreateeSnapshot, + firstUndo ? childContextEntryCreateeSnapshot : reEntryCreateeSnapshot, preOpcodeCreateeSnapshot, DomSubStampsSubFragment.revertWithCurrentDomSubStamps( this.hubStamp(), revertStamp, firstUndo ? 3 : 5)); @@ -322,11 +377,6 @@ public void resolveUponRollback(Hub hub, MessageFrame messageFrame, CallFrame ca this.addFragments(undoCreator, undoCreatee); } - @Override - public void resolvePostTransaction( - Hub hub, WorldView state, Transaction tx, boolean isSuccessful) { - addFragment(finalContextFragment); - } private static short maxNumberOfLines(final short exceptions, final AbortingConditions abort) { if (Exceptions.any(exceptions)) { @@ -338,7 +388,7 @@ private static short maxNumberOfLines(final short exceptions, final AbortingCond return 11; // Note: could be lower for unreverted successful CREATE(s) } - private void traceAndScheduleForAbort(final Hub hub) { + private void traceAbort(final Hub hub) { final AccountFragment creatorAccountFragment = accountFragmentFactory.make( preOpcodeCreatorSnapshot, @@ -354,13 +404,7 @@ private void finalContextFragmentSquashesReturnData(Hub hub) { finalContextFragment = ContextFragment.nonExecutionProvidesEmptyReturnData(hub); } - private void traceAndScheduleForFailureCondition(Hub hub) {} - - private void traceAndScheduleForEmptyInitCode(Hub hub) {} - - private void traceAndScheduleForNonemptyInitCode(Hub hub) {} - - private static CreateScenarioFragment.CreateScenario switchToRevert( + private static CreateScenarioFragment.CreateScenario switchToRevertingScenario( final CreateScenarioFragment.CreateScenario previousScenario) { return switch (previousScenario) { case CREATE_FAILURE_CONDITION_WONT_REVERT -> CREATE_FAILURE_CONDITION_WILL_REVERT; @@ -397,14 +441,14 @@ private void refineCreateScenario(Hub hub, MessageFrame frame) { : CREATE_NON_EMPTY_INIT_CODE_SUCCESS_WONT_REVERT); } - private void scheduleSection(Hub hub, MessageFrame frame) { + private void scheduleSection(Hub hub) { CreateScenarioFragment.CreateScenario scenario = scenarioFragment.getScenario(); final CallFrame currentFrame = hub.currentFrame(); switch (scenario) { case CREATE_EXCEPTION -> {} case CREATE_ABORT -> hub.defers().scheduleForPostExecution(this); // unlatch the stack case CREATE_FAILURE_CONDITION_WONT_REVERT, CREATE_EMPTY_INIT_CODE_WONT_REVERT -> { - hub.defers().scheduleForContextEntry(this); + hub.defers().scheduleForContextReEntry(this, currentFrame); hub.defers().scheduleForPostRollback(this, currentFrame); hub.defers().scheduleForPostTransaction(this); } @@ -443,4 +487,10 @@ public void resolvePostExecution( checkState(scenarioFragment.isAbortedCreate()); hub.unlatchStack(frame, this); } + + @Override + public void resolvePostTransaction( + Hub hub, WorldView state, Transaction tx, boolean isSuccessful) { + addFragment(finalContextFragment); + } } From 68b4e0fb396cc0fce26d322382483a08cca48b83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Olivier=20B=C3=A9gassat?= Date: Fri, 6 Dec 2024 12:39:55 +0700 Subject: [PATCH 34/44] fix: some wip refactoring on CreateSection --- .../module/hub/section/CreateSection.java | 91 +++++++++++-------- 1 file changed, 55 insertions(+), 36 deletions(-) diff --git a/arithmetization/src/main/java/net/consensys/linea/zktracer/module/hub/section/CreateSection.java b/arithmetization/src/main/java/net/consensys/linea/zktracer/module/hub/section/CreateSection.java index ef254b3b23..b5218a7cbe 100644 --- a/arithmetization/src/main/java/net/consensys/linea/zktracer/module/hub/section/CreateSection.java +++ b/arithmetization/src/main/java/net/consensys/linea/zktracer/module/hub/section/CreateSection.java @@ -38,6 +38,7 @@ import net.consensys.linea.zktracer.module.hub.signals.AbortingConditions; import net.consensys.linea.zktracer.module.hub.signals.Exceptions; import net.consensys.linea.zktracer.module.shakiradata.ShakiraDataOperation; +import net.consensys.linea.zktracer.opcode.OpCode; import net.consensys.linea.zktracer.runtime.callstack.CallFrame; import org.apache.tuweni.bytes.Bytes; import org.apache.tuweni.units.bigints.UInt256; @@ -80,8 +81,7 @@ public class CreateSection extends TraceSection final CreateScenarioFragment scenarioFragment; // row i + 0 final ContextFragment currentContextFragment; // row i + 1 final ImcFragment imcFragment; // row i + 2 - // row i+? - private ContextFragment finalContextFragment; + private ContextFragment finalContextFragment; // row i+? private boolean requiresRomLex; private Wei value; @@ -116,64 +116,56 @@ public CreateSection(Hub hub, MessageFrame frame) { return; } + // MXPX case final MxpCall mxpCall = new MxpCall(hub); imcFragment.callMxp(mxpCall); checkArgument(mxpCall.mxpx == Exceptions.memoryExpansionException(exceptions)); - - // MXPX case if (mxpCall.mxpx) { return; } + // OOGX case final StpCall stpCall = new StpCall(hub, frame, mxpCall.getGasMxp()); imcFragment.callStp(stpCall); - checkArgument(stpCall.outOfGasException() == Exceptions.outOfGasException(exceptions)); - - // OOGX case if (Exceptions.outOfGasException(exceptions)) { return; } // The CREATE(2) is now unexceptional + ///////////////////////////////////// + checkArgument(Exceptions.none(exceptions)); hub.currentFrame().childSpanningSection(this); final CreateOobCall oobCall = new CreateOobCall(); imcFragment.callOob(oobCall); - final AbortingConditions aborts = hub.pch().abortingConditions().snapshot(); - checkArgument(oobCall.isAbortingCondition() == aborts.any()); - preOpcodeCreatorSnapshot = AccountSnapshot.canonical(hub, frame.getWorldUpdater(), creatorAddress); preOpcodeCreateeSnapshot = AccountSnapshot.canonical(hub, frame.getWorldUpdater(), createeAddress); + final boolean aborts = scenarioFragment.getScenario() == CREATE_ABORT; + final boolean failedCreate = scenarioFragment.getScenario() == CREATE_FAILURE_CONDITION_WONT_REVERT; + final boolean emptyInitCode = scenarioFragment.getScenario() == CREATE_EMPTY_INIT_CODE_WONT_REVERT; - switch (scenarioFragment.getScenario()) { - case CREATE_ABORT -> { - this.traceAbort(hub); - return; - } - case CREATE_FAILURE_CONDITION_WONT_REVERT, CREATE_EMPTY_INIT_CODE_WONT_REVERT, CREATE_NON_EMPTY_INIT_CODE_SUCCESS_WONT_REVERT -> {} - default -> throw new IllegalStateException( - scenarioFragment.getScenario().name() + " shouldn't enter this section"); + checkArgument(oobCall.isAbortingCondition() == aborts); + if (aborts) { + this.traceAbort(hub); + return; } - // The CREATE(2) is now unexceptional and unaborted - checkArgument(aborts.none()); + // The CREATE(2) is now unexceptional, unaborted + //////////////////////////////////////////////// rlpAddrSubFragment = RlpAddrSubFragment.makeFragment(hub, createeAddress); final long offset = Words.clampedToLong(frame.getStackItem(1)); final long size = Words.clampedToLong(frame.getStackItem(2)); - final boolean failedCreate = raisesFailureCondition(frame); - final boolean emptyInitCode = hasEmptyInitCode(hub); - // Trigger MMU & SHAKIRA to hash the (non-empty) InitCode of CREATE2 - even for failed CREATE2 - if (hub.opCode() == CREATE2 && !emptyInitCode) { + if (nontrivialCreate2(hub.opCode(), size)) { final Bytes create2InitCode = frame.shadowReadMemory(offset, size); final MmuCall mmuCall = MmuCall.create2(hub, create2InitCode, failedCreate); @@ -200,8 +192,8 @@ public CreateSection(Hub hub, MessageFrame frame) { return; } - // Finally, non-exceptional, non-aborting, non-failing, non-emptyInitCode create - //////////////////////////////////////////////////////////////////////////////// + // unexceptional, unaborted, non-failing, non-emptyInitCode CREATE(2) + ///////////////////////////////////////////////////////////////////// // we charge for the gas paid out of pocket commonValues.payGasPaidOutOfPocket(hub); @@ -260,10 +252,10 @@ public void resolveAtContextReEntry(Hub hub, CallFrame frame) { CreateScenarioFragment.CreateScenario scenario = scenarioFragment.getScenario(); switch (scenario) { - case CREATE_FAILURE_CONDITION_WONT_REVERT, CREATE_EMPTY_INIT_CODE_WONT_REVERT -> { - checkState(success == (scenario == CREATE_EMPTY_INIT_CODE_WONT_REVERT)); - reEntryCreatorSnapshot = AccountSnapshot.canonical(hub, frame.frame().getWorldUpdater(), creatorAddress); - reEntryCreateeSnapshot = AccountSnapshot.canonical(hub, frame.frame().getWorldUpdater(), createeAddress); + case CREATE_FAILURE_CONDITION_WONT_REVERT -> { + checkState(!success); + reEntryCreatorSnapshot = preOpcodeCreatorSnapshot.deepCopy().raiseNonceByOne(); + reEntryCreateeSnapshot = preOpcodeCreateeSnapshot.deepCopy().turnOnWarmth(); final AccountFragment firstCreatorFragment = accountFragmentFactory.make( preOpcodeCreatorSnapshot, @@ -283,6 +275,29 @@ public void resolveAtContextReEntry(Hub hub, CallFrame frame) { this.addFragments(firstCreatorFragment, firstCreateeFragment); return; } + case CREATE_EMPTY_INIT_CODE_WONT_REVERT -> { + checkState(success); + reEntryCreatorSnapshot = AccountSnapshot.canonical(hub, frame.frame().getWorldUpdater(), creatorAddress); + reEntryCreateeSnapshot = AccountSnapshot.canonical(hub, frame.frame().getWorldUpdater(), createeAddress); + final AccountFragment firstCreatorFragment = + accountFragmentFactory.make( + preOpcodeCreatorSnapshot, + reEntryCreatorSnapshot, + DomSubStampsSubFragment.standardDomSubStamps( + this.hubStamp(), 0)); + firstCreatorFragment.rlpAddrSubFragment(rlpAddrSubFragment); + + final AccountFragment firstCreateeFragment = + accountFragmentFactory.makeWithTrm( + preOpcodeCreateeSnapshot, + reEntryCreateeSnapshot, + createeAddress.trimLeadingZeros(), + DomSubStampsSubFragment.standardDomSubStamps( + this.hubStamp(), 1)); + + this.addFragments(firstCreatorFragment, firstCreateeFragment); + return; + } default -> {} } @@ -307,14 +322,14 @@ public void resolveAtContextReEntry(Hub hub, CallFrame frame) { childContextEntryCreatorSnapshot, reEntryCreatorSnapshot, DomSubStampsSubFragment.revertsWithChildDomSubStamps( - this.hubStamp(), childRevertStamp, 2)); + this.hubStamp(), childRevertStamp, 0)); final AccountFragment undoCreatee = accountFragmentFactory.make( childContextEntryCreateeSnapshot, reEntryCreateeSnapshot, DomSubStampsSubFragment.revertsWithChildDomSubStamps( - this.hubStamp(), childRevertStamp, 3)); + this.hubStamp(), childRevertStamp, 1)); this.addFragments(undoCreator, undoCreatee); } @@ -340,14 +355,14 @@ public void resolveUponRollback(Hub hub, MessageFrame messageFrame, CallFrame ca reEntryCreatorSnapshot.deepCopy().setDeploymentInfo(hub), preOpcodeCreatorSnapshot.deepCopy().setDeploymentInfo(hub), DomSubStampsSubFragment.revertWithCurrentDomSubStamps( - this.hubStamp(), revertStamp, 2)); + this.hubStamp(), revertStamp, 0)); final AccountFragment undoCreatee = accountFragmentFactory.make( reEntryCreateeSnapshot.deepCopy().setDeploymentInfo(hub), preOpcodeCreateeSnapshot.deepCopy().setDeploymentInfo(hub), DomSubStampsSubFragment.revertWithCurrentDomSubStamps( - this.hubStamp(), revertStamp,3)); + this.hubStamp(), revertStamp,1)); this.addFragments(undoCreator, undoCreatee); return; } @@ -365,14 +380,14 @@ public void resolveUponRollback(Hub hub, MessageFrame messageFrame, CallFrame ca firstUndo ? childContextEntryCreatorSnapshot : reEntryCreatorSnapshot, preOpcodeCreatorSnapshot, DomSubStampsSubFragment.revertWithCurrentDomSubStamps( - this.hubStamp(), revertStamp, firstUndo ? 2 : 4)); + this.hubStamp(), revertStamp, firstUndo ? 0 : 2)); final AccountFragment undoCreatee = accountFragmentFactory.make( firstUndo ? childContextEntryCreateeSnapshot : reEntryCreateeSnapshot, preOpcodeCreateeSnapshot, DomSubStampsSubFragment.revertWithCurrentDomSubStamps( - this.hubStamp(), revertStamp, firstUndo ? 3 : 5)); + this.hubStamp(), revertStamp, firstUndo ? 1 : 3)); this.addFragments(undoCreator, undoCreatee); } @@ -493,4 +508,8 @@ public void resolvePostTransaction( Hub hub, WorldView state, Transaction tx, boolean isSuccessful) { addFragment(finalContextFragment); } + + private boolean nontrivialCreate2(OpCode opCode, long size) { + return (opCode == CREATE2 && size != 0); + } } From 212c827829aa9f72795c07052723a0448a09a0a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Olivier=20B=C3=A9gassat?= Date: Fri, 6 Dec 2024 12:41:02 +0700 Subject: [PATCH 35/44] ras: renaming for simpler interpretation of ParametricTests results --- .../createTests/OffsetParameter.java | 12 ++--- .../createTests/SizeParameter.java | 16 +++---- .../createTests/ValueParameter.java | 8 ++-- .../createTests/abort/Balance.java | 24 +++++----- .../createTests/trivial/RootLevel.java | 46 +++++++++---------- .../module/rlptxn/TestRandomTxns.java | 2 +- 6 files changed, 54 insertions(+), 54 deletions(-) diff --git a/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/OffsetParameter.java b/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/OffsetParameter.java index dadfcc0d11..1e945e1d96 100644 --- a/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/OffsetParameter.java +++ b/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/OffsetParameter.java @@ -15,10 +15,10 @@ package net.consensys.linea.zktracer.instructionprocessing.createTests; public enum OffsetParameter { - ZERO, - THREE, - SIXTEEN, - SIXTEEN_BYTE_INT, - THIRTY_TWO_BYTE_INT, - MAX, + o_ZERO, + o_THREE, + o_SIXTEEN, + o_SIXTEEN_BYTE_INT, + o_THIRTY_TWO_BYTE_INT, + o_MAX, } diff --git a/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/SizeParameter.java b/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/SizeParameter.java index 2b5108fc1a..e43d5a4dc7 100644 --- a/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/SizeParameter.java +++ b/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/SizeParameter.java @@ -15,13 +15,13 @@ package net.consensys.linea.zktracer.instructionprocessing.createTests; public enum SizeParameter { - ZERO, - TWELVE, // - 3 - 1 - THIRTEEN, // - 3 + 0 - FOURTEEN, // - 3 + 1 - THIRTY_TWO, - MSIZE, - MAX; + s_ZERO, + s_TWELVE, // - 3 - 1 + s_THIRTEEN, // - 3 + 0 + s_FOURTEEN, // - 3 + 1 + s_THIRTY_TWO, + s_MSIZE, + s_MAX; public boolean isAnyOf(SizeParameter... sizeParameters) { for (SizeParameter sizeParameter : sizeParameters) { @@ -33,6 +33,6 @@ public boolean isAnyOf(SizeParameter... sizeParameters) { } public boolean willRaiseException() { - return this.isAnyOf(MAX); + return this.isAnyOf(s_MAX); } } diff --git a/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/ValueParameter.java b/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/ValueParameter.java index 55d56d176f..aac7b14a58 100644 --- a/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/ValueParameter.java +++ b/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/ValueParameter.java @@ -15,8 +15,8 @@ package net.consensys.linea.zktracer.instructionprocessing.createTests; public enum ValueParameter { - ZERO, - ONE, - SELFBALANCE, - SELFBALANCE_PLUS_ONE, + v_ZERO, + v_ONE, + v_SELFBALANCE, + v_SELFBALANCE_PLUS_ONE, } diff --git a/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/abort/Balance.java b/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/abort/Balance.java index c5ccc80e84..0d5eeddd66 100644 --- a/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/abort/Balance.java +++ b/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/abort/Balance.java @@ -43,14 +43,14 @@ void rootLevelInsufficientBalanceCreateOpcodeTest( BytecodeCompiler program = BytecodeCompiler.newProgram(); - if (sizeParameter == MSIZE) { + if (sizeParameter == s_MSIZE) { program.push(513).push(0).op(SHA3); // purely to expand memory to 0 < 512 + 32 bytes } genericCreate( program, createType, - ValueParameter.SELFBALANCE_PLUS_ONE, + ValueParameter.v_SELFBALANCE_PLUS_ONE, offsetParameter, sizeParameter, salt01); @@ -74,11 +74,11 @@ void rootLevelAbortThenSuccessCreateTest( genericCreate( program, createType, - ValueParameter.SELFBALANCE_PLUS_ONE, + ValueParameter.v_SELFBALANCE_PLUS_ONE, offsetParameter, sizeParameter, salt01); // aborts - genericCreate(program, createType, ValueParameter.ONE, offsetParameter, sizeParameter, salt01); + genericCreate(program, createType, ValueParameter.v_ONE, offsetParameter, sizeParameter, salt01); if (reverts) { appendRevert(program, 2, 13); @@ -92,19 +92,19 @@ void rootLevelAbortThenSuccessCreateTest() { // parameters CreateType createType = CreateType.CREATE; - OffsetParameter offsetParameter = OffsetParameter.ZERO; - SizeParameter sizeParameter = SizeParameter.ZERO; + OffsetParameter offsetParameter = OffsetParameter.o_ZERO; + SizeParameter sizeParameter = SizeParameter.s_ZERO; boolean reverts = true; BytecodeCompiler program = BytecodeCompiler.newProgram(); genericCreate( program, createType, - ValueParameter.SELFBALANCE_PLUS_ONE, + ValueParameter.v_SELFBALANCE_PLUS_ONE, offsetParameter, sizeParameter, salt01); // aborts - genericCreate(program, createType, ValueParameter.ONE, offsetParameter, sizeParameter, salt01); + genericCreate(program, createType, ValueParameter.v_ONE, offsetParameter, sizeParameter, salt01); if (reverts) { appendRevert(program, 2, 13); @@ -135,7 +135,7 @@ void rootLevelSuccessThenAbortCreateTest( void specificRootLevelSuccessThenAbortCreateTest() { BytecodeCompiler program = rootLevelSuccessThenAbortCreateByteCodeCompiler( - CreateType.CREATE2, OffsetParameter.ZERO, SizeParameter.ZERO, false); + CreateType.CREATE2, OffsetParameter.o_ZERO, SizeParameter.s_ZERO, false); run(program); } @@ -145,11 +145,11 @@ BytecodeCompiler rootLevelSuccessThenAbortCreateByteCodeCompiler( SizeParameter sizeParameter, boolean reverts) { BytecodeCompiler program = BytecodeCompiler.newProgram(); - genericCreate(program, createType, ValueParameter.ONE, offsetParameter, sizeParameter, salt01); + genericCreate(program, createType, ValueParameter.v_ONE, offsetParameter, sizeParameter, salt01); genericCreate( program, createType, - ValueParameter.SELFBALANCE_PLUS_ONE, + ValueParameter.v_SELFBALANCE_PLUS_ONE, offsetParameter, sizeParameter, salt01); // aborts @@ -179,7 +179,7 @@ private static Stream rootLevelInsufficientBalanceParameters() { List arguments = new ArrayList<>(); List sizeParameters = - List.of(ZERO, TWELVE, THIRTEEN, FOURTEEN, THIRTY_TWO, MSIZE); + List.of(s_ZERO, s_TWELVE, s_THIRTEEN, s_FOURTEEN, s_THIRTY_TWO, s_MSIZE); for (CreateType createType : CreateType.values()) { for (OffsetParameter offsetParameter : OffsetParameter.values()) { diff --git a/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/trivial/RootLevel.java b/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/trivial/RootLevel.java index f40e711c0b..52e352b826 100644 --- a/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/trivial/RootLevel.java +++ b/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/trivial/RootLevel.java @@ -60,7 +60,7 @@ void rootLevelCreateTests( boolean revert) { BytecodeCompiler program = BytecodeCompiler.newProgram(); - genericCreate(program, createType, valueParameter, offsetParameter, SizeParameter.ZERO, salt01); + genericCreate(program, createType, valueParameter, offsetParameter, SizeParameter.s_ZERO, salt01); if (revert) { program.push(0).push(0).op(REVERT); @@ -86,9 +86,9 @@ void rootLevelCreate2AndExtCodeHash(WhenToTestParameter when) { genericCreate( program, CreateType.CREATE2, - ValueParameter.ONE, - OffsetParameter.ZERO, - SizeParameter.ZERO, + ValueParameter.v_ONE, + OffsetParameter.o_ZERO, + SizeParameter.s_ZERO, salt01); if (when == BEFORE || when == BEFORE_AND_AFTER) { @@ -103,7 +103,7 @@ void rootLevelCreate2AndExtCodeHash(WhenToTestParameter when) { private static Stream createParametersForEmptyCreates() { - final List valueParameters = List.of(ValueParameter.ZERO, ValueParameter.ONE); + final List valueParameters = List.of(ValueParameter.v_ZERO, ValueParameter.v_ONE); List arguments = new ArrayList<>(); @@ -130,32 +130,32 @@ public static void genericCreate( if (type == CreateType.CREATE2) program.push(salt); switch (sizeParameter) { - case ZERO -> program.push(0); - case TWELVE -> program.push(12); - case THIRTEEN -> program.push(13); - case FOURTEEN -> program.push(14); - case THIRTY_TWO -> program.push(0x20); - case MSIZE -> program.op(MSIZE); - case MAX -> program.push("ff".repeat(32)); + case s_ZERO -> program.push(0); + case s_TWELVE -> program.push(12); + case s_THIRTEEN -> program.push(13); + case s_FOURTEEN -> program.push(14); + case s_THIRTY_TWO -> program.push(0x20); + case s_MSIZE -> program.op(MSIZE); + case s_MAX -> program.push("ff".repeat(32)); } switch (offsetParameter) { - case ZERO -> program.push(0); - case THREE -> program.push(0); - case SIXTEEN -> program.push(0x10); - case SIXTEEN_BYTE_INT -> program.push("abe1245ffff123a87000a543eff12aaa"); - case THIRTY_TWO_BYTE_INT -> program.push( + case o_ZERO -> program.push(0); + case o_THREE -> program.push(0); + case o_SIXTEEN -> program.push(0x10); + case o_SIXTEEN_BYTE_INT -> program.push("abe1245ffff123a87000a543eff12aaa"); + case o_THIRTY_TWO_BYTE_INT -> program.push( "abe1245ffff123a87000a543eff12aaa09987582714266effffefaabc76aa758"); - case MAX -> program.push("ff".repeat(32)); + case o_MAX -> program.push("ff".repeat(32)); } switch (valueParameter) { - case ZERO -> program.push(0); - case ONE -> program.push(1); - case SELFBALANCE -> program.op(SELFBALANCE); - case SELFBALANCE_PLUS_ONE -> program.op(SELFBALANCE).push(1).op(ADD); + case v_ZERO -> program.push(0); + case v_ONE -> program.push(1); + case v_SELFBALANCE -> program.op(SELFBALANCE); + case v_SELFBALANCE_PLUS_ONE -> program.op(SELFBALANCE).push(1).op(ADD); } switch (type) { case CREATE -> program.op(CREATE); - case CREATE2 -> program.op(OpCode.CREATE2); + case CREATE2 -> program.op(CREATE2); } } diff --git a/arithmetization/src/test/java/net/consensys/linea/zktracer/module/rlptxn/TestRandomTxns.java b/arithmetization/src/test/java/net/consensys/linea/zktracer/module/rlptxn/TestRandomTxns.java index 957142e128..883e84a898 100644 --- a/arithmetization/src/test/java/net/consensys/linea/zktracer/module/rlptxn/TestRandomTxns.java +++ b/arithmetization/src/test/java/net/consensys/linea/zktracer/module/rlptxn/TestRandomTxns.java @@ -142,7 +142,7 @@ class TestRandomTxns { // final ToyAccount receiverAccount() { // // return ToyAccount.builder() - // .balance(Wei.ONE) + // .balance(Wei.v_ONE) // .nonce(6) // .address(Address.wrap(Bytes.random(20, rnd))) // .code( From 9e449901927ff87b168bcb283c2ffa28b094b3f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Olivier=20B=C3=A9gassat?= Date: Fri, 6 Dec 2024 12:53:16 +0700 Subject: [PATCH 36/44] fix: get latest deployment info for CREATE's that revert down to 7 failing CREATE tests, none of which (AFAICT) related to the CREATE's themselves. --- .../linea/zktracer/module/hub/section/CreateSection.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arithmetization/src/main/java/net/consensys/linea/zktracer/module/hub/section/CreateSection.java b/arithmetization/src/main/java/net/consensys/linea/zktracer/module/hub/section/CreateSection.java index b5218a7cbe..6f530204a8 100644 --- a/arithmetization/src/main/java/net/consensys/linea/zktracer/module/hub/section/CreateSection.java +++ b/arithmetization/src/main/java/net/consensys/linea/zktracer/module/hub/section/CreateSection.java @@ -378,14 +378,14 @@ public void resolveUponRollback(Hub hub, MessageFrame messageFrame, CallFrame ca final AccountFragment undoCreator = accountFragmentFactory.make( firstUndo ? childContextEntryCreatorSnapshot : reEntryCreatorSnapshot, - preOpcodeCreatorSnapshot, + preOpcodeCreatorSnapshot.deepCopy().setDeploymentInfo(hub), DomSubStampsSubFragment.revertWithCurrentDomSubStamps( this.hubStamp(), revertStamp, firstUndo ? 0 : 2)); final AccountFragment undoCreatee = accountFragmentFactory.make( firstUndo ? childContextEntryCreateeSnapshot : reEntryCreateeSnapshot, - preOpcodeCreateeSnapshot, + preOpcodeCreateeSnapshot.deepCopy().setDeploymentInfo(hub), DomSubStampsSubFragment.revertWithCurrentDomSubStamps( this.hubStamp(), revertStamp, firstUndo ? 1 : 3)); From aca3b394b24461987490390ef2355650e587be42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Olivier=20B=C3=A9gassat?= Date: Fri, 6 Dec 2024 14:21:42 +0700 Subject: [PATCH 37/44] fix: make SELFDESTRUCT finish on a single context row --- .../zktracer/module/hub/section/halt/SelfdestructSection.java | 4 ---- 1 file changed, 4 deletions(-) diff --git a/arithmetization/src/main/java/net/consensys/linea/zktracer/module/hub/section/halt/SelfdestructSection.java b/arithmetization/src/main/java/net/consensys/linea/zktracer/module/hub/section/halt/SelfdestructSection.java index 397c97a514..2e4d5c337c 100644 --- a/arithmetization/src/main/java/net/consensys/linea/zktracer/module/hub/section/halt/SelfdestructSection.java +++ b/arithmetization/src/main/java/net/consensys/linea/zktracer/module/hub/section/halt/SelfdestructSection.java @@ -228,10 +228,6 @@ public void resolveUponRollback(Hub hub, MessageFrame messageFrame, CallFrame ca this.addFragment(selfDestroyerUndoingAccountFragment); this.addFragment(recipientUndoingAccountFragment); - ContextFragment squashParentContextReturnData = - ContextFragment.executionProvidesEmptyReturnData(hub); - this.addFragment(squashParentContextReturnData); - selfDestructWasReverted = true; selfdestructScenarioFragment.setScenario( From 4acb628cc27118172c09ac884b4d2fa5cec96591 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Olivier=20B=C3=A9gassat?= Date: Fri, 6 Dec 2024 15:52:48 +0700 Subject: [PATCH 38/44] fix: CallFrame's callValue (value) must be gleamed from the apparentValue --- .../main/java/net/consensys/linea/zktracer/module/hub/Hub.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arithmetization/src/main/java/net/consensys/linea/zktracer/module/hub/Hub.java b/arithmetization/src/main/java/net/consensys/linea/zktracer/module/hub/Hub.java index f08447d14e..7d20516d3c 100644 --- a/arithmetization/src/main/java/net/consensys/linea/zktracer/module/hub/Hub.java +++ b/arithmetization/src/main/java/net/consensys/linea/zktracer/module/hub/Hub.java @@ -625,7 +625,7 @@ public void traceContextEnter(MessageFrame frame) { frameType, newChildContextNumber(), this.deploymentStatusOf(frame.getContractAddress()), - frame.getValue(), + frame.getApparentValue(), frame.getRemainingGas(), frame.getRecipientAddress(), this.deploymentNumberOf(frame.getRecipientAddress()), From cd93882cd40d621cada36dce66f7921e4a524232 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Olivier=20B=C3=A9gassat?= Date: Fri, 6 Dec 2024 16:35:43 +0700 Subject: [PATCH 39/44] fix: constraints point back to master --- linea-constraints | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linea-constraints b/linea-constraints index beca2079b9..60f65086ae 160000 --- a/linea-constraints +++ b/linea-constraints @@ -1 +1 @@ -Subproject commit beca2079b916725bdd3f2b0cdc42742ce750db35 +Subproject commit 60f65086aeba34afa4b086c75ec57e6aa363b31b From 181ccfa4c4358de2a1fd9a0c19af57b6616331d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Olivier=20B=C3=A9gassat?= Date: Fri, 6 Dec 2024 17:11:54 +0700 Subject: [PATCH 40/44] spotless --- .../scenario/CreateScenarioFragment.java | 4 - .../module/hub/section/CreateSection.java | 100 +++++++++--------- .../createTests/ValueParameter.java | 8 +- .../createTests/abort/Balance.java | 9 +- .../createTests/trivial/RootLevel.java | 6 +- 5 files changed, 64 insertions(+), 63 deletions(-) diff --git a/arithmetization/src/main/java/net/consensys/linea/zktracer/module/hub/fragment/scenario/CreateScenarioFragment.java b/arithmetization/src/main/java/net/consensys/linea/zktracer/module/hub/fragment/scenario/CreateScenarioFragment.java index 86fcbac675..85bfbbb22b 100644 --- a/arithmetization/src/main/java/net/consensys/linea/zktracer/module/hub/fragment/scenario/CreateScenarioFragment.java +++ b/arithmetization/src/main/java/net/consensys/linea/zktracer/module/hub/fragment/scenario/CreateScenarioFragment.java @@ -18,7 +18,6 @@ import lombok.Setter; import net.consensys.linea.zktracer.module.hub.Trace; import net.consensys.linea.zktracer.module.hub.fragment.TraceFragment; -import net.consensys.linea.zktracer.opcode.OpCode; public class CreateScenarioFragment implements TraceFragment { @@ -35,7 +34,6 @@ public enum CreateScenario { CREATE_NON_EMPTY_INIT_CODE_SUCCESS_WILL_REVERT, CREATE_NON_EMPTY_INIT_CODE_SUCCESS_WONT_REVERT; - public boolean isAnyOf(CreateScenario... createScenarios) { for (CreateScenario createScenario : createScenarios) { if (createScenario.equals(this)) { @@ -48,8 +46,6 @@ public boolean isAnyOf(CreateScenario... createScenarios) { @Setter @Getter private CreateScenario scenario; - - public CreateScenarioFragment() { this.scenario = CreateScenario.UNDEFINED; } diff --git a/arithmetization/src/main/java/net/consensys/linea/zktracer/module/hub/section/CreateSection.java b/arithmetization/src/main/java/net/consensys/linea/zktracer/module/hub/section/CreateSection.java index 6f530204a8..8eb2960104 100644 --- a/arithmetization/src/main/java/net/consensys/linea/zktracer/module/hub/section/CreateSection.java +++ b/arithmetization/src/main/java/net/consensys/linea/zktracer/module/hub/section/CreateSection.java @@ -147,8 +147,10 @@ public CreateSection(Hub hub, MessageFrame frame) { AccountSnapshot.canonical(hub, frame.getWorldUpdater(), createeAddress); final boolean aborts = scenarioFragment.getScenario() == CREATE_ABORT; - final boolean failedCreate = scenarioFragment.getScenario() == CREATE_FAILURE_CONDITION_WONT_REVERT; - final boolean emptyInitCode = scenarioFragment.getScenario() == CREATE_EMPTY_INIT_CODE_WONT_REVERT; + final boolean failedCreate = + scenarioFragment.getScenario() == CREATE_FAILURE_CONDITION_WONT_REVERT; + final boolean emptyInitCode = + scenarioFragment.getScenario() == CREATE_EMPTY_INIT_CODE_WONT_REVERT; checkArgument(oobCall.isAbortingCondition() == aborts); if (aborts) { @@ -198,7 +200,6 @@ public CreateSection(Hub hub, MessageFrame frame) { // we charge for the gas paid out of pocket commonValues.payGasPaidOutOfPocket(hub); - requiresRomLex = true; hub.romLex().callRomLex(frame); hub.transients() @@ -229,14 +230,14 @@ public void resolveUponContextEntry(Hub hub, MessageFrame frame) { final AccountFragment creatorAccountFragment = accountFragmentFactory.make( preOpcodeCreatorSnapshot, - childContextEntryCreatorSnapshot, + childContextEntryCreatorSnapshot, DomSubStampsSubFragment.standardDomSubStamps(this.hubStamp(), 0)); creatorAccountFragment.rlpAddrSubFragment(rlpAddrSubFragment); final AccountFragment createeAccountFragment = accountFragmentFactory.makeWithTrm( preOpcodeCreateeSnapshot, - childContextEntryCreateeSnapshot, + childContextEntryCreateeSnapshot, createeAddress.trimLeadingZeros(), DomSubStampsSubFragment.standardDomSubStamps(this.hubStamp(), 1)); @@ -257,43 +258,41 @@ public void resolveAtContextReEntry(Hub hub, CallFrame frame) { reEntryCreatorSnapshot = preOpcodeCreatorSnapshot.deepCopy().raiseNonceByOne(); reEntryCreateeSnapshot = preOpcodeCreateeSnapshot.deepCopy().turnOnWarmth(); final AccountFragment firstCreatorFragment = - accountFragmentFactory.make( - preOpcodeCreatorSnapshot, - reEntryCreatorSnapshot, - DomSubStampsSubFragment.standardDomSubStamps( - this.hubStamp(), 0)); + accountFragmentFactory.make( + preOpcodeCreatorSnapshot, + reEntryCreatorSnapshot, + DomSubStampsSubFragment.standardDomSubStamps(this.hubStamp(), 0)); firstCreatorFragment.rlpAddrSubFragment(rlpAddrSubFragment); final AccountFragment firstCreateeFragment = - accountFragmentFactory.makeWithTrm( - preOpcodeCreateeSnapshot, - reEntryCreateeSnapshot, - createeAddress.trimLeadingZeros(), - DomSubStampsSubFragment.standardDomSubStamps( - this.hubStamp(), 1)); + accountFragmentFactory.makeWithTrm( + preOpcodeCreateeSnapshot, + reEntryCreateeSnapshot, + createeAddress.trimLeadingZeros(), + DomSubStampsSubFragment.standardDomSubStamps(this.hubStamp(), 1)); this.addFragments(firstCreatorFragment, firstCreateeFragment); return; } case CREATE_EMPTY_INIT_CODE_WONT_REVERT -> { checkState(success); - reEntryCreatorSnapshot = AccountSnapshot.canonical(hub, frame.frame().getWorldUpdater(), creatorAddress); - reEntryCreateeSnapshot = AccountSnapshot.canonical(hub, frame.frame().getWorldUpdater(), createeAddress); + reEntryCreatorSnapshot = + AccountSnapshot.canonical(hub, frame.frame().getWorldUpdater(), creatorAddress); + reEntryCreateeSnapshot = + AccountSnapshot.canonical(hub, frame.frame().getWorldUpdater(), createeAddress); final AccountFragment firstCreatorFragment = - accountFragmentFactory.make( - preOpcodeCreatorSnapshot, - reEntryCreatorSnapshot, - DomSubStampsSubFragment.standardDomSubStamps( - this.hubStamp(), 0)); + accountFragmentFactory.make( + preOpcodeCreatorSnapshot, + reEntryCreatorSnapshot, + DomSubStampsSubFragment.standardDomSubStamps(this.hubStamp(), 0)); firstCreatorFragment.rlpAddrSubFragment(rlpAddrSubFragment); final AccountFragment firstCreateeFragment = - accountFragmentFactory.makeWithTrm( - preOpcodeCreateeSnapshot, - reEntryCreateeSnapshot, - createeAddress.trimLeadingZeros(), - DomSubStampsSubFragment.standardDomSubStamps( - this.hubStamp(), 1)); + accountFragmentFactory.makeWithTrm( + preOpcodeCreateeSnapshot, + reEntryCreateeSnapshot, + createeAddress.trimLeadingZeros(), + DomSubStampsSubFragment.standardDomSubStamps(this.hubStamp(), 1)); this.addFragments(firstCreatorFragment, firstCreateeFragment); return; @@ -319,14 +318,14 @@ public void resolveAtContextReEntry(Hub hub, CallFrame frame) { final AccountFragment undoCreator = accountFragmentFactory.make( - childContextEntryCreatorSnapshot, + childContextEntryCreatorSnapshot, reEntryCreatorSnapshot, DomSubStampsSubFragment.revertsWithChildDomSubStamps( this.hubStamp(), childRevertStamp, 0)); final AccountFragment undoCreatee = accountFragmentFactory.make( - childContextEntryCreateeSnapshot, + childContextEntryCreateeSnapshot, reEntryCreateeSnapshot, DomSubStampsSubFragment.revertsWithChildDomSubStamps( this.hubStamp(), childRevertStamp, 1)); @@ -338,12 +337,12 @@ public void resolveAtContextReEntry(Hub hub, CallFrame frame) { public void resolveUponRollback(Hub hub, MessageFrame messageFrame, CallFrame callFrame) { final CreateScenarioFragment.CreateScenario scenario = scenarioFragment.getScenario(); - checkState(scenario.isAnyOf( + checkState( + scenario.isAnyOf( CREATE_FAILURE_CONDITION_WONT_REVERT, CREATE_EMPTY_INIT_CODE_WONT_REVERT, CREATE_NON_EMPTY_INIT_CODE_SUCCESS_WONT_REVERT, - CREATE_NON_EMPTY_INIT_CODE_FAILURE_WONT_REVERT - )); + CREATE_NON_EMPTY_INIT_CODE_FAILURE_WONT_REVERT)); scenarioFragment.setScenario(switchToRevertingScenario(scenario)); final int revertStamp = callFrame.revertStamp(); @@ -351,27 +350,28 @@ public void resolveUponRollback(Hub hub, MessageFrame messageFrame, CallFrame ca switch (scenario) { case CREATE_FAILURE_CONDITION_WONT_REVERT, CREATE_EMPTY_INIT_CODE_WONT_REVERT -> { final AccountFragment undoCreator = - accountFragmentFactory.make( - reEntryCreatorSnapshot.deepCopy().setDeploymentInfo(hub), - preOpcodeCreatorSnapshot.deepCopy().setDeploymentInfo(hub), - DomSubStampsSubFragment.revertWithCurrentDomSubStamps( - this.hubStamp(), revertStamp, 0)); + accountFragmentFactory.make( + reEntryCreatorSnapshot.deepCopy().setDeploymentInfo(hub), + preOpcodeCreatorSnapshot.deepCopy().setDeploymentInfo(hub), + DomSubStampsSubFragment.revertWithCurrentDomSubStamps( + this.hubStamp(), revertStamp, 0)); final AccountFragment undoCreatee = - accountFragmentFactory.make( - reEntryCreateeSnapshot.deepCopy().setDeploymentInfo(hub), - preOpcodeCreateeSnapshot.deepCopy().setDeploymentInfo(hub), - DomSubStampsSubFragment.revertWithCurrentDomSubStamps( - this.hubStamp(), revertStamp,1)); + accountFragmentFactory.make( + reEntryCreateeSnapshot.deepCopy().setDeploymentInfo(hub), + preOpcodeCreateeSnapshot.deepCopy().setDeploymentInfo(hub), + DomSubStampsSubFragment.revertWithCurrentDomSubStamps( + this.hubStamp(), revertStamp, 1)); this.addFragments(undoCreator, undoCreatee); return; } - // case CREATE_NON_EMPTY_INIT_CODE_SUCCESS_WONT_REVERT -> revertNonEmptyInitCodeDeploymentSuccessCase(); - // case CREATE_NON_EMPTY_INIT_CODE_SUCCESS_WILL_REVERT -> revertNonEmptyInitCodeDeploymentFailureCase(); + // case CREATE_NON_EMPTY_INIT_CODE_SUCCESS_WONT_REVERT -> + // revertNonEmptyInitCodeDeploymentSuccessCase(); + // case CREATE_NON_EMPTY_INIT_CODE_SUCCESS_WILL_REVERT -> + // revertNonEmptyInitCodeDeploymentFailureCase(); default -> {} } - final boolean firstUndo = scenarioFragment.getScenario() != CREATE_NON_EMPTY_INIT_CODE_FAILURE_WILL_REVERT; @@ -392,7 +392,6 @@ public void resolveUponRollback(Hub hub, MessageFrame messageFrame, CallFrame ca this.addFragments(undoCreator, undoCreatee); } - private static short maxNumberOfLines(final short exceptions, final AbortingConditions abort) { if (Exceptions.any(exceptions)) { return 6; @@ -478,7 +477,8 @@ private void scheduleSection(Hub hub) { // we capture revert information about the child context: CCSR and CCRS hub.defers().scheduleForContextReEntry(imcFragment, hub.currentFrame()); } - default -> throw new IllegalStateException(scenario.name() + " not allowed when defining the schedule"); + default -> throw new IllegalStateException( + scenario.name() + " not allowed when defining the schedule"); } } @@ -505,7 +505,7 @@ public void resolvePostExecution( @Override public void resolvePostTransaction( - Hub hub, WorldView state, Transaction tx, boolean isSuccessful) { + Hub hub, WorldView state, Transaction tx, boolean isSuccessful) { addFragment(finalContextFragment); } diff --git a/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/ValueParameter.java b/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/ValueParameter.java index aac7b14a58..cac86ed7e4 100644 --- a/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/ValueParameter.java +++ b/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/ValueParameter.java @@ -15,8 +15,8 @@ package net.consensys.linea.zktracer.instructionprocessing.createTests; public enum ValueParameter { - v_ZERO, - v_ONE, - v_SELFBALANCE, - v_SELFBALANCE_PLUS_ONE, + v_ZERO, + v_ONE, + v_SELFBALANCE, + v_SELFBALANCE_PLUS_ONE, } diff --git a/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/abort/Balance.java b/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/abort/Balance.java index 0d5eeddd66..097a504839 100644 --- a/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/abort/Balance.java +++ b/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/abort/Balance.java @@ -78,7 +78,8 @@ void rootLevelAbortThenSuccessCreateTest( offsetParameter, sizeParameter, salt01); // aborts - genericCreate(program, createType, ValueParameter.v_ONE, offsetParameter, sizeParameter, salt01); + genericCreate( + program, createType, ValueParameter.v_ONE, offsetParameter, sizeParameter, salt01); if (reverts) { appendRevert(program, 2, 13); @@ -104,7 +105,8 @@ void rootLevelAbortThenSuccessCreateTest() { offsetParameter, sizeParameter, salt01); // aborts - genericCreate(program, createType, ValueParameter.v_ONE, offsetParameter, sizeParameter, salt01); + genericCreate( + program, createType, ValueParameter.v_ONE, offsetParameter, sizeParameter, salt01); if (reverts) { appendRevert(program, 2, 13); @@ -145,7 +147,8 @@ BytecodeCompiler rootLevelSuccessThenAbortCreateByteCodeCompiler( SizeParameter sizeParameter, boolean reverts) { BytecodeCompiler program = BytecodeCompiler.newProgram(); - genericCreate(program, createType, ValueParameter.v_ONE, offsetParameter, sizeParameter, salt01); + genericCreate( + program, createType, ValueParameter.v_ONE, offsetParameter, sizeParameter, salt01); genericCreate( program, createType, diff --git a/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/trivial/RootLevel.java b/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/trivial/RootLevel.java index 52e352b826..b25ddd1690 100644 --- a/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/trivial/RootLevel.java +++ b/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/createTests/trivial/RootLevel.java @@ -60,7 +60,8 @@ void rootLevelCreateTests( boolean revert) { BytecodeCompiler program = BytecodeCompiler.newProgram(); - genericCreate(program, createType, valueParameter, offsetParameter, SizeParameter.s_ZERO, salt01); + genericCreate( + program, createType, valueParameter, offsetParameter, SizeParameter.s_ZERO, salt01); if (revert) { program.push(0).push(0).op(REVERT); @@ -103,7 +104,8 @@ void rootLevelCreate2AndExtCodeHash(WhenToTestParameter when) { private static Stream createParametersForEmptyCreates() { - final List valueParameters = List.of(ValueParameter.v_ZERO, ValueParameter.v_ONE); + final List valueParameters = + List.of(ValueParameter.v_ZERO, ValueParameter.v_ONE); List arguments = new ArrayList<>(); From 7832cbfe140a8ed6a15b879821db07fad07267ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Olivier=20B=C3=A9gassat?= Date: Fri, 6 Dec 2024 17:13:10 +0700 Subject: [PATCH 41/44] fix: remove junit parallelism --- .../src/test/resources/junit-platform.properties | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arithmetization/src/test/resources/junit-platform.properties b/arithmetization/src/test/resources/junit-platform.properties index 5302706516..01457fca69 100644 --- a/arithmetization/src/test/resources/junit-platform.properties +++ b/arithmetization/src/test/resources/junit-platform.properties @@ -1,3 +1,3 @@ -junit.jupiter.execution.parallel.enabled = true -junit.jupiter.execution.parallel.mode.default = concurrent -junit.jupiter.execution.parallel.config.strategy = dynamic \ No newline at end of file +# junit.jupiter.execution.parallel.enabled = true +# junit.jupiter.execution.parallel.mode.default = concurrent +# junit.jupiter.execution.parallel.config.strategy = dynamic From 0981d522b98e56b46588a4c8abc398528fddad35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Olivier=20B=C3=A9gassat?= Date: Fri, 6 Dec 2024 22:03:02 +0700 Subject: [PATCH 42/44] fix: re-did the type change for scenario/XXX_GAS columns Otherwise the project doesn't work properly with updated constraints --- .../linea/zktracer/module/hub/Trace.java | 3680 +++++------------ .../scenario/PrecompileScenarioFragment.java | 7 +- 2 files changed, 1107 insertions(+), 2580 deletions(-) diff --git a/arithmetization/src/main/java/net/consensys/linea/zktracer/module/hub/Trace.java b/arithmetization/src/main/java/net/consensys/linea/zktracer/module/hub/Trace.java index 83e6037fb0..83e1f404d8 100644 --- a/arithmetization/src/main/java/net/consensys/linea/zktracer/module/hub/Trace.java +++ b/arithmetization/src/main/java/net/consensys/linea/zktracer/module/hub/Trace.java @@ -15,6 +15,7 @@ package net.consensys.linea.zktracer.module.hub; +import java.math.BigInteger; import java.nio.MappedByteBuffer; import java.util.ArrayList; import java.util.BitSet; @@ -40,37 +41,26 @@ public class Trace { private int currentLine = 0; private final MappedByteBuffer absoluteTransactionNumber; - private final MappedByteBuffer - addressHiXorAccountAddressHiXorCcrsStampXorPrcCalleeGasXorStaticGasXorAddressHiXorCallDataSize; - private final MappedByteBuffer - addressLoXorAccountAddressLoXorExpData1XorHashInfoKeccakHiXorAddressLoXorCoinbaseAddressLo; - private final MappedByteBuffer - againInBlkXorIsRootXorCcsrFlagXorCallAbortWillRevertXorAccFlagXorAgainInBlkXorCopyTxcd; - private final MappedByteBuffer - againInCnfXorIsStaticXorExpFlagXorCallAbortWontRevertXorAddFlagXorAgainInCnfXorIsDeployment; - private final MappedByteBuffer - againInTxnXorUpdateXorMmuFlagXorCallEoaSuccessCallerWillRevertXorBinFlagXorAgainInTxnXorIsType2; + private final MappedByteBuffer addressHiXorAccountAddressHiXorCcrsStampXorPrcCdoXorStaticGasXorAddressHiXorCallDataSize; + private final MappedByteBuffer addressLoXorAccountAddressLoXorExpData1XorHashInfoKeccakHiXorAddressLoXorCoinbaseAddressLo; + private final MappedByteBuffer againInBlkXorIsRootXorCcsrFlagXorCallAbortWillRevertXorAccFlagXorAgainInBlkXorCopyTxcd; + private final MappedByteBuffer againInCnfXorIsStaticXorExpFlagXorCallAbortWontRevertXorAddFlagXorAgainInCnfXorIsDeployment; + private final MappedByteBuffer againInTxnXorUpdateXorMmuFlagXorCallEoaSuccessCallerWillRevertXorBinFlagXorAgainInTxnXorIsType2; private final MappedByteBuffer alpha; - private final MappedByteBuffer - balanceNewXorCallerAddressLoXorExpData3XorPushValueHiXorStorageKeyLoXorInitialBalance; - private final MappedByteBuffer - balanceXorByteCodeAddressLoXorExpData2XorHashInfoKeccakLoXorStorageKeyHiXorFromAddressLo; + private final MappedByteBuffer balanceNewXorCallerAddressLoXorExpData3XorPushValueHiXorStorageKeyLoXorInitialBalance; + private final MappedByteBuffer balanceXorByteCodeAddressLoXorExpData2XorHashInfoKeccakLoXorStorageKeyHiXorFromAddressLo; private final MappedByteBuffer callDataOffsetXorMmuSize; private final MappedByteBuffer callDataSizeXorMmuSrcId; private final MappedByteBuffer callStackDepthXorStackItemHeight1; private final MappedByteBuffer callerContextNumber; private final MappedByteBuffer codeFragmentIndex; - private final MappedByteBuffer - codeFragmentIndexXorAccountDeploymentNumberXorExpInstXorPrcCallerGasXorDeploymentNumberXorCoinbaseAddressHi; + private final MappedByteBuffer codeFragmentIndexXorAccountDeploymentNumberXorExpInstXorPrcCdsXorDeploymentNumberXorCoinbaseAddressHi; private final MappedByteBuffer codeHashHiNewXorExpData5XorStackItemValueHi1XorValueCurrLoXorValue; - private final MappedByteBuffer - codeHashHiXorCallValueXorExpData4XorPushValueLoXorValueCurrHiXorToAddressLo; + private final MappedByteBuffer codeHashHiXorCallValueXorExpData4XorPushValueLoXorValueCurrHiXorToAddressLo; private final MappedByteBuffer codeHashLoNewXorMmuLimb2XorStackItemValueHi3XorValueNextLo; private final MappedByteBuffer codeHashLoXorMmuLimb1XorStackItemValueHi2XorValueNextHi; - private final MappedByteBuffer - codeSizeNewXorByteCodeCodeFragmentIndexXorMmuExoSumXorPrcCdsXorInitCodeSize; - private final MappedByteBuffer - codeSizeXorByteCodeAddressHiXorMmuAuxIdXorPrcCdoXorDeploymentNumberInftyXorFromAddressHi; + private final MappedByteBuffer codeSizeNewXorByteCodeCodeFragmentIndexXorMmuExoSumXorPrcRaoXorInitCodeSize; + private final MappedByteBuffer codeSizeXorByteCodeAddressHiXorMmuAuxIdXorPrcRacXorDeploymentNumberInftyXorFromAddressHi; private final MappedByteBuffer contextGetsReverted; private final MappedByteBuffer contextMayChange; private final MappedByteBuffer contextNumber; @@ -84,35 +74,22 @@ public class Trace { private final MappedByteBuffer delta; private final MappedByteBuffer deploymentNumberFinalInBlockXorDeploymentNumberFinalInBlock; private final MappedByteBuffer deploymentNumberFirstInBlockXorDeploymentNumberFirstInBlock; - private final MappedByteBuffer - deploymentNumberInftyXorByteCodeDeploymentStatusXorMmuPhaseXorPrcRao; - private final MappedByteBuffer - deploymentNumberNewXorCallerAddressHiXorMmuRefOffsetXorPrcReturnGas; - private final MappedByteBuffer - deploymentNumberXorByteCodeDeploymentNumberXorMmuInstXorPrcRacXorToAddressHi; - private final MappedByteBuffer - deploymentStatusInftyXorMxpDeploysXorCallExceptionXorCallFlagXorFinalInCnfXorStatusCode; - private final MappedByteBuffer - deploymentStatusNewXorMxpFlagXorCallPrcFailureXorConFlagXorFinalInTxn; - private final MappedByteBuffer - deploymentStatusXorMmuSuccessBitXorCallEoaSuccessCallerWontRevertXorBtcFlagXorFinalInBlkXorRequiresEvmExecution; + private final MappedByteBuffer deploymentNumberInftyXorByteCodeDeploymentStatusXorMmuPhase; + private final MappedByteBuffer deploymentNumberNewXorCallerAddressHiXorMmuRefOffset; + private final MappedByteBuffer deploymentNumberXorByteCodeDeploymentNumberXorMmuInstXorToAddressHi; + private final MappedByteBuffer deploymentStatusInftyXorMxpDeploysXorCallExceptionXorCallFlagXorFinalInCnfXorStatusCode; + private final MappedByteBuffer deploymentStatusNewXorMxpFlagXorCallPrcFailureXorConFlagXorFinalInTxn; + private final MappedByteBuffer deploymentStatusXorMmuSuccessBitXorCallEoaSuccessCallerWontRevertXorBtcFlagXorFinalInBlkXorRequiresEvmExecution; private final MappedByteBuffer domStamp; private final MappedByteBuffer exceptionAhoy; - private final MappedByteBuffer - existsNewXorMxpMxpxXorCallPrcSuccessCallerWontRevertXorCreateFlagXorFirstInCnf; - private final MappedByteBuffer - existsXorMxpMtntopXorCallPrcSuccessCallerWillRevertXorCopyFlagXorFirstInBlk; - private final MappedByteBuffer - finalInBlkXorMxpSize1NonzeroNoMxpxXorCallSmcFailureCallerWillRevertXorDecFlag1XorFirstInTxn; - private final MappedByteBuffer - finalInCnfXorMxpSize2NonzeroNoMxpxXorCallSmcFailureCallerWontRevertXorDecFlag2XorValueCurrChanges; - private final MappedByteBuffer - finalInTxnXorOobFlagXorCallSmcSuccessCallerWillRevertXorDecFlag3XorValueCurrIsOrig; - private final MappedByteBuffer - firstInBlkXorStpExistsXorCallSmcSuccessCallerWontRevertXorDecFlag4XorValueCurrIsZero; + private final MappedByteBuffer existsNewXorMxpMxpxXorCallPrcSuccessCallerWontRevertXorCreateFlagXorFirstInCnf; + private final MappedByteBuffer existsXorMxpMtntopXorCallPrcSuccessCallerWillRevertXorCopyFlagXorFirstInBlk; + private final MappedByteBuffer finalInBlkXorMxpSize1NonzeroNoMxpxXorCallSmcFailureCallerWillRevertXorDecFlag1XorFirstInTxn; + private final MappedByteBuffer finalInCnfXorMxpSize2NonzeroNoMxpxXorCallSmcFailureCallerWontRevertXorDecFlag2XorValueCurrChanges; + private final MappedByteBuffer finalInTxnXorOobFlagXorCallSmcSuccessCallerWillRevertXorDecFlag3XorValueCurrIsOrig; + private final MappedByteBuffer firstInBlkXorStpExistsXorCallSmcSuccessCallerWontRevertXorDecFlag4XorValueCurrIsZero; private final MappedByteBuffer firstInCnfXorStpFlagXorCreateAbortXorDupFlagXorValueNextIsCurr; - private final MappedByteBuffer - firstInTxnXorStpOogxXorCreateEmptyInitCodeWillRevertXorExtFlagXorValueNextIsOrig; + private final MappedByteBuffer firstInTxnXorStpOogxXorCreateEmptyInitCodeWillRevertXorExtFlagXorValueNextIsOrig; private final MappedByteBuffer gasActual; private final MappedByteBuffer gasCost; private final MappedByteBuffer gasExpected; @@ -120,8 +97,7 @@ public class Trace { private final MappedByteBuffer gasNext; private final MappedByteBuffer gasPrice; private final MappedByteBuffer hasCodeNewXorCreateExceptionXorHashInfoFlagXorValueOrigIsZero; - private final MappedByteBuffer - hasCodeXorStpWarmthXorCreateEmptyInitCodeWontRevertXorHaltFlagXorValueNextIsZero; + private final MappedByteBuffer hasCodeXorStpWarmthXorCreateEmptyInitCodeWontRevertXorHaltFlagXorValueNextIsZero; private final MappedByteBuffer height; private final MappedByteBuffer heightNew; private final MappedByteBuffer hubStamp; @@ -129,10 +105,8 @@ public class Trace { private final MappedByteBuffer instruction; private final MappedByteBuffer isPrecompileXorCreateFailureConditionWillRevertXorIcpxXorWarmth; private final MappedByteBuffer logInfoStamp; - private final MappedByteBuffer - markedForSelfdestructNewXorCreateNonemptyInitCodeFailureWillRevertXorJumpx; - private final MappedByteBuffer - markedForSelfdestructXorCreateFailureConditionWontRevertXorInvalidFlagXorWarmthNew; + private final MappedByteBuffer markedForSelfdestructNewXorCreateNonemptyInitCodeFailureWillRevertXorJumpx; + private final MappedByteBuffer markedForSelfdestructXorCreateFailureConditionWontRevertXorInvalidFlagXorWarmthNew; private final MappedByteBuffer mmuStamp; private final MappedByteBuffer mxpOffset2Hi; private final MappedByteBuffer mxpOffset2Lo; @@ -144,8 +118,8 @@ public class Trace { private final MappedByteBuffer mxpWords; private final MappedByteBuffer nonStackRows; private final MappedByteBuffer nonce; - private final MappedByteBuffer nonceNewXorStpGasPaidOutOfPocketXorGasInitiallyAvailable; - private final MappedByteBuffer nonceXorStpGasMxpXorBasefee; + private final MappedByteBuffer nonceNewXorStpGasPaidOutOfPocketXorPrcCallerGasXorGasInitiallyAvailable; + private final MappedByteBuffer nonceXorStpGasMxpXorPrcCalleeGasXorBasefee; private final MappedByteBuffer oobData1; private final MappedByteBuffer oobData2; private final MappedByteBuffer oobData3; @@ -194,10 +168,8 @@ public class Trace { private final MappedByteBuffer returnFromMessageCallWillTouchRamXorStackItemPop3; private final MappedByteBuffer returnFromMessageCallWontTouchRamXorStackItemPop4; private final MappedByteBuffer rlpaddrDepAddrHiXorCallDataContextNumberXorMmuRefSize; - private final MappedByteBuffer - rlpaddrDepAddrLoXorMmuSrcOffsetHiXorStackItemValueHi4XorValueOrigHi; - private final MappedByteBuffer - rlpaddrFlagXorCreateNonemptyInitCodeFailureWontRevertXorJumpDestinationVettingRequired; + private final MappedByteBuffer rlpaddrDepAddrLoXorMmuSrcOffsetHiXorStackItemValueHi4XorValueOrigHi; + private final MappedByteBuffer rlpaddrFlagXorCreateNonemptyInitCodeFailureWontRevertXorJumpDestinationVettingRequired; private final MappedByteBuffer rlpaddrKecHiXorMmuSrcOffsetLoXorStackItemValueLo1XorValueOrigLo; private final MappedByteBuffer rlpaddrKecLoXorMmuTgtOffsetLoXorStackItemValueLo2; private final MappedByteBuffer rlpaddrRecipe; @@ -217,7 +189,7 @@ public class Trace { private final MappedByteBuffer stackItemStamp4; private final MappedByteBuffer stpGasHi; private final MappedByteBuffer stpGasLo; - private final MappedByteBuffer stpGasUpfrontGasCostXorGasLeftover; + private final MappedByteBuffer stpGasUpfrontGasCostXorPrcReturnGasXorGasLeftover; private final MappedByteBuffer stpValueHi; private final MappedByteBuffer stpValueLo; private final MappedByteBuffer subStamp; @@ -236,401 +208,198 @@ public class Trace { private final MappedByteBuffer wcpFlag; static List headers(int length) { - List headers = new ArrayList<>(); - headers.add(new ColumnHeader("hub.ABSOLUTE_TRANSACTION_NUMBER", 2, length)); - headers.add( - new ColumnHeader( - "hub.ADDRESS_HI_xor_ACCOUNT_ADDRESS_HI_xor_CCRS_STAMP_xor_PRC_CALLEE_GAS_xor_STATIC_GAS_xor_ADDRESS_HI_xor_CALL_DATA_SIZE", - 4, - length)); - headers.add( - new ColumnHeader( - "hub.ADDRESS_LO_xor_ACCOUNT_ADDRESS_LO_xor_EXP_DATA_1_xor_HASH_INFO_KECCAK_HI_xor_ADDRESS_LO_xor_COINBASE_ADDRESS_LO", - 16, - length)); - headers.add( - new ColumnHeader( - "hub.AGAIN_IN_BLK_xor_IS_ROOT_xor_CCSR_FLAG_xor_CALL_ABORT_WILL_REVERT_xor_ACC_FLAG_xor_AGAIN_IN_BLK_xor_COPY_TXCD", - 1, - length)); - headers.add( - new ColumnHeader( - "hub.AGAIN_IN_CNF_xor_IS_STATIC_xor_EXP_FLAG_xor_CALL_ABORT_WONT_REVERT_xor_ADD_FLAG_xor_AGAIN_IN_CNF_xor_IS_DEPLOYMENT", - 1, - length)); - headers.add( - new ColumnHeader( - "hub.AGAIN_IN_TXN_xor_UPDATE_xor_MMU_FLAG_xor_CALL_EOA_SUCCESS_CALLER_WILL_REVERT_xor_BIN_FLAG_xor_AGAIN_IN_TXN_xor_IS_TYPE2", - 1, - length)); - headers.add(new ColumnHeader("hub.ALPHA", 1, length)); - headers.add( - new ColumnHeader( - "hub.BALANCE_NEW_xor_CALLER_ADDRESS_LO_xor_EXP_DATA_3_xor_PUSH_VALUE_HI_xor_STORAGE_KEY_LO_xor_INITIAL_BALANCE", - 16, - length)); - headers.add( - new ColumnHeader( - "hub.BALANCE_xor_BYTE_CODE_ADDRESS_LO_xor_EXP_DATA_2_xor_HASH_INFO_KECCAK_LO_xor_STORAGE_KEY_HI_xor_FROM_ADDRESS_LO", - 16, - length)); - headers.add(new ColumnHeader("hub.CALL_DATA_OFFSET_xor_MMU_SIZE", 4, length)); - headers.add(new ColumnHeader("hub.CALL_DATA_SIZE_xor_MMU_SRC_ID", 4, length)); - headers.add(new ColumnHeader("hub.CALL_STACK_DEPTH_xor_STACK_ITEM_HEIGHT_1", 2, length)); - headers.add(new ColumnHeader("hub.CALLER_CONTEXT_NUMBER", 4, length)); - headers.add(new ColumnHeader("hub.CODE_FRAGMENT_INDEX", 4, length)); - headers.add( - new ColumnHeader( - "hub.CODE_FRAGMENT_INDEX_xor_ACCOUNT_DEPLOYMENT_NUMBER_xor_EXP_INST_xor_PRC_CALLER_GAS_xor_DEPLOYMENT_NUMBER_xor_COINBASE_ADDRESS_HI", - 4, - length)); - headers.add( - new ColumnHeader( - "hub.CODE_HASH_HI_NEW_xor_EXP_DATA_5_xor_STACK_ITEM_VALUE_HI_1_xor_VALUE_CURR_LO_xor_VALUE", - 16, - length)); - headers.add( - new ColumnHeader( - "hub.CODE_HASH_HI_xor_CALL_VALUE_xor_EXP_DATA_4_xor_PUSH_VALUE_LO_xor_VALUE_CURR_HI_xor_TO_ADDRESS_LO", - 16, - length)); - headers.add( - new ColumnHeader( - "hub.CODE_HASH_LO_NEW_xor_MMU_LIMB_2_xor_STACK_ITEM_VALUE_HI_3_xor_VALUE_NEXT_LO", - 16, - length)); - headers.add( - new ColumnHeader( - "hub.CODE_HASH_LO_xor_MMU_LIMB_1_xor_STACK_ITEM_VALUE_HI_2_xor_VALUE_NEXT_HI", - 16, - length)); - headers.add( - new ColumnHeader( - "hub.CODE_SIZE_NEW_xor_BYTE_CODE_CODE_FRAGMENT_INDEX_xor_MMU_EXO_SUM_xor_PRC_CDS_xor_INIT_CODE_SIZE", - 4, - length)); - headers.add( - new ColumnHeader( - "hub.CODE_SIZE_xor_BYTE_CODE_ADDRESS_HI_xor_MMU_AUX_ID_xor_PRC_CDO_xor_DEPLOYMENT_NUMBER_INFTY_xor_FROM_ADDRESS_HI", - 4, - length)); - headers.add(new ColumnHeader("hub.CONTEXT_GETS_REVERTED", 1, length)); - headers.add(new ColumnHeader("hub.CONTEXT_MAY_CHANGE", 1, length)); - headers.add(new ColumnHeader("hub.CONTEXT_NUMBER", 4, length)); - headers.add(new ColumnHeader("hub.CONTEXT_NUMBER_NEW", 4, length)); - headers.add(new ColumnHeader("hub.CONTEXT_NUMBER_xor_MMU_TGT_ID", 4, length)); - headers.add(new ColumnHeader("hub.CONTEXT_REVERT_STAMP", 4, length)); - headers.add(new ColumnHeader("hub.CONTEXT_SELF_REVERTS", 1, length)); - headers.add(new ColumnHeader("hub.CONTEXT_WILL_REVERT", 1, length)); - headers.add(new ColumnHeader("hub.COUNTER_NSR", 1, length)); - headers.add(new ColumnHeader("hub.COUNTER_TLI", 1, length)); - headers.add(new ColumnHeader("hub.DELTA", 1, length)); - headers.add( - new ColumnHeader( - "hub.DEPLOYMENT_NUMBER_FINAL_IN_BLOCK_xor_DEPLOYMENT_NUMBER_FINAL_IN_BLOCK", - 2, - length)); - headers.add( - new ColumnHeader( - "hub.DEPLOYMENT_NUMBER_FIRST_IN_BLOCK_xor_DEPLOYMENT_NUMBER_FIRST_IN_BLOCK", - 2, - length)); - headers.add( - new ColumnHeader( - "hub.DEPLOYMENT_NUMBER_INFTY_xor_BYTE_CODE_DEPLOYMENT_STATUS_xor_MMU_PHASE_xor_PRC_RAO", - 4, - length)); - headers.add( - new ColumnHeader( - "hub.DEPLOYMENT_NUMBER_NEW_xor_CALLER_ADDRESS_HI_xor_MMU_REF_OFFSET_xor_PRC_RETURN_GAS", - 4, - length)); - headers.add( - new ColumnHeader( - "hub.DEPLOYMENT_NUMBER_xor_BYTE_CODE_DEPLOYMENT_NUMBER_xor_MMU_INST_xor_PRC_RAC_xor_TO_ADDRESS_HI", - 4, - length)); - headers.add( - new ColumnHeader( - "hub.DEPLOYMENT_STATUS_INFTY_xor_MXP_DEPLOYS_xor_CALL_EXCEPTION_xor_CALL_FLAG_xor_FINAL_IN_CNF_xor_STATUS_CODE", - 1, - length)); - headers.add( - new ColumnHeader( - "hub.DEPLOYMENT_STATUS_NEW_xor_MXP_FLAG_xor_CALL_PRC_FAILURE_xor_CON_FLAG_xor_FINAL_IN_TXN", - 1, - length)); - headers.add( - new ColumnHeader( - "hub.DEPLOYMENT_STATUS_xor_MMU_SUCCESS_BIT_xor_CALL_EOA_SUCCESS_CALLER_WONT_REVERT_xor_BTC_FLAG_xor_FINAL_IN_BLK_xor_REQUIRES_EVM_EXECUTION", - 1, - length)); - headers.add(new ColumnHeader("hub.DOM_STAMP", 4, length)); - headers.add(new ColumnHeader("hub.EXCEPTION_AHOY", 1, length)); - headers.add( - new ColumnHeader( - "hub.EXISTS_NEW_xor_MXP_MXPX_xor_CALL_PRC_SUCCESS_CALLER_WONT_REVERT_xor_CREATE_FLAG_xor_FIRST_IN_CNF", - 1, - length)); - headers.add( - new ColumnHeader( - "hub.EXISTS_xor_MXP_MTNTOP_xor_CALL_PRC_SUCCESS_CALLER_WILL_REVERT_xor_COPY_FLAG_xor_FIRST_IN_BLK", - 1, - length)); - headers.add( - new ColumnHeader( - "hub.FINAL_IN_BLK_xor_MXP_SIZE_1_NONZERO_NO_MXPX_xor_CALL_SMC_FAILURE_CALLER_WILL_REVERT_xor_DEC_FLAG_1_xor_FIRST_IN_TXN", - 1, - length)); - headers.add( - new ColumnHeader( - "hub.FINAL_IN_CNF_xor_MXP_SIZE_2_NONZERO_NO_MXPX_xor_CALL_SMC_FAILURE_CALLER_WONT_REVERT_xor_DEC_FLAG_2_xor_VALUE_CURR_CHANGES", - 1, - length)); - headers.add( - new ColumnHeader( - "hub.FINAL_IN_TXN_xor_OOB_FLAG_xor_CALL_SMC_SUCCESS_CALLER_WILL_REVERT_xor_DEC_FLAG_3_xor_VALUE_CURR_IS_ORIG", - 1, - length)); - headers.add( - new ColumnHeader( - "hub.FIRST_IN_BLK_xor_STP_EXISTS_xor_CALL_SMC_SUCCESS_CALLER_WONT_REVERT_xor_DEC_FLAG_4_xor_VALUE_CURR_IS_ZERO", - 1, - length)); - headers.add( - new ColumnHeader( - "hub.FIRST_IN_CNF_xor_STP_FLAG_xor_CREATE_ABORT_xor_DUP_FLAG_xor_VALUE_NEXT_IS_CURR", - 1, - length)); - headers.add( - new ColumnHeader( - "hub.FIRST_IN_TXN_xor_STP_OOGX_xor_CREATE_EMPTY_INIT_CODE_WILL_REVERT_xor_EXT_FLAG_xor_VALUE_NEXT_IS_ORIG", - 1, - length)); - headers.add(new ColumnHeader("hub.GAS_ACTUAL", 8, length)); - headers.add(new ColumnHeader("hub.GAS_COST", 8, length)); - headers.add(new ColumnHeader("hub.GAS_EXPECTED", 8, length)); - headers.add(new ColumnHeader("hub.GAS_LIMIT", 8, length)); - headers.add(new ColumnHeader("hub.GAS_NEXT", 8, length)); - headers.add(new ColumnHeader("hub.GAS_PRICE", 8, length)); - headers.add( - new ColumnHeader( - "hub.HAS_CODE_NEW_xor_CREATE_EXCEPTION_xor_HASH_INFO_FLAG_xor_VALUE_ORIG_IS_ZERO", - 1, - length)); - headers.add( - new ColumnHeader( - "hub.HAS_CODE_xor_STP_WARMTH_xor_CREATE_EMPTY_INIT_CODE_WONT_REVERT_xor_HALT_FLAG_xor_VALUE_NEXT_IS_ZERO", - 1, - length)); - headers.add(new ColumnHeader("hub.HEIGHT", 2, length)); - headers.add(new ColumnHeader("hub.HEIGHT_NEW", 2, length)); - headers.add(new ColumnHeader("hub.HUB_STAMP", 4, length)); - headers.add(new ColumnHeader("hub.HUB_STAMP_TRANSACTION_END", 4, length)); - headers.add(new ColumnHeader("hub.INSTRUCTION", 32, length)); - headers.add( - new ColumnHeader( - "hub.IS_PRECOMPILE_xor_CREATE_FAILURE_CONDITION_WILL_REVERT_xor_ICPX_xor_WARMTH", - 1, - length)); - headers.add(new ColumnHeader("hub.LOG_INFO_STAMP", 4, length)); - headers.add( - new ColumnHeader( - "hub.MARKED_FOR_SELFDESTRUCT_NEW_xor_CREATE_NONEMPTY_INIT_CODE_FAILURE_WILL_REVERT_xor_JUMPX", - 1, - length)); - headers.add( - new ColumnHeader( - "hub.MARKED_FOR_SELFDESTRUCT_xor_CREATE_FAILURE_CONDITION_WONT_REVERT_xor_INVALID_FLAG_xor_WARMTH_NEW", - 1, - length)); - headers.add(new ColumnHeader("hub.MMU_STAMP", 4, length)); - headers.add(new ColumnHeader("hub.MXP_OFFSET_2_HI", 16, length)); - headers.add(new ColumnHeader("hub.MXP_OFFSET_2_LO", 16, length)); - headers.add(new ColumnHeader("hub.MXP_SIZE_1_HI", 16, length)); - headers.add(new ColumnHeader("hub.MXP_SIZE_1_LO", 16, length)); - headers.add(new ColumnHeader("hub.MXP_SIZE_2_HI", 16, length)); - headers.add(new ColumnHeader("hub.MXP_SIZE_2_LO", 16, length)); - headers.add(new ColumnHeader("hub.MXP_STAMP", 4, length)); - headers.add(new ColumnHeader("hub.MXP_WORDS", 16, length)); - headers.add(new ColumnHeader("hub.NON_STACK_ROWS", 1, length)); - headers.add(new ColumnHeader("hub.NONCE", 8, length)); - headers.add( - new ColumnHeader( - "hub.NONCE_NEW_xor_STP_GAS_PAID_OUT_OF_POCKET_xor_GAS_INITIALLY_AVAILABLE", 8, length)); - headers.add(new ColumnHeader("hub.NONCE_xor_STP_GAS_MXP_xor_BASEFEE", 8, length)); - headers.add(new ColumnHeader("hub.OOB_DATA_1", 16, length)); - headers.add(new ColumnHeader("hub.OOB_DATA_2", 16, length)); - headers.add(new ColumnHeader("hub.OOB_DATA_3", 16, length)); - headers.add(new ColumnHeader("hub.OOB_DATA_4", 16, length)); - headers.add(new ColumnHeader("hub.OOB_DATA_5", 16, length)); - headers.add(new ColumnHeader("hub.OOB_DATA_6", 16, length)); - headers.add(new ColumnHeader("hub.OOB_DATA_7", 16, length)); - headers.add(new ColumnHeader("hub.OOB_DATA_8", 16, length)); - headers.add(new ColumnHeader("hub.OOB_DATA_9", 16, length)); - headers.add(new ColumnHeader("hub.PEEK_AT_ACCOUNT", 1, length)); - headers.add(new ColumnHeader("hub.PEEK_AT_CONTEXT", 1, length)); - headers.add(new ColumnHeader("hub.PEEK_AT_MISCELLANEOUS", 1, length)); - headers.add(new ColumnHeader("hub.PEEK_AT_SCENARIO", 1, length)); - headers.add(new ColumnHeader("hub.PEEK_AT_STACK", 1, length)); - headers.add(new ColumnHeader("hub.PEEK_AT_STORAGE", 1, length)); - headers.add(new ColumnHeader("hub.PEEK_AT_TRANSACTION", 1, length)); - headers.add(new ColumnHeader("hub.PRC_ECMUL_xor_MACHINE_STATE_FLAG", 1, length)); - headers.add(new ColumnHeader("hub.PRC_ECPAIRING_xor_MAXCSX", 1, length)); - headers.add(new ColumnHeader("hub.PRC_ECRECOVER_xor_MOD_FLAG", 1, length)); - headers.add(new ColumnHeader("hub.PRC_FAILURE_KNOWN_TO_HUB_xor_MUL_FLAG", 1, length)); - headers.add(new ColumnHeader("hub.PRC_FAILURE_KNOWN_TO_RAM_xor_MXPX", 1, length)); - headers.add(new ColumnHeader("hub.PRC_IDENTITY_xor_MXP_FLAG", 1, length)); - headers.add(new ColumnHeader("hub.PRC_MODEXP_xor_OOGX", 1, length)); - headers.add(new ColumnHeader("hub.PRC_RIPEMD-160_xor_OPCX", 1, length)); - headers.add(new ColumnHeader("hub.PRC_SHA2-256_xor_PUSHPOP_FLAG", 1, length)); - headers.add(new ColumnHeader("hub.PRC_SUCCESS_CALLER_WILL_REVERT_xor_RDCX", 1, length)); - headers.add(new ColumnHeader("hub.PRC_SUCCESS_CALLER_WONT_REVERT_xor_SHF_FLAG", 1, length)); - headers.add(new ColumnHeader("hub.PRIORITY_FEE_PER_GAS", 8, length)); - headers.add(new ColumnHeader("hub.PROGRAM_COUNTER", 4, length)); - headers.add(new ColumnHeader("hub.PROGRAM_COUNTER_NEW", 4, length)); - headers.add(new ColumnHeader("hub.REFUND_COUNTER", 4, length)); - headers.add(new ColumnHeader("hub.REFUND_COUNTER_INFINITY", 8, length)); - headers.add(new ColumnHeader("hub.REFUND_COUNTER_NEW", 4, length)); - headers.add(new ColumnHeader("hub.REFUND_EFFECTIVE", 8, length)); - headers.add(new ColumnHeader("hub.RELATIVE_BLOCK_NUMBER", 2, length)); - headers.add(new ColumnHeader("hub.RETURN_AT_CAPACITY_xor_MXP_INST", 4, length)); - headers.add(new ColumnHeader("hub.RETURN_AT_OFFSET_xor_OOB_INST", 4, length)); - headers.add(new ColumnHeader("hub.RETURN_DATA_CONTEXT_NUMBER_xor_STP_GAS_STIPEND", 4, length)); - headers.add(new ColumnHeader("hub.RETURN_DATA_OFFSET_xor_STP_INSTRUCTION", 4, length)); - headers.add(new ColumnHeader("hub.RETURN_DATA_SIZE", 4, length)); - headers.add(new ColumnHeader("hub.RETURN_EXCEPTION_xor_SOX", 1, length)); - headers.add( - new ColumnHeader( - "hub.RETURN_FROM_DEPLOYMENT_EMPTY_CODE_WILL_REVERT_xor_SSTOREX", 1, length)); - headers.add( - new ColumnHeader( - "hub.RETURN_FROM_DEPLOYMENT_EMPTY_CODE_WONT_REVERT_xor_STACKRAM_FLAG", 1, length)); - headers.add( - new ColumnHeader( - "hub.RETURN_FROM_DEPLOYMENT_NONEMPTY_CODE_WILL_REVERT_xor_STACK_ITEM_POP_1", - 1, - length)); - headers.add( - new ColumnHeader( - "hub.RETURN_FROM_DEPLOYMENT_NONEMPTY_CODE_WONT_REVERT_xor_STACK_ITEM_POP_2", - 1, - length)); - headers.add( - new ColumnHeader( - "hub.RETURN_FROM_MESSAGE_CALL_WILL_TOUCH_RAM_xor_STACK_ITEM_POP_3", 1, length)); - headers.add( - new ColumnHeader( - "hub.RETURN_FROM_MESSAGE_CALL_WONT_TOUCH_RAM_xor_STACK_ITEM_POP_4", 1, length)); - headers.add( - new ColumnHeader( - "hub.RLPADDR_DEP_ADDR_HI_xor_CALL_DATA_CONTEXT_NUMBER_xor_MMU_REF_SIZE", 4, length)); - headers.add( - new ColumnHeader( - "hub.RLPADDR_DEP_ADDR_LO_xor_MMU_SRC_OFFSET_HI_xor_STACK_ITEM_VALUE_HI_4_xor_VALUE_ORIG_HI", - 16, - length)); - headers.add( - new ColumnHeader( - "hub.RLPADDR_FLAG_xor_CREATE_NONEMPTY_INIT_CODE_FAILURE_WONT_REVERT_xor_JUMP_DESTINATION_VETTING_REQUIRED", - 1, - length)); - headers.add( - new ColumnHeader( - "hub.RLPADDR_KEC_HI_xor_MMU_SRC_OFFSET_LO_xor_STACK_ITEM_VALUE_LO_1_xor_VALUE_ORIG_LO", - 16, - length)); - headers.add( - new ColumnHeader( - "hub.RLPADDR_KEC_LO_xor_MMU_TGT_OFFSET_LO_xor_STACK_ITEM_VALUE_LO_2", 16, length)); - headers.add(new ColumnHeader("hub.RLPADDR_RECIPE", 1, length)); - headers.add( - new ColumnHeader( - "hub.RLPADDR_SALT_HI_xor_MXP_GAS_MXP_xor_STACK_ITEM_VALUE_LO_3", 16, length)); - headers.add( - new ColumnHeader( - "hub.RLPADDR_SALT_LO_xor_MXP_OFFSET_1_HI_xor_STACK_ITEM_VALUE_LO_4", 16, length)); - headers.add( - new ColumnHeader( - "hub.ROMLEX_FLAG_xor_CREATE_NONEMPTY_INIT_CODE_SUCCESS_WILL_REVERT_xor_JUMP_FLAG", - 1, - length)); - headers.add(new ColumnHeader("hub.SELFDESTRUCT_EXCEPTION_xor_STATICX", 1, length)); - headers.add(new ColumnHeader("hub.SELFDESTRUCT_WILL_REVERT_xor_STATIC_FLAG", 1, length)); - headers.add( - new ColumnHeader("hub.SELFDESTRUCT_WONT_REVERT_ALREADY_MARKED_xor_STO_FLAG", 1, length)); - headers.add(new ColumnHeader("hub.SELFDESTRUCT_WONT_REVERT_NOT_YET_MARKED_xor_SUX", 1, length)); - headers.add(new ColumnHeader("hub.STACK_ITEM_HEIGHT_2", 2, length)); - headers.add(new ColumnHeader("hub.STACK_ITEM_HEIGHT_3", 2, length)); - headers.add(new ColumnHeader("hub.STACK_ITEM_HEIGHT_4", 2, length)); - headers.add(new ColumnHeader("hub.STACK_ITEM_STAMP_1", 5, length)); - headers.add(new ColumnHeader("hub.STACK_ITEM_STAMP_2", 5, length)); - headers.add(new ColumnHeader("hub.STACK_ITEM_STAMP_3", 5, length)); - headers.add(new ColumnHeader("hub.STACK_ITEM_STAMP_4", 5, length)); - headers.add(new ColumnHeader("hub.STP_GAS_HI", 16, length)); - headers.add(new ColumnHeader("hub.STP_GAS_LO", 16, length)); - headers.add(new ColumnHeader("hub.STP_GAS_UPFRONT_GAS_COST_xor_GAS_LEFTOVER", 8, length)); - headers.add(new ColumnHeader("hub.STP_VALUE_HI", 16, length)); - headers.add(new ColumnHeader("hub.STP_VALUE_LO", 16, length)); - headers.add(new ColumnHeader("hub.SUB_STAMP", 4, length)); - headers.add(new ColumnHeader("hub.SWAP_FLAG", 1, length)); - headers.add( - new ColumnHeader( - "hub.TRM_FLAG_xor_CREATE_NONEMPTY_INIT_CODE_SUCCESS_WONT_REVERT_xor_KEC_FLAG", - 1, - length)); - headers.add(new ColumnHeader("hub.TRM_RAW_ADDRESS_HI_xor_MXP_OFFSET_1_LO", 16, length)); - headers.add(new ColumnHeader("hub.TWO_LINE_INSTRUCTION", 1, length)); - headers.add(new ColumnHeader("hub.TX_EXEC", 1, length)); - headers.add(new ColumnHeader("hub.TX_FINL", 1, length)); - headers.add(new ColumnHeader("hub.TX_INIT", 1, length)); - headers.add(new ColumnHeader("hub.TX_SKIP", 1, length)); - headers.add(new ColumnHeader("hub.TX_WARM", 1, length)); - headers.add(new ColumnHeader("hub.TXN_FLAG", 1, length)); - headers.add(new ColumnHeader("hub.WARMTH_NEW_xor_PRC_ECADD_xor_LOG_INFO_FLAG", 1, length)); - headers.add(new ColumnHeader("hub.WARMTH_xor_PRC_BLAKE2f_xor_LOG_FLAG", 1, length)); - headers.add(new ColumnHeader("hub.WCP_FLAG", 1, length)); - return headers; - } - - public Trace(List buffers) { + List headers = new ArrayList<>(); + headers.add(new ColumnHeader("hub.ABSOLUTE_TRANSACTION_NUMBER", 2, length)); + headers.add(new ColumnHeader("hub.ADDRESS_HI_xor_ACCOUNT_ADDRESS_HI_xor_CCRS_STAMP_xor_PRC_CDO_xor_STATIC_GAS_xor_ADDRESS_HI_xor_CALL_DATA_SIZE", 4, length)); + headers.add(new ColumnHeader("hub.ADDRESS_LO_xor_ACCOUNT_ADDRESS_LO_xor_EXP_DATA_1_xor_HASH_INFO_KECCAK_HI_xor_ADDRESS_LO_xor_COINBASE_ADDRESS_LO", 16, length)); + headers.add(new ColumnHeader("hub.AGAIN_IN_BLK_xor_IS_ROOT_xor_CCSR_FLAG_xor_CALL_ABORT_WILL_REVERT_xor_ACC_FLAG_xor_AGAIN_IN_BLK_xor_COPY_TXCD", 1, length)); + headers.add(new ColumnHeader("hub.AGAIN_IN_CNF_xor_IS_STATIC_xor_EXP_FLAG_xor_CALL_ABORT_WONT_REVERT_xor_ADD_FLAG_xor_AGAIN_IN_CNF_xor_IS_DEPLOYMENT", 1, length)); + headers.add(new ColumnHeader("hub.AGAIN_IN_TXN_xor_UPDATE_xor_MMU_FLAG_xor_CALL_EOA_SUCCESS_CALLER_WILL_REVERT_xor_BIN_FLAG_xor_AGAIN_IN_TXN_xor_IS_TYPE2", 1, length)); + headers.add(new ColumnHeader("hub.ALPHA", 1, length)); + headers.add(new ColumnHeader("hub.BALANCE_NEW_xor_CALLER_ADDRESS_LO_xor_EXP_DATA_3_xor_PUSH_VALUE_HI_xor_STORAGE_KEY_LO_xor_INITIAL_BALANCE", 16, length)); + headers.add(new ColumnHeader("hub.BALANCE_xor_BYTE_CODE_ADDRESS_LO_xor_EXP_DATA_2_xor_HASH_INFO_KECCAK_LO_xor_STORAGE_KEY_HI_xor_FROM_ADDRESS_LO", 16, length)); + headers.add(new ColumnHeader("hub.CALL_DATA_OFFSET_xor_MMU_SIZE", 4, length)); + headers.add(new ColumnHeader("hub.CALL_DATA_SIZE_xor_MMU_SRC_ID", 4, length)); + headers.add(new ColumnHeader("hub.CALL_STACK_DEPTH_xor_STACK_ITEM_HEIGHT_1", 2, length)); + headers.add(new ColumnHeader("hub.CALLER_CONTEXT_NUMBER", 4, length)); + headers.add(new ColumnHeader("hub.CODE_FRAGMENT_INDEX", 4, length)); + headers.add(new ColumnHeader("hub.CODE_FRAGMENT_INDEX_xor_ACCOUNT_DEPLOYMENT_NUMBER_xor_EXP_INST_xor_PRC_CDS_xor_DEPLOYMENT_NUMBER_xor_COINBASE_ADDRESS_HI", 4, length)); + headers.add(new ColumnHeader("hub.CODE_HASH_HI_NEW_xor_EXP_DATA_5_xor_STACK_ITEM_VALUE_HI_1_xor_VALUE_CURR_LO_xor_VALUE", 16, length)); + headers.add(new ColumnHeader("hub.CODE_HASH_HI_xor_CALL_VALUE_xor_EXP_DATA_4_xor_PUSH_VALUE_LO_xor_VALUE_CURR_HI_xor_TO_ADDRESS_LO", 16, length)); + headers.add(new ColumnHeader("hub.CODE_HASH_LO_NEW_xor_MMU_LIMB_2_xor_STACK_ITEM_VALUE_HI_3_xor_VALUE_NEXT_LO", 16, length)); + headers.add(new ColumnHeader("hub.CODE_HASH_LO_xor_MMU_LIMB_1_xor_STACK_ITEM_VALUE_HI_2_xor_VALUE_NEXT_HI", 16, length)); + headers.add(new ColumnHeader("hub.CODE_SIZE_NEW_xor_BYTE_CODE_CODE_FRAGMENT_INDEX_xor_MMU_EXO_SUM_xor_PRC_RAO_xor_INIT_CODE_SIZE", 4, length)); + headers.add(new ColumnHeader("hub.CODE_SIZE_xor_BYTE_CODE_ADDRESS_HI_xor_MMU_AUX_ID_xor_PRC_RAC_xor_DEPLOYMENT_NUMBER_INFTY_xor_FROM_ADDRESS_HI", 4, length)); + headers.add(new ColumnHeader("hub.CONTEXT_GETS_REVERTED", 1, length)); + headers.add(new ColumnHeader("hub.CONTEXT_MAY_CHANGE", 1, length)); + headers.add(new ColumnHeader("hub.CONTEXT_NUMBER", 4, length)); + headers.add(new ColumnHeader("hub.CONTEXT_NUMBER_NEW", 4, length)); + headers.add(new ColumnHeader("hub.CONTEXT_NUMBER_xor_MMU_TGT_ID", 4, length)); + headers.add(new ColumnHeader("hub.CONTEXT_REVERT_STAMP", 4, length)); + headers.add(new ColumnHeader("hub.CONTEXT_SELF_REVERTS", 1, length)); + headers.add(new ColumnHeader("hub.CONTEXT_WILL_REVERT", 1, length)); + headers.add(new ColumnHeader("hub.COUNTER_NSR", 1, length)); + headers.add(new ColumnHeader("hub.COUNTER_TLI", 1, length)); + headers.add(new ColumnHeader("hub.DELTA", 1, length)); + headers.add(new ColumnHeader("hub.DEPLOYMENT_NUMBER_FINAL_IN_BLOCK_xor_DEPLOYMENT_NUMBER_FINAL_IN_BLOCK", 2, length)); + headers.add(new ColumnHeader("hub.DEPLOYMENT_NUMBER_FIRST_IN_BLOCK_xor_DEPLOYMENT_NUMBER_FIRST_IN_BLOCK", 2, length)); + headers.add(new ColumnHeader("hub.DEPLOYMENT_NUMBER_INFTY_xor_BYTE_CODE_DEPLOYMENT_STATUS_xor_MMU_PHASE", 4, length)); + headers.add(new ColumnHeader("hub.DEPLOYMENT_NUMBER_NEW_xor_CALLER_ADDRESS_HI_xor_MMU_REF_OFFSET", 4, length)); + headers.add(new ColumnHeader("hub.DEPLOYMENT_NUMBER_xor_BYTE_CODE_DEPLOYMENT_NUMBER_xor_MMU_INST_xor_TO_ADDRESS_HI", 4, length)); + headers.add(new ColumnHeader("hub.DEPLOYMENT_STATUS_INFTY_xor_MXP_DEPLOYS_xor_CALL_EXCEPTION_xor_CALL_FLAG_xor_FINAL_IN_CNF_xor_STATUS_CODE", 1, length)); + headers.add(new ColumnHeader("hub.DEPLOYMENT_STATUS_NEW_xor_MXP_FLAG_xor_CALL_PRC_FAILURE_xor_CON_FLAG_xor_FINAL_IN_TXN", 1, length)); + headers.add(new ColumnHeader("hub.DEPLOYMENT_STATUS_xor_MMU_SUCCESS_BIT_xor_CALL_EOA_SUCCESS_CALLER_WONT_REVERT_xor_BTC_FLAG_xor_FINAL_IN_BLK_xor_REQUIRES_EVM_EXECUTION", 1, length)); + headers.add(new ColumnHeader("hub.DOM_STAMP", 4, length)); + headers.add(new ColumnHeader("hub.EXCEPTION_AHOY", 1, length)); + headers.add(new ColumnHeader("hub.EXISTS_NEW_xor_MXP_MXPX_xor_CALL_PRC_SUCCESS_CALLER_WONT_REVERT_xor_CREATE_FLAG_xor_FIRST_IN_CNF", 1, length)); + headers.add(new ColumnHeader("hub.EXISTS_xor_MXP_MTNTOP_xor_CALL_PRC_SUCCESS_CALLER_WILL_REVERT_xor_COPY_FLAG_xor_FIRST_IN_BLK", 1, length)); + headers.add(new ColumnHeader("hub.FINAL_IN_BLK_xor_MXP_SIZE_1_NONZERO_NO_MXPX_xor_CALL_SMC_FAILURE_CALLER_WILL_REVERT_xor_DEC_FLAG_1_xor_FIRST_IN_TXN", 1, length)); + headers.add(new ColumnHeader("hub.FINAL_IN_CNF_xor_MXP_SIZE_2_NONZERO_NO_MXPX_xor_CALL_SMC_FAILURE_CALLER_WONT_REVERT_xor_DEC_FLAG_2_xor_VALUE_CURR_CHANGES", 1, length)); + headers.add(new ColumnHeader("hub.FINAL_IN_TXN_xor_OOB_FLAG_xor_CALL_SMC_SUCCESS_CALLER_WILL_REVERT_xor_DEC_FLAG_3_xor_VALUE_CURR_IS_ORIG", 1, length)); + headers.add(new ColumnHeader("hub.FIRST_IN_BLK_xor_STP_EXISTS_xor_CALL_SMC_SUCCESS_CALLER_WONT_REVERT_xor_DEC_FLAG_4_xor_VALUE_CURR_IS_ZERO", 1, length)); + headers.add(new ColumnHeader("hub.FIRST_IN_CNF_xor_STP_FLAG_xor_CREATE_ABORT_xor_DUP_FLAG_xor_VALUE_NEXT_IS_CURR", 1, length)); + headers.add(new ColumnHeader("hub.FIRST_IN_TXN_xor_STP_OOGX_xor_CREATE_EMPTY_INIT_CODE_WILL_REVERT_xor_EXT_FLAG_xor_VALUE_NEXT_IS_ORIG", 1, length)); + headers.add(new ColumnHeader("hub.GAS_ACTUAL", 8, length)); + headers.add(new ColumnHeader("hub.GAS_COST", 8, length)); + headers.add(new ColumnHeader("hub.GAS_EXPECTED", 8, length)); + headers.add(new ColumnHeader("hub.GAS_LIMIT", 8, length)); + headers.add(new ColumnHeader("hub.GAS_NEXT", 8, length)); + headers.add(new ColumnHeader("hub.GAS_PRICE", 8, length)); + headers.add(new ColumnHeader("hub.HAS_CODE_NEW_xor_CREATE_EXCEPTION_xor_HASH_INFO_FLAG_xor_VALUE_ORIG_IS_ZERO", 1, length)); + headers.add(new ColumnHeader("hub.HAS_CODE_xor_STP_WARMTH_xor_CREATE_EMPTY_INIT_CODE_WONT_REVERT_xor_HALT_FLAG_xor_VALUE_NEXT_IS_ZERO", 1, length)); + headers.add(new ColumnHeader("hub.HEIGHT", 2, length)); + headers.add(new ColumnHeader("hub.HEIGHT_NEW", 2, length)); + headers.add(new ColumnHeader("hub.HUB_STAMP", 4, length)); + headers.add(new ColumnHeader("hub.HUB_STAMP_TRANSACTION_END", 4, length)); + headers.add(new ColumnHeader("hub.INSTRUCTION", 32, length)); + headers.add(new ColumnHeader("hub.IS_PRECOMPILE_xor_CREATE_FAILURE_CONDITION_WILL_REVERT_xor_ICPX_xor_WARMTH", 1, length)); + headers.add(new ColumnHeader("hub.LOG_INFO_STAMP", 4, length)); + headers.add(new ColumnHeader("hub.MARKED_FOR_SELFDESTRUCT_NEW_xor_CREATE_NONEMPTY_INIT_CODE_FAILURE_WILL_REVERT_xor_JUMPX", 1, length)); + headers.add(new ColumnHeader("hub.MARKED_FOR_SELFDESTRUCT_xor_CREATE_FAILURE_CONDITION_WONT_REVERT_xor_INVALID_FLAG_xor_WARMTH_NEW", 1, length)); + headers.add(new ColumnHeader("hub.MMU_STAMP", 4, length)); + headers.add(new ColumnHeader("hub.MXP_OFFSET_2_HI", 16, length)); + headers.add(new ColumnHeader("hub.MXP_OFFSET_2_LO", 16, length)); + headers.add(new ColumnHeader("hub.MXP_SIZE_1_HI", 16, length)); + headers.add(new ColumnHeader("hub.MXP_SIZE_1_LO", 16, length)); + headers.add(new ColumnHeader("hub.MXP_SIZE_2_HI", 16, length)); + headers.add(new ColumnHeader("hub.MXP_SIZE_2_LO", 16, length)); + headers.add(new ColumnHeader("hub.MXP_STAMP", 4, length)); + headers.add(new ColumnHeader("hub.MXP_WORDS", 16, length)); + headers.add(new ColumnHeader("hub.NON_STACK_ROWS", 1, length)); + headers.add(new ColumnHeader("hub.NONCE", 8, length)); + headers.add(new ColumnHeader("hub.NONCE_NEW_xor_STP_GAS_PAID_OUT_OF_POCKET_xor_PRC_CALLER_GAS_xor_GAS_INITIALLY_AVAILABLE", 8, length)); + headers.add(new ColumnHeader("hub.NONCE_xor_STP_GAS_MXP_xor_PRC_CALLEE_GAS_xor_BASEFEE", 8, length)); + headers.add(new ColumnHeader("hub.OOB_DATA_1", 16, length)); + headers.add(new ColumnHeader("hub.OOB_DATA_2", 16, length)); + headers.add(new ColumnHeader("hub.OOB_DATA_3", 16, length)); + headers.add(new ColumnHeader("hub.OOB_DATA_4", 16, length)); + headers.add(new ColumnHeader("hub.OOB_DATA_5", 16, length)); + headers.add(new ColumnHeader("hub.OOB_DATA_6", 16, length)); + headers.add(new ColumnHeader("hub.OOB_DATA_7", 16, length)); + headers.add(new ColumnHeader("hub.OOB_DATA_8", 16, length)); + headers.add(new ColumnHeader("hub.OOB_DATA_9", 16, length)); + headers.add(new ColumnHeader("hub.PEEK_AT_ACCOUNT", 1, length)); + headers.add(new ColumnHeader("hub.PEEK_AT_CONTEXT", 1, length)); + headers.add(new ColumnHeader("hub.PEEK_AT_MISCELLANEOUS", 1, length)); + headers.add(new ColumnHeader("hub.PEEK_AT_SCENARIO", 1, length)); + headers.add(new ColumnHeader("hub.PEEK_AT_STACK", 1, length)); + headers.add(new ColumnHeader("hub.PEEK_AT_STORAGE", 1, length)); + headers.add(new ColumnHeader("hub.PEEK_AT_TRANSACTION", 1, length)); + headers.add(new ColumnHeader("hub.PRC_ECMUL_xor_MACHINE_STATE_FLAG", 1, length)); + headers.add(new ColumnHeader("hub.PRC_ECPAIRING_xor_MAXCSX", 1, length)); + headers.add(new ColumnHeader("hub.PRC_ECRECOVER_xor_MOD_FLAG", 1, length)); + headers.add(new ColumnHeader("hub.PRC_FAILURE_KNOWN_TO_HUB_xor_MUL_FLAG", 1, length)); + headers.add(new ColumnHeader("hub.PRC_FAILURE_KNOWN_TO_RAM_xor_MXPX", 1, length)); + headers.add(new ColumnHeader("hub.PRC_IDENTITY_xor_MXP_FLAG", 1, length)); + headers.add(new ColumnHeader("hub.PRC_MODEXP_xor_OOGX", 1, length)); + headers.add(new ColumnHeader("hub.PRC_RIPEMD-160_xor_OPCX", 1, length)); + headers.add(new ColumnHeader("hub.PRC_SHA2-256_xor_PUSHPOP_FLAG", 1, length)); + headers.add(new ColumnHeader("hub.PRC_SUCCESS_CALLER_WILL_REVERT_xor_RDCX", 1, length)); + headers.add(new ColumnHeader("hub.PRC_SUCCESS_CALLER_WONT_REVERT_xor_SHF_FLAG", 1, length)); + headers.add(new ColumnHeader("hub.PRIORITY_FEE_PER_GAS", 8, length)); + headers.add(new ColumnHeader("hub.PROGRAM_COUNTER", 4, length)); + headers.add(new ColumnHeader("hub.PROGRAM_COUNTER_NEW", 4, length)); + headers.add(new ColumnHeader("hub.REFUND_COUNTER", 4, length)); + headers.add(new ColumnHeader("hub.REFUND_COUNTER_INFINITY", 8, length)); + headers.add(new ColumnHeader("hub.REFUND_COUNTER_NEW", 4, length)); + headers.add(new ColumnHeader("hub.REFUND_EFFECTIVE", 8, length)); + headers.add(new ColumnHeader("hub.RELATIVE_BLOCK_NUMBER", 2, length)); + headers.add(new ColumnHeader("hub.RETURN_AT_CAPACITY_xor_MXP_INST", 4, length)); + headers.add(new ColumnHeader("hub.RETURN_AT_OFFSET_xor_OOB_INST", 4, length)); + headers.add(new ColumnHeader("hub.RETURN_DATA_CONTEXT_NUMBER_xor_STP_GAS_STIPEND", 4, length)); + headers.add(new ColumnHeader("hub.RETURN_DATA_OFFSET_xor_STP_INSTRUCTION", 4, length)); + headers.add(new ColumnHeader("hub.RETURN_DATA_SIZE", 4, length)); + headers.add(new ColumnHeader("hub.RETURN_EXCEPTION_xor_SOX", 1, length)); + headers.add(new ColumnHeader("hub.RETURN_FROM_DEPLOYMENT_EMPTY_CODE_WILL_REVERT_xor_SSTOREX", 1, length)); + headers.add(new ColumnHeader("hub.RETURN_FROM_DEPLOYMENT_EMPTY_CODE_WONT_REVERT_xor_STACKRAM_FLAG", 1, length)); + headers.add(new ColumnHeader("hub.RETURN_FROM_DEPLOYMENT_NONEMPTY_CODE_WILL_REVERT_xor_STACK_ITEM_POP_1", 1, length)); + headers.add(new ColumnHeader("hub.RETURN_FROM_DEPLOYMENT_NONEMPTY_CODE_WONT_REVERT_xor_STACK_ITEM_POP_2", 1, length)); + headers.add(new ColumnHeader("hub.RETURN_FROM_MESSAGE_CALL_WILL_TOUCH_RAM_xor_STACK_ITEM_POP_3", 1, length)); + headers.add(new ColumnHeader("hub.RETURN_FROM_MESSAGE_CALL_WONT_TOUCH_RAM_xor_STACK_ITEM_POP_4", 1, length)); + headers.add(new ColumnHeader("hub.RLPADDR_DEP_ADDR_HI_xor_CALL_DATA_CONTEXT_NUMBER_xor_MMU_REF_SIZE", 4, length)); + headers.add(new ColumnHeader("hub.RLPADDR_DEP_ADDR_LO_xor_MMU_SRC_OFFSET_HI_xor_STACK_ITEM_VALUE_HI_4_xor_VALUE_ORIG_HI", 16, length)); + headers.add(new ColumnHeader("hub.RLPADDR_FLAG_xor_CREATE_NONEMPTY_INIT_CODE_FAILURE_WONT_REVERT_xor_JUMP_DESTINATION_VETTING_REQUIRED", 1, length)); + headers.add(new ColumnHeader("hub.RLPADDR_KEC_HI_xor_MMU_SRC_OFFSET_LO_xor_STACK_ITEM_VALUE_LO_1_xor_VALUE_ORIG_LO", 16, length)); + headers.add(new ColumnHeader("hub.RLPADDR_KEC_LO_xor_MMU_TGT_OFFSET_LO_xor_STACK_ITEM_VALUE_LO_2", 16, length)); + headers.add(new ColumnHeader("hub.RLPADDR_RECIPE", 1, length)); + headers.add(new ColumnHeader("hub.RLPADDR_SALT_HI_xor_MXP_GAS_MXP_xor_STACK_ITEM_VALUE_LO_3", 16, length)); + headers.add(new ColumnHeader("hub.RLPADDR_SALT_LO_xor_MXP_OFFSET_1_HI_xor_STACK_ITEM_VALUE_LO_4", 16, length)); + headers.add(new ColumnHeader("hub.ROMLEX_FLAG_xor_CREATE_NONEMPTY_INIT_CODE_SUCCESS_WILL_REVERT_xor_JUMP_FLAG", 1, length)); + headers.add(new ColumnHeader("hub.SELFDESTRUCT_EXCEPTION_xor_STATICX", 1, length)); + headers.add(new ColumnHeader("hub.SELFDESTRUCT_WILL_REVERT_xor_STATIC_FLAG", 1, length)); + headers.add(new ColumnHeader("hub.SELFDESTRUCT_WONT_REVERT_ALREADY_MARKED_xor_STO_FLAG", 1, length)); + headers.add(new ColumnHeader("hub.SELFDESTRUCT_WONT_REVERT_NOT_YET_MARKED_xor_SUX", 1, length)); + headers.add(new ColumnHeader("hub.STACK_ITEM_HEIGHT_2", 2, length)); + headers.add(new ColumnHeader("hub.STACK_ITEM_HEIGHT_3", 2, length)); + headers.add(new ColumnHeader("hub.STACK_ITEM_HEIGHT_4", 2, length)); + headers.add(new ColumnHeader("hub.STACK_ITEM_STAMP_1", 5, length)); + headers.add(new ColumnHeader("hub.STACK_ITEM_STAMP_2", 5, length)); + headers.add(new ColumnHeader("hub.STACK_ITEM_STAMP_3", 5, length)); + headers.add(new ColumnHeader("hub.STACK_ITEM_STAMP_4", 5, length)); + headers.add(new ColumnHeader("hub.STP_GAS_HI", 16, length)); + headers.add(new ColumnHeader("hub.STP_GAS_LO", 16, length)); + headers.add(new ColumnHeader("hub.STP_GAS_UPFRONT_GAS_COST_xor_PRC_RETURN_GAS_xor_GAS_LEFTOVER", 8, length)); + headers.add(new ColumnHeader("hub.STP_VALUE_HI", 16, length)); + headers.add(new ColumnHeader("hub.STP_VALUE_LO", 16, length)); + headers.add(new ColumnHeader("hub.SUB_STAMP", 4, length)); + headers.add(new ColumnHeader("hub.SWAP_FLAG", 1, length)); + headers.add(new ColumnHeader("hub.TRM_FLAG_xor_CREATE_NONEMPTY_INIT_CODE_SUCCESS_WONT_REVERT_xor_KEC_FLAG", 1, length)); + headers.add(new ColumnHeader("hub.TRM_RAW_ADDRESS_HI_xor_MXP_OFFSET_1_LO", 16, length)); + headers.add(new ColumnHeader("hub.TWO_LINE_INSTRUCTION", 1, length)); + headers.add(new ColumnHeader("hub.TX_EXEC", 1, length)); + headers.add(new ColumnHeader("hub.TX_FINL", 1, length)); + headers.add(new ColumnHeader("hub.TX_INIT", 1, length)); + headers.add(new ColumnHeader("hub.TX_SKIP", 1, length)); + headers.add(new ColumnHeader("hub.TX_WARM", 1, length)); + headers.add(new ColumnHeader("hub.TXN_FLAG", 1, length)); + headers.add(new ColumnHeader("hub.WARMTH_NEW_xor_PRC_ECADD_xor_LOG_INFO_FLAG", 1, length)); + headers.add(new ColumnHeader("hub.WARMTH_xor_PRC_BLAKE2f_xor_LOG_FLAG", 1, length)); + headers.add(new ColumnHeader("hub.WCP_FLAG", 1, length)); + return headers; + } + + public Trace (List buffers) { this.absoluteTransactionNumber = buffers.get(0); - this - .addressHiXorAccountAddressHiXorCcrsStampXorPrcCalleeGasXorStaticGasXorAddressHiXorCallDataSize = - buffers.get(1); - this - .addressLoXorAccountAddressLoXorExpData1XorHashInfoKeccakHiXorAddressLoXorCoinbaseAddressLo = - buffers.get(2); - this.againInBlkXorIsRootXorCcsrFlagXorCallAbortWillRevertXorAccFlagXorAgainInBlkXorCopyTxcd = - buffers.get(3); - this - .againInCnfXorIsStaticXorExpFlagXorCallAbortWontRevertXorAddFlagXorAgainInCnfXorIsDeployment = - buffers.get(4); - this - .againInTxnXorUpdateXorMmuFlagXorCallEoaSuccessCallerWillRevertXorBinFlagXorAgainInTxnXorIsType2 = - buffers.get(5); + this.addressHiXorAccountAddressHiXorCcrsStampXorPrcCdoXorStaticGasXorAddressHiXorCallDataSize = buffers.get(1); + this.addressLoXorAccountAddressLoXorExpData1XorHashInfoKeccakHiXorAddressLoXorCoinbaseAddressLo = buffers.get(2); + this.againInBlkXorIsRootXorCcsrFlagXorCallAbortWillRevertXorAccFlagXorAgainInBlkXorCopyTxcd = buffers.get(3); + this.againInCnfXorIsStaticXorExpFlagXorCallAbortWontRevertXorAddFlagXorAgainInCnfXorIsDeployment = buffers.get(4); + this.againInTxnXorUpdateXorMmuFlagXorCallEoaSuccessCallerWillRevertXorBinFlagXorAgainInTxnXorIsType2 = buffers.get(5); this.alpha = buffers.get(6); - this.balanceNewXorCallerAddressLoXorExpData3XorPushValueHiXorStorageKeyLoXorInitialBalance = - buffers.get(7); - this.balanceXorByteCodeAddressLoXorExpData2XorHashInfoKeccakLoXorStorageKeyHiXorFromAddressLo = - buffers.get(8); + this.balanceNewXorCallerAddressLoXorExpData3XorPushValueHiXorStorageKeyLoXorInitialBalance = buffers.get(7); + this.balanceXorByteCodeAddressLoXorExpData2XorHashInfoKeccakLoXorStorageKeyHiXorFromAddressLo = buffers.get(8); this.callDataOffsetXorMmuSize = buffers.get(9); this.callDataSizeXorMmuSrcId = buffers.get(10); this.callStackDepthXorStackItemHeight1 = buffers.get(11); this.callerContextNumber = buffers.get(12); this.codeFragmentIndex = buffers.get(13); - this - .codeFragmentIndexXorAccountDeploymentNumberXorExpInstXorPrcCallerGasXorDeploymentNumberXorCoinbaseAddressHi = - buffers.get(14); + this.codeFragmentIndexXorAccountDeploymentNumberXorExpInstXorPrcCdsXorDeploymentNumberXorCoinbaseAddressHi = buffers.get(14); this.codeHashHiNewXorExpData5XorStackItemValueHi1XorValueCurrLoXorValue = buffers.get(15); - this.codeHashHiXorCallValueXorExpData4XorPushValueLoXorValueCurrHiXorToAddressLo = - buffers.get(16); + this.codeHashHiXorCallValueXorExpData4XorPushValueLoXorValueCurrHiXorToAddressLo = buffers.get(16); this.codeHashLoNewXorMmuLimb2XorStackItemValueHi3XorValueNextLo = buffers.get(17); this.codeHashLoXorMmuLimb1XorStackItemValueHi2XorValueNextHi = buffers.get(18); - this.codeSizeNewXorByteCodeCodeFragmentIndexXorMmuExoSumXorPrcCdsXorInitCodeSize = - buffers.get(19); - this.codeSizeXorByteCodeAddressHiXorMmuAuxIdXorPrcCdoXorDeploymentNumberInftyXorFromAddressHi = - buffers.get(20); + this.codeSizeNewXorByteCodeCodeFragmentIndexXorMmuExoSumXorPrcRaoXorInitCodeSize = buffers.get(19); + this.codeSizeXorByteCodeAddressHiXorMmuAuxIdXorPrcRacXorDeploymentNumberInftyXorFromAddressHi = buffers.get(20); this.contextGetsReverted = buffers.get(21); this.contextMayChange = buffers.get(22); this.contextNumber = buffers.get(23); @@ -644,35 +413,22 @@ public Trace(List buffers) { this.delta = buffers.get(31); this.deploymentNumberFinalInBlockXorDeploymentNumberFinalInBlock = buffers.get(32); this.deploymentNumberFirstInBlockXorDeploymentNumberFirstInBlock = buffers.get(33); - this.deploymentNumberInftyXorByteCodeDeploymentStatusXorMmuPhaseXorPrcRao = buffers.get(34); - this.deploymentNumberNewXorCallerAddressHiXorMmuRefOffsetXorPrcReturnGas = buffers.get(35); - this.deploymentNumberXorByteCodeDeploymentNumberXorMmuInstXorPrcRacXorToAddressHi = - buffers.get(36); - this.deploymentStatusInftyXorMxpDeploysXorCallExceptionXorCallFlagXorFinalInCnfXorStatusCode = - buffers.get(37); + this.deploymentNumberInftyXorByteCodeDeploymentStatusXorMmuPhase = buffers.get(34); + this.deploymentNumberNewXorCallerAddressHiXorMmuRefOffset = buffers.get(35); + this.deploymentNumberXorByteCodeDeploymentNumberXorMmuInstXorToAddressHi = buffers.get(36); + this.deploymentStatusInftyXorMxpDeploysXorCallExceptionXorCallFlagXorFinalInCnfXorStatusCode = buffers.get(37); this.deploymentStatusNewXorMxpFlagXorCallPrcFailureXorConFlagXorFinalInTxn = buffers.get(38); - this - .deploymentStatusXorMmuSuccessBitXorCallEoaSuccessCallerWontRevertXorBtcFlagXorFinalInBlkXorRequiresEvmExecution = - buffers.get(39); + this.deploymentStatusXorMmuSuccessBitXorCallEoaSuccessCallerWontRevertXorBtcFlagXorFinalInBlkXorRequiresEvmExecution = buffers.get(39); this.domStamp = buffers.get(40); this.exceptionAhoy = buffers.get(41); - this.existsNewXorMxpMxpxXorCallPrcSuccessCallerWontRevertXorCreateFlagXorFirstInCnf = - buffers.get(42); - this.existsXorMxpMtntopXorCallPrcSuccessCallerWillRevertXorCopyFlagXorFirstInBlk = - buffers.get(43); - this - .finalInBlkXorMxpSize1NonzeroNoMxpxXorCallSmcFailureCallerWillRevertXorDecFlag1XorFirstInTxn = - buffers.get(44); - this - .finalInCnfXorMxpSize2NonzeroNoMxpxXorCallSmcFailureCallerWontRevertXorDecFlag2XorValueCurrChanges = - buffers.get(45); - this.finalInTxnXorOobFlagXorCallSmcSuccessCallerWillRevertXorDecFlag3XorValueCurrIsOrig = - buffers.get(46); - this.firstInBlkXorStpExistsXorCallSmcSuccessCallerWontRevertXorDecFlag4XorValueCurrIsZero = - buffers.get(47); + this.existsNewXorMxpMxpxXorCallPrcSuccessCallerWontRevertXorCreateFlagXorFirstInCnf = buffers.get(42); + this.existsXorMxpMtntopXorCallPrcSuccessCallerWillRevertXorCopyFlagXorFirstInBlk = buffers.get(43); + this.finalInBlkXorMxpSize1NonzeroNoMxpxXorCallSmcFailureCallerWillRevertXorDecFlag1XorFirstInTxn = buffers.get(44); + this.finalInCnfXorMxpSize2NonzeroNoMxpxXorCallSmcFailureCallerWontRevertXorDecFlag2XorValueCurrChanges = buffers.get(45); + this.finalInTxnXorOobFlagXorCallSmcSuccessCallerWillRevertXorDecFlag3XorValueCurrIsOrig = buffers.get(46); + this.firstInBlkXorStpExistsXorCallSmcSuccessCallerWontRevertXorDecFlag4XorValueCurrIsZero = buffers.get(47); this.firstInCnfXorStpFlagXorCreateAbortXorDupFlagXorValueNextIsCurr = buffers.get(48); - this.firstInTxnXorStpOogxXorCreateEmptyInitCodeWillRevertXorExtFlagXorValueNextIsOrig = - buffers.get(49); + this.firstInTxnXorStpOogxXorCreateEmptyInitCodeWillRevertXorExtFlagXorValueNextIsOrig = buffers.get(49); this.gasActual = buffers.get(50); this.gasCost = buffers.get(51); this.gasExpected = buffers.get(52); @@ -680,8 +436,7 @@ public Trace(List buffers) { this.gasNext = buffers.get(54); this.gasPrice = buffers.get(55); this.hasCodeNewXorCreateExceptionXorHashInfoFlagXorValueOrigIsZero = buffers.get(56); - this.hasCodeXorStpWarmthXorCreateEmptyInitCodeWontRevertXorHaltFlagXorValueNextIsZero = - buffers.get(57); + this.hasCodeXorStpWarmthXorCreateEmptyInitCodeWontRevertXorHaltFlagXorValueNextIsZero = buffers.get(57); this.height = buffers.get(58); this.heightNew = buffers.get(59); this.hubStamp = buffers.get(60); @@ -689,10 +444,8 @@ public Trace(List buffers) { this.instruction = buffers.get(62); this.isPrecompileXorCreateFailureConditionWillRevertXorIcpxXorWarmth = buffers.get(63); this.logInfoStamp = buffers.get(64); - this.markedForSelfdestructNewXorCreateNonemptyInitCodeFailureWillRevertXorJumpx = - buffers.get(65); - this.markedForSelfdestructXorCreateFailureConditionWontRevertXorInvalidFlagXorWarmthNew = - buffers.get(66); + this.markedForSelfdestructNewXorCreateNonemptyInitCodeFailureWillRevertXorJumpx = buffers.get(65); + this.markedForSelfdestructXorCreateFailureConditionWontRevertXorInvalidFlagXorWarmthNew = buffers.get(66); this.mmuStamp = buffers.get(67); this.mxpOffset2Hi = buffers.get(68); this.mxpOffset2Lo = buffers.get(69); @@ -704,8 +457,8 @@ public Trace(List buffers) { this.mxpWords = buffers.get(75); this.nonStackRows = buffers.get(76); this.nonce = buffers.get(77); - this.nonceNewXorStpGasPaidOutOfPocketXorGasInitiallyAvailable = buffers.get(78); - this.nonceXorStpGasMxpXorBasefee = buffers.get(79); + this.nonceNewXorStpGasPaidOutOfPocketXorPrcCallerGasXorGasInitiallyAvailable = buffers.get(78); + this.nonceXorStpGasMxpXorPrcCalleeGasXorBasefee = buffers.get(79); this.oobData1 = buffers.get(80); this.oobData2 = buffers.get(81); this.oobData3 = buffers.get(82); @@ -755,8 +508,7 @@ public Trace(List buffers) { this.returnFromMessageCallWontTouchRamXorStackItemPop4 = buffers.get(126); this.rlpaddrDepAddrHiXorCallDataContextNumberXorMmuRefSize = buffers.get(127); this.rlpaddrDepAddrLoXorMmuSrcOffsetHiXorStackItemValueHi4XorValueOrigHi = buffers.get(128); - this.rlpaddrFlagXorCreateNonemptyInitCodeFailureWontRevertXorJumpDestinationVettingRequired = - buffers.get(129); + this.rlpaddrFlagXorCreateNonemptyInitCodeFailureWontRevertXorJumpDestinationVettingRequired = buffers.get(129); this.rlpaddrKecHiXorMmuSrcOffsetLoXorStackItemValueLo1XorValueOrigLo = buffers.get(130); this.rlpaddrKecLoXorMmuTgtOffsetLoXorStackItemValueLo2 = buffers.get(131); this.rlpaddrRecipe = buffers.get(132); @@ -776,7 +528,7 @@ public Trace(List buffers) { this.stackItemStamp4 = buffers.get(146); this.stpGasHi = buffers.get(147); this.stpGasLo = buffers.get(148); - this.stpGasUpfrontGasCostXorGasLeftover = buffers.get(149); + this.stpGasUpfrontGasCostXorPrcReturnGasXorGasLeftover = buffers.get(149); this.stpValueHi = buffers.get(150); this.stpValueLo = buffers.get(151); this.subStamp = buffers.get(152); @@ -810,13 +562,11 @@ public Trace absoluteTransactionNumber(final long b) { filled.set(0); } - if (b >= 65536L) { - throw new IllegalArgumentException( - "hub.ABSOLUTE_TRANSACTION_NUMBER has invalid value (" + b + ")"); - } + if(b >= 65536L) { throw new IllegalArgumentException("hub.ABSOLUTE_TRANSACTION_NUMBER has invalid value (" + b + ")"); } absoluteTransactionNumber.put((byte) (b >> 8)); absoluteTransactionNumber.put((byte) b); + return this; } @@ -827,14 +577,13 @@ public Trace callerContextNumber(final long b) { filled.set(1); } - if (b >= 4294967296L) { - throw new IllegalArgumentException("hub.CALLER_CONTEXT_NUMBER has invalid value (" + b + ")"); - } + if(b >= 4294967296L) { throw new IllegalArgumentException("hub.CALLER_CONTEXT_NUMBER has invalid value (" + b + ")"); } callerContextNumber.put((byte) (b >> 24)); callerContextNumber.put((byte) (b >> 16)); callerContextNumber.put((byte) (b >> 8)); callerContextNumber.put((byte) b); + return this; } @@ -845,14 +594,13 @@ public Trace codeFragmentIndex(final long b) { filled.set(2); } - if (b >= 4294967296L) { - throw new IllegalArgumentException("hub.CODE_FRAGMENT_INDEX has invalid value (" + b + ")"); - } + if(b >= 4294967296L) { throw new IllegalArgumentException("hub.CODE_FRAGMENT_INDEX has invalid value (" + b + ")"); } codeFragmentIndex.put((byte) (b >> 24)); codeFragmentIndex.put((byte) (b >> 16)); codeFragmentIndex.put((byte) (b >> 8)); codeFragmentIndex.put((byte) b); + return this; } @@ -887,14 +635,13 @@ public Trace contextNumber(final long b) { filled.set(5); } - if (b >= 4294967296L) { - throw new IllegalArgumentException("hub.CONTEXT_NUMBER has invalid value (" + b + ")"); - } + if(b >= 4294967296L) { throw new IllegalArgumentException("hub.CONTEXT_NUMBER has invalid value (" + b + ")"); } contextNumber.put((byte) (b >> 24)); contextNumber.put((byte) (b >> 16)); contextNumber.put((byte) (b >> 8)); contextNumber.put((byte) b); + return this; } @@ -905,14 +652,13 @@ public Trace contextNumberNew(final long b) { filled.set(6); } - if (b >= 4294967296L) { - throw new IllegalArgumentException("hub.CONTEXT_NUMBER_NEW has invalid value (" + b + ")"); - } + if(b >= 4294967296L) { throw new IllegalArgumentException("hub.CONTEXT_NUMBER_NEW has invalid value (" + b + ")"); } contextNumberNew.put((byte) (b >> 24)); contextNumberNew.put((byte) (b >> 16)); contextNumberNew.put((byte) (b >> 8)); contextNumberNew.put((byte) b); + return this; } @@ -923,14 +669,13 @@ public Trace contextRevertStamp(final long b) { filled.set(7); } - if (b >= 4294967296L) { - throw new IllegalArgumentException("hub.CONTEXT_REVERT_STAMP has invalid value (" + b + ")"); - } + if(b >= 4294967296L) { throw new IllegalArgumentException("hub.CONTEXT_REVERT_STAMP has invalid value (" + b + ")"); } contextRevertStamp.put((byte) (b >> 24)); contextRevertStamp.put((byte) (b >> 16)); contextRevertStamp.put((byte) (b >> 8)); contextRevertStamp.put((byte) b); + return this; } @@ -965,11 +710,10 @@ public Trace counterNsr(final long b) { filled.set(10); } - if (b >= 256L) { - throw new IllegalArgumentException("hub.COUNTER_NSR has invalid value (" + b + ")"); - } + if(b >= 256L) { throw new IllegalArgumentException("hub.COUNTER_NSR has invalid value (" + b + ")"); } counterNsr.put((byte) b); + return this; } @@ -992,14 +736,13 @@ public Trace domStamp(final long b) { filled.set(12); } - if (b >= 4294967296L) { - throw new IllegalArgumentException("hub.DOM_STAMP has invalid value (" + b + ")"); - } + if(b >= 4294967296L) { throw new IllegalArgumentException("hub.DOM_STAMP has invalid value (" + b + ")"); } domStamp.put((byte) (b >> 24)); domStamp.put((byte) (b >> 16)); domStamp.put((byte) (b >> 8)); domStamp.put((byte) b); + return this; } @@ -1025,18 +768,11 @@ public Trace gasActual(final Bytes b) { // Trim array to size Bytes bs = b.trimLeadingZeros(); // Sanity check against expected width - if (bs.bitLength() > 64) { - throw new IllegalArgumentException( - "hub.GAS_ACTUAL has invalid width (" + bs.bitLength() + "bits)"); - } + if(bs.bitLength() > 64) { throw new IllegalArgumentException("hub.GAS_ACTUAL has invalid width (" + bs.bitLength() + "bits)"); } // Write padding (if necessary) - for (int i = bs.size(); i < 8; i++) { - gasActual.put((byte) 0); - } + for(int i=bs.size(); i<8; i++) { gasActual.put((byte) 0); } // Write bytes - for (int j = 0; j < bs.size(); j++) { - gasActual.put(bs.get(j)); - } + for(int j=0; j 64) { - throw new IllegalArgumentException( - "hub.GAS_COST has invalid width (" + bs.bitLength() + "bits)"); - } + if(bs.bitLength() > 64) { throw new IllegalArgumentException("hub.GAS_COST has invalid width (" + bs.bitLength() + "bits)"); } // Write padding (if necessary) - for (int i = bs.size(); i < 8; i++) { - gasCost.put((byte) 0); - } + for(int i=bs.size(); i<8; i++) { gasCost.put((byte) 0); } // Write bytes - for (int j = 0; j < bs.size(); j++) { - gasCost.put(bs.get(j)); - } + for(int j=0; j 64) { - throw new IllegalArgumentException( - "hub.GAS_EXPECTED has invalid width (" + bs.bitLength() + "bits)"); - } + if(bs.bitLength() > 64) { throw new IllegalArgumentException("hub.GAS_EXPECTED has invalid width (" + bs.bitLength() + "bits)"); } // Write padding (if necessary) - for (int i = bs.size(); i < 8; i++) { - gasExpected.put((byte) 0); - } + for(int i=bs.size(); i<8; i++) { gasExpected.put((byte) 0); } // Write bytes - for (int j = 0; j < bs.size(); j++) { - gasExpected.put(bs.get(j)); - } + for(int j=0; j 64) { - throw new IllegalArgumentException( - "hub.GAS_NEXT has invalid width (" + bs.bitLength() + "bits)"); - } + if(bs.bitLength() > 64) { throw new IllegalArgumentException("hub.GAS_NEXT has invalid width (" + bs.bitLength() + "bits)"); } // Write padding (if necessary) - for (int i = bs.size(); i < 8; i++) { - gasNext.put((byte) 0); - } + for(int i=bs.size(); i<8; i++) { gasNext.put((byte) 0); } // Write bytes - for (int j = 0; j < bs.size(); j++) { - gasNext.put(bs.get(j)); - } + for(int j=0; j= 2048L) { - throw new IllegalArgumentException("hub.HEIGHT has invalid value (" + b + ")"); - } + if(b >= 2048L) { throw new IllegalArgumentException("hub.HEIGHT has invalid value (" + b + ")"); } height.put((byte) (b >> 8)); height.put((byte) b); + return this; } @@ -1142,12 +856,11 @@ public Trace heightNew(final long b) { filled.set(19); } - if (b >= 2048L) { - throw new IllegalArgumentException("hub.HEIGHT_NEW has invalid value (" + b + ")"); - } + if(b >= 2048L) { throw new IllegalArgumentException("hub.HEIGHT_NEW has invalid value (" + b + ")"); } heightNew.put((byte) (b >> 8)); heightNew.put((byte) b); + return this; } @@ -1158,14 +871,13 @@ public Trace hubStamp(final long b) { filled.set(20); } - if (b >= 4294967296L) { - throw new IllegalArgumentException("hub.HUB_STAMP has invalid value (" + b + ")"); - } + if(b >= 4294967296L) { throw new IllegalArgumentException("hub.HUB_STAMP has invalid value (" + b + ")"); } hubStamp.put((byte) (b >> 24)); hubStamp.put((byte) (b >> 16)); hubStamp.put((byte) (b >> 8)); hubStamp.put((byte) b); + return this; } @@ -1176,15 +888,13 @@ public Trace hubStampTransactionEnd(final long b) { filled.set(21); } - if (b >= 4294967296L) { - throw new IllegalArgumentException( - "hub.HUB_STAMP_TRANSACTION_END has invalid value (" + b + ")"); - } + if(b >= 4294967296L) { throw new IllegalArgumentException("hub.HUB_STAMP_TRANSACTION_END has invalid value (" + b + ")"); } hubStampTransactionEnd.put((byte) (b >> 24)); hubStampTransactionEnd.put((byte) (b >> 16)); hubStampTransactionEnd.put((byte) (b >> 8)); hubStampTransactionEnd.put((byte) b); + return this; } @@ -1195,14 +905,13 @@ public Trace logInfoStamp(final long b) { filled.set(22); } - if (b >= 4294967296L) { - throw new IllegalArgumentException("hub.LOG_INFO_STAMP has invalid value (" + b + ")"); - } + if(b >= 4294967296L) { throw new IllegalArgumentException("hub.LOG_INFO_STAMP has invalid value (" + b + ")"); } logInfoStamp.put((byte) (b >> 24)); logInfoStamp.put((byte) (b >> 16)); logInfoStamp.put((byte) (b >> 8)); logInfoStamp.put((byte) b); + return this; } @@ -1213,14 +922,13 @@ public Trace mmuStamp(final long b) { filled.set(23); } - if (b >= 4294967296L) { - throw new IllegalArgumentException("hub.MMU_STAMP has invalid value (" + b + ")"); - } + if(b >= 4294967296L) { throw new IllegalArgumentException("hub.MMU_STAMP has invalid value (" + b + ")"); } mmuStamp.put((byte) (b >> 24)); mmuStamp.put((byte) (b >> 16)); mmuStamp.put((byte) (b >> 8)); mmuStamp.put((byte) b); + return this; } @@ -1231,14 +939,13 @@ public Trace mxpStamp(final long b) { filled.set(24); } - if (b >= 4294967296L) { - throw new IllegalArgumentException("hub.MXP_STAMP has invalid value (" + b + ")"); - } + if(b >= 4294967296L) { throw new IllegalArgumentException("hub.MXP_STAMP has invalid value (" + b + ")"); } mxpStamp.put((byte) (b >> 24)); mxpStamp.put((byte) (b >> 16)); mxpStamp.put((byte) (b >> 8)); mxpStamp.put((byte) b); + return this; } @@ -1249,11 +956,10 @@ public Trace nonStackRows(final long b) { filled.set(25); } - if (b >= 256L) { - throw new IllegalArgumentException("hub.NON_STACK_ROWS has invalid value (" + b + ")"); - } + if(b >= 256L) { throw new IllegalArgumentException("hub.NON_STACK_ROWS has invalid value (" + b + ")"); } nonStackRows.put((byte) b); + return this; } @@ -1264,17 +970,12 @@ public Trace pAccountAddressHi(final long b) { filled.set(103); } - if (b >= 4294967296L) { - throw new IllegalArgumentException("hub.account/ADDRESS_HI has invalid value (" + b + ")"); - } - addressHiXorAccountAddressHiXorCcrsStampXorPrcCalleeGasXorStaticGasXorAddressHiXorCallDataSize - .put((byte) (b >> 24)); - addressHiXorAccountAddressHiXorCcrsStampXorPrcCalleeGasXorStaticGasXorAddressHiXorCallDataSize - .put((byte) (b >> 16)); - addressHiXorAccountAddressHiXorCcrsStampXorPrcCalleeGasXorStaticGasXorAddressHiXorCallDataSize - .put((byte) (b >> 8)); - addressHiXorAccountAddressHiXorCcrsStampXorPrcCalleeGasXorStaticGasXorAddressHiXorCallDataSize - .put((byte) b); + if(b >= 4294967296L) { throw new IllegalArgumentException("hub.account/ADDRESS_HI has invalid value (" + b + ")"); } + addressHiXorAccountAddressHiXorCcrsStampXorPrcCdoXorStaticGasXorAddressHiXorCallDataSize.put((byte) (b >> 24)); + addressHiXorAccountAddressHiXorCcrsStampXorPrcCdoXorStaticGasXorAddressHiXorCallDataSize.put((byte) (b >> 16)); + addressHiXorAccountAddressHiXorCcrsStampXorPrcCdoXorStaticGasXorAddressHiXorCallDataSize.put((byte) (b >> 8)); + addressHiXorAccountAddressHiXorCcrsStampXorPrcCdoXorStaticGasXorAddressHiXorCallDataSize.put((byte) b); + return this; } @@ -1289,20 +990,11 @@ public Trace pAccountAddressLo(final Bytes b) { // Trim array to size Bytes bs = b.trimLeadingZeros(); // Sanity check against expected width - if (bs.bitLength() > 128) { - throw new IllegalArgumentException( - "hub.account/ADDRESS_LO has invalid width (" + bs.bitLength() + "bits)"); - } + if(bs.bitLength() > 128) { throw new IllegalArgumentException("hub.account/ADDRESS_LO has invalid width (" + bs.bitLength() + "bits)"); } // Write padding (if necessary) - for (int i = bs.size(); i < 16; i++) { - addressLoXorAccountAddressLoXorExpData1XorHashInfoKeccakHiXorAddressLoXorCoinbaseAddressLo - .put((byte) 0); - } + for(int i=bs.size(); i<16; i++) { addressLoXorAccountAddressLoXorExpData1XorHashInfoKeccakHiXorAddressLoXorCoinbaseAddressLo.put((byte) 0); } // Write bytes - for (int j = 0; j < bs.size(); j++) { - addressLoXorAccountAddressLoXorExpData1XorHashInfoKeccakHiXorAddressLoXorCoinbaseAddressLo - .put(bs.get(j)); - } + for(int j=0; j 128) { - throw new IllegalArgumentException( - "hub.account/BALANCE has invalid width (" + bs.bitLength() + "bits)"); - } + if(bs.bitLength() > 128) { throw new IllegalArgumentException("hub.account/BALANCE has invalid width (" + bs.bitLength() + "bits)"); } // Write padding (if necessary) - for (int i = bs.size(); i < 16; i++) { - balanceXorByteCodeAddressLoXorExpData2XorHashInfoKeccakLoXorStorageKeyHiXorFromAddressLo.put( - (byte) 0); - } + for(int i=bs.size(); i<16; i++) { balanceXorByteCodeAddressLoXorExpData2XorHashInfoKeccakLoXorStorageKeyHiXorFromAddressLo.put((byte) 0); } // Write bytes - for (int j = 0; j < bs.size(); j++) { - balanceXorByteCodeAddressLoXorExpData2XorHashInfoKeccakLoXorStorageKeyHiXorFromAddressLo.put( - bs.get(j)); - } + for(int j=0; j 128) { - throw new IllegalArgumentException( - "hub.account/BALANCE_NEW has invalid width (" + bs.bitLength() + "bits)"); - } + if(bs.bitLength() > 128) { throw new IllegalArgumentException("hub.account/BALANCE_NEW has invalid width (" + bs.bitLength() + "bits)"); } // Write padding (if necessary) - for (int i = bs.size(); i < 16; i++) { - balanceNewXorCallerAddressLoXorExpData3XorPushValueHiXorStorageKeyLoXorInitialBalance.put( - (byte) 0); - } + for(int i=bs.size(); i<16; i++) { balanceNewXorCallerAddressLoXorExpData3XorPushValueHiXorStorageKeyLoXorInitialBalance.put((byte) 0); } // Write bytes - for (int j = 0; j < bs.size(); j++) { - balanceNewXorCallerAddressLoXorExpData3XorPushValueHiXorStorageKeyLoXorInitialBalance.put( - bs.get(j)); - } + for(int j=0; j= 4294967296L) { - throw new IllegalArgumentException( - "hub.account/CODE_FRAGMENT_INDEX has invalid value (" + b + ")"); - } - codeFragmentIndexXorAccountDeploymentNumberXorExpInstXorPrcCallerGasXorDeploymentNumberXorCoinbaseAddressHi - .put((byte) (b >> 24)); - codeFragmentIndexXorAccountDeploymentNumberXorExpInstXorPrcCallerGasXorDeploymentNumberXorCoinbaseAddressHi - .put((byte) (b >> 16)); - codeFragmentIndexXorAccountDeploymentNumberXorExpInstXorPrcCallerGasXorDeploymentNumberXorCoinbaseAddressHi - .put((byte) (b >> 8)); - codeFragmentIndexXorAccountDeploymentNumberXorExpInstXorPrcCallerGasXorDeploymentNumberXorCoinbaseAddressHi - .put((byte) b); + if(b >= 4294967296L) { throw new IllegalArgumentException("hub.account/CODE_FRAGMENT_INDEX has invalid value (" + b + ")"); } + codeFragmentIndexXorAccountDeploymentNumberXorExpInstXorPrcCdsXorDeploymentNumberXorCoinbaseAddressHi.put((byte) (b >> 24)); + codeFragmentIndexXorAccountDeploymentNumberXorExpInstXorPrcCdsXorDeploymentNumberXorCoinbaseAddressHi.put((byte) (b >> 16)); + codeFragmentIndexXorAccountDeploymentNumberXorExpInstXorPrcCdsXorDeploymentNumberXorCoinbaseAddressHi.put((byte) (b >> 8)); + codeFragmentIndexXorAccountDeploymentNumberXorExpInstXorPrcCdsXorDeploymentNumberXorCoinbaseAddressHi.put((byte) b); + return this; } @@ -1435,18 +1100,11 @@ public Trace pAccountCodeHashHi(final Bytes b) { // Trim array to size Bytes bs = b.trimLeadingZeros(); // Sanity check against expected width - if (bs.bitLength() > 128) { - throw new IllegalArgumentException( - "hub.account/CODE_HASH_HI has invalid width (" + bs.bitLength() + "bits)"); - } + if(bs.bitLength() > 128) { throw new IllegalArgumentException("hub.account/CODE_HASH_HI has invalid width (" + bs.bitLength() + "bits)"); } // Write padding (if necessary) - for (int i = bs.size(); i < 16; i++) { - codeHashHiXorCallValueXorExpData4XorPushValueLoXorValueCurrHiXorToAddressLo.put((byte) 0); - } + for(int i=bs.size(); i<16; i++) { codeHashHiXorCallValueXorExpData4XorPushValueLoXorValueCurrHiXorToAddressLo.put((byte) 0); } // Write bytes - for (int j = 0; j < bs.size(); j++) { - codeHashHiXorCallValueXorExpData4XorPushValueLoXorValueCurrHiXorToAddressLo.put(bs.get(j)); - } + for(int j=0; j 128) { - throw new IllegalArgumentException( - "hub.account/CODE_HASH_HI_NEW has invalid width (" + bs.bitLength() + "bits)"); - } + if(bs.bitLength() > 128) { throw new IllegalArgumentException("hub.account/CODE_HASH_HI_NEW has invalid width (" + bs.bitLength() + "bits)"); } // Write padding (if necessary) - for (int i = bs.size(); i < 16; i++) { - codeHashHiNewXorExpData5XorStackItemValueHi1XorValueCurrLoXorValue.put((byte) 0); - } + for(int i=bs.size(); i<16; i++) { codeHashHiNewXorExpData5XorStackItemValueHi1XorValueCurrLoXorValue.put((byte) 0); } // Write bytes - for (int j = 0; j < bs.size(); j++) { - codeHashHiNewXorExpData5XorStackItemValueHi1XorValueCurrLoXorValue.put(bs.get(j)); - } + for(int j=0; j 128) { - throw new IllegalArgumentException( - "hub.account/CODE_HASH_LO has invalid width (" + bs.bitLength() + "bits)"); - } + if(bs.bitLength() > 128) { throw new IllegalArgumentException("hub.account/CODE_HASH_LO has invalid width (" + bs.bitLength() + "bits)"); } // Write padding (if necessary) - for (int i = bs.size(); i < 16; i++) { - codeHashLoXorMmuLimb1XorStackItemValueHi2XorValueNextHi.put((byte) 0); - } + for(int i=bs.size(); i<16; i++) { codeHashLoXorMmuLimb1XorStackItemValueHi2XorValueNextHi.put((byte) 0); } // Write bytes - for (int j = 0; j < bs.size(); j++) { - codeHashLoXorMmuLimb1XorStackItemValueHi2XorValueNextHi.put(bs.get(j)); - } + for(int j=0; j 128) { - throw new IllegalArgumentException( - "hub.account/CODE_HASH_LO_NEW has invalid width (" + bs.bitLength() + "bits)"); - } + if(bs.bitLength() > 128) { throw new IllegalArgumentException("hub.account/CODE_HASH_LO_NEW has invalid width (" + bs.bitLength() + "bits)"); } // Write padding (if necessary) - for (int i = bs.size(); i < 16; i++) { - codeHashLoNewXorMmuLimb2XorStackItemValueHi3XorValueNextLo.put((byte) 0); - } + for(int i=bs.size(); i<16; i++) { codeHashLoNewXorMmuLimb2XorStackItemValueHi3XorValueNextLo.put((byte) 0); } // Write bytes - for (int j = 0; j < bs.size(); j++) { - codeHashLoNewXorMmuLimb2XorStackItemValueHi3XorValueNextLo.put(bs.get(j)); - } + for(int j=0; j= 4294967296L) { - throw new IllegalArgumentException("hub.account/CODE_SIZE has invalid value (" + b + ")"); - } - codeSizeXorByteCodeAddressHiXorMmuAuxIdXorPrcCdoXorDeploymentNumberInftyXorFromAddressHi.put( - (byte) (b >> 24)); - codeSizeXorByteCodeAddressHiXorMmuAuxIdXorPrcCdoXorDeploymentNumberInftyXorFromAddressHi.put( - (byte) (b >> 16)); - codeSizeXorByteCodeAddressHiXorMmuAuxIdXorPrcCdoXorDeploymentNumberInftyXorFromAddressHi.put( - (byte) (b >> 8)); - codeSizeXorByteCodeAddressHiXorMmuAuxIdXorPrcCdoXorDeploymentNumberInftyXorFromAddressHi.put( - (byte) b); + if(b >= 4294967296L) { throw new IllegalArgumentException("hub.account/CODE_SIZE has invalid value (" + b + ")"); } + codeSizeXorByteCodeAddressHiXorMmuAuxIdXorPrcRacXorDeploymentNumberInftyXorFromAddressHi.put((byte) (b >> 24)); + codeSizeXorByteCodeAddressHiXorMmuAuxIdXorPrcRacXorDeploymentNumberInftyXorFromAddressHi.put((byte) (b >> 16)); + codeSizeXorByteCodeAddressHiXorMmuAuxIdXorPrcRacXorDeploymentNumberInftyXorFromAddressHi.put((byte) (b >> 8)); + codeSizeXorByteCodeAddressHiXorMmuAuxIdXorPrcRacXorDeploymentNumberInftyXorFromAddressHi.put((byte) b); + return this; } @@ -1558,16 +1190,12 @@ public Trace pAccountCodeSizeNew(final long b) { filled.set(106); } - if (b >= 4294967296L) { - throw new IllegalArgumentException("hub.account/CODE_SIZE_NEW has invalid value (" + b + ")"); - } - codeSizeNewXorByteCodeCodeFragmentIndexXorMmuExoSumXorPrcCdsXorInitCodeSize.put( - (byte) (b >> 24)); - codeSizeNewXorByteCodeCodeFragmentIndexXorMmuExoSumXorPrcCdsXorInitCodeSize.put( - (byte) (b >> 16)); - codeSizeNewXorByteCodeCodeFragmentIndexXorMmuExoSumXorPrcCdsXorInitCodeSize.put( - (byte) (b >> 8)); - codeSizeNewXorByteCodeCodeFragmentIndexXorMmuExoSumXorPrcCdsXorInitCodeSize.put((byte) b); + if(b >= 4294967296L) { throw new IllegalArgumentException("hub.account/CODE_SIZE_NEW has invalid value (" + b + ")"); } + codeSizeNewXorByteCodeCodeFragmentIndexXorMmuExoSumXorPrcRaoXorInitCodeSize.put((byte) (b >> 24)); + codeSizeNewXorByteCodeCodeFragmentIndexXorMmuExoSumXorPrcRaoXorInitCodeSize.put((byte) (b >> 16)); + codeSizeNewXorByteCodeCodeFragmentIndexXorMmuExoSumXorPrcRaoXorInitCodeSize.put((byte) (b >> 8)); + codeSizeNewXorByteCodeCodeFragmentIndexXorMmuExoSumXorPrcRaoXorInitCodeSize.put((byte) b); + return this; } @@ -1579,17 +1207,12 @@ public Trace pAccountDeploymentNumber(final long b) { filled.set(107); } - if (b >= 4294967296L) { - throw new IllegalArgumentException( - "hub.account/DEPLOYMENT_NUMBER has invalid value (" + b + ")"); - } - deploymentNumberXorByteCodeDeploymentNumberXorMmuInstXorPrcRacXorToAddressHi.put( - (byte) (b >> 24)); - deploymentNumberXorByteCodeDeploymentNumberXorMmuInstXorPrcRacXorToAddressHi.put( - (byte) (b >> 16)); - deploymentNumberXorByteCodeDeploymentNumberXorMmuInstXorPrcRacXorToAddressHi.put( - (byte) (b >> 8)); - deploymentNumberXorByteCodeDeploymentNumberXorMmuInstXorPrcRacXorToAddressHi.put((byte) b); + if(b >= 4294967296L) { throw new IllegalArgumentException("hub.account/DEPLOYMENT_NUMBER has invalid value (" + b + ")"); } + deploymentNumberXorByteCodeDeploymentNumberXorMmuInstXorToAddressHi.put((byte) (b >> 24)); + deploymentNumberXorByteCodeDeploymentNumberXorMmuInstXorToAddressHi.put((byte) (b >> 16)); + deploymentNumberXorByteCodeDeploymentNumberXorMmuInstXorToAddressHi.put((byte) (b >> 8)); + deploymentNumberXorByteCodeDeploymentNumberXorMmuInstXorToAddressHi.put((byte) b); + return this; } @@ -1601,13 +1224,11 @@ public Trace pAccountDeploymentNumberFinalInBlock(final long b) { filled.set(101); } - if (b >= 65536L) { - throw new IllegalArgumentException( - "hub.account/DEPLOYMENT_NUMBER_FINAL_IN_BLOCK has invalid value (" + b + ")"); - } + if(b >= 65536L) { throw new IllegalArgumentException("hub.account/DEPLOYMENT_NUMBER_FINAL_IN_BLOCK has invalid value (" + b + ")"); } deploymentNumberFinalInBlockXorDeploymentNumberFinalInBlock.put((byte) (b >> 8)); deploymentNumberFinalInBlockXorDeploymentNumberFinalInBlock.put((byte) b); + return this; } @@ -1618,13 +1239,11 @@ public Trace pAccountDeploymentNumberFirstInBlock(final long b) { filled.set(102); } - if (b >= 65536L) { - throw new IllegalArgumentException( - "hub.account/DEPLOYMENT_NUMBER_FIRST_IN_BLOCK has invalid value (" + b + ")"); - } + if(b >= 65536L) { throw new IllegalArgumentException("hub.account/DEPLOYMENT_NUMBER_FIRST_IN_BLOCK has invalid value (" + b + ")"); } deploymentNumberFirstInBlockXorDeploymentNumberFirstInBlock.put((byte) (b >> 8)); deploymentNumberFirstInBlockXorDeploymentNumberFirstInBlock.put((byte) b); + return this; } @@ -1635,14 +1254,12 @@ public Trace pAccountDeploymentNumberInfty(final long b) { filled.set(108); } - if (b >= 4294967296L) { - throw new IllegalArgumentException( - "hub.account/DEPLOYMENT_NUMBER_INFTY has invalid value (" + b + ")"); - } - deploymentNumberInftyXorByteCodeDeploymentStatusXorMmuPhaseXorPrcRao.put((byte) (b >> 24)); - deploymentNumberInftyXorByteCodeDeploymentStatusXorMmuPhaseXorPrcRao.put((byte) (b >> 16)); - deploymentNumberInftyXorByteCodeDeploymentStatusXorMmuPhaseXorPrcRao.put((byte) (b >> 8)); - deploymentNumberInftyXorByteCodeDeploymentStatusXorMmuPhaseXorPrcRao.put((byte) b); + if(b >= 4294967296L) { throw new IllegalArgumentException("hub.account/DEPLOYMENT_NUMBER_INFTY has invalid value (" + b + ")"); } + deploymentNumberInftyXorByteCodeDeploymentStatusXorMmuPhase.put((byte) (b >> 24)); + deploymentNumberInftyXorByteCodeDeploymentStatusXorMmuPhase.put((byte) (b >> 16)); + deploymentNumberInftyXorByteCodeDeploymentStatusXorMmuPhase.put((byte) (b >> 8)); + deploymentNumberInftyXorByteCodeDeploymentStatusXorMmuPhase.put((byte) b); + return this; } @@ -1654,14 +1271,12 @@ public Trace pAccountDeploymentNumberNew(final long b) { filled.set(109); } - if (b >= 4294967296L) { - throw new IllegalArgumentException( - "hub.account/DEPLOYMENT_NUMBER_NEW has invalid value (" + b + ")"); - } - deploymentNumberNewXorCallerAddressHiXorMmuRefOffsetXorPrcReturnGas.put((byte) (b >> 24)); - deploymentNumberNewXorCallerAddressHiXorMmuRefOffsetXorPrcReturnGas.put((byte) (b >> 16)); - deploymentNumberNewXorCallerAddressHiXorMmuRefOffsetXorPrcReturnGas.put((byte) (b >> 8)); - deploymentNumberNewXorCallerAddressHiXorMmuRefOffsetXorPrcReturnGas.put((byte) b); + if(b >= 4294967296L) { throw new IllegalArgumentException("hub.account/DEPLOYMENT_NUMBER_NEW has invalid value (" + b + ")"); } + deploymentNumberNewXorCallerAddressHiXorMmuRefOffset.put((byte) (b >> 24)); + deploymentNumberNewXorCallerAddressHiXorMmuRefOffset.put((byte) (b >> 16)); + deploymentNumberNewXorCallerAddressHiXorMmuRefOffset.put((byte) (b >> 8)); + deploymentNumberNewXorCallerAddressHiXorMmuRefOffset.put((byte) b); + return this; } @@ -1673,8 +1288,7 @@ public Trace pAccountDeploymentStatus(final Boolean b) { filled.set(48); } - deploymentStatusXorMmuSuccessBitXorCallEoaSuccessCallerWontRevertXorBtcFlagXorFinalInBlkXorRequiresEvmExecution - .put((byte) (b ? 1 : 0)); + deploymentStatusXorMmuSuccessBitXorCallEoaSuccessCallerWontRevertXorBtcFlagXorFinalInBlkXorRequiresEvmExecution.put((byte) (b ? 1 : 0)); return this; } @@ -1686,8 +1300,7 @@ public Trace pAccountDeploymentStatusInfty(final Boolean b) { filled.set(49); } - deploymentStatusInftyXorMxpDeploysXorCallExceptionXorCallFlagXorFinalInCnfXorStatusCode.put( - (byte) (b ? 1 : 0)); + deploymentStatusInftyXorMxpDeploysXorCallExceptionXorCallFlagXorFinalInCnfXorStatusCode.put((byte) (b ? 1 : 0)); return this; } @@ -1711,8 +1324,7 @@ public Trace pAccountExists(final Boolean b) { filled.set(51); } - existsXorMxpMtntopXorCallPrcSuccessCallerWillRevertXorCopyFlagXorFirstInBlk.put( - (byte) (b ? 1 : 0)); + existsXorMxpMtntopXorCallPrcSuccessCallerWillRevertXorCopyFlagXorFirstInBlk.put((byte) (b ? 1 : 0)); return this; } @@ -1724,8 +1336,7 @@ public Trace pAccountExistsNew(final Boolean b) { filled.set(52); } - existsNewXorMxpMxpxXorCallPrcSuccessCallerWontRevertXorCreateFlagXorFirstInCnf.put( - (byte) (b ? 1 : 0)); + existsNewXorMxpMxpxXorCallPrcSuccessCallerWontRevertXorCreateFlagXorFirstInCnf.put((byte) (b ? 1 : 0)); return this; } @@ -1737,8 +1348,7 @@ public Trace pAccountFinalInBlk(final Boolean b) { filled.set(53); } - finalInBlkXorMxpSize1NonzeroNoMxpxXorCallSmcFailureCallerWillRevertXorDecFlag1XorFirstInTxn.put( - (byte) (b ? 1 : 0)); + finalInBlkXorMxpSize1NonzeroNoMxpxXorCallSmcFailureCallerWillRevertXorDecFlag1XorFirstInTxn.put((byte) (b ? 1 : 0)); return this; } @@ -1750,8 +1360,7 @@ public Trace pAccountFinalInCnf(final Boolean b) { filled.set(54); } - finalInCnfXorMxpSize2NonzeroNoMxpxXorCallSmcFailureCallerWontRevertXorDecFlag2XorValueCurrChanges - .put((byte) (b ? 1 : 0)); + finalInCnfXorMxpSize2NonzeroNoMxpxXorCallSmcFailureCallerWontRevertXorDecFlag2XorValueCurrChanges.put((byte) (b ? 1 : 0)); return this; } @@ -1763,8 +1372,7 @@ public Trace pAccountFinalInTxn(final Boolean b) { filled.set(55); } - finalInTxnXorOobFlagXorCallSmcSuccessCallerWillRevertXorDecFlag3XorValueCurrIsOrig.put( - (byte) (b ? 1 : 0)); + finalInTxnXorOobFlagXorCallSmcSuccessCallerWillRevertXorDecFlag3XorValueCurrIsOrig.put((byte) (b ? 1 : 0)); return this; } @@ -1776,8 +1384,7 @@ public Trace pAccountFirstInBlk(final Boolean b) { filled.set(56); } - firstInBlkXorStpExistsXorCallSmcSuccessCallerWontRevertXorDecFlag4XorValueCurrIsZero.put( - (byte) (b ? 1 : 0)); + firstInBlkXorStpExistsXorCallSmcSuccessCallerWontRevertXorDecFlag4XorValueCurrIsZero.put((byte) (b ? 1 : 0)); return this; } @@ -1801,8 +1408,7 @@ public Trace pAccountFirstInTxn(final Boolean b) { filled.set(58); } - firstInTxnXorStpOogxXorCreateEmptyInitCodeWillRevertXorExtFlagXorValueNextIsOrig.put( - (byte) (b ? 1 : 0)); + firstInTxnXorStpOogxXorCreateEmptyInitCodeWillRevertXorExtFlagXorValueNextIsOrig.put((byte) (b ? 1 : 0)); return this; } @@ -1814,8 +1420,7 @@ public Trace pAccountHasCode(final Boolean b) { filled.set(59); } - hasCodeXorStpWarmthXorCreateEmptyInitCodeWontRevertXorHaltFlagXorValueNextIsZero.put( - (byte) (b ? 1 : 0)); + hasCodeXorStpWarmthXorCreateEmptyInitCodeWontRevertXorHaltFlagXorValueNextIsZero.put((byte) (b ? 1 : 0)); return this; } @@ -1851,8 +1456,7 @@ public Trace pAccountMarkedForSelfdestruct(final Boolean b) { filled.set(62); } - markedForSelfdestructXorCreateFailureConditionWontRevertXorInvalidFlagXorWarmthNew.put( - (byte) (b ? 1 : 0)); + markedForSelfdestructXorCreateFailureConditionWontRevertXorInvalidFlagXorWarmthNew.put((byte) (b ? 1 : 0)); return this; } @@ -1864,8 +1468,7 @@ public Trace pAccountMarkedForSelfdestructNew(final Boolean b) { filled.set(63); } - markedForSelfdestructNewXorCreateNonemptyInitCodeFailureWillRevertXorJumpx.put( - (byte) (b ? 1 : 0)); + markedForSelfdestructNewXorCreateNonemptyInitCodeFailureWillRevertXorJumpx.put((byte) (b ? 1 : 0)); return this; } @@ -1880,18 +1483,11 @@ public Trace pAccountNonce(final Bytes b) { // Trim array to size Bytes bs = b.trimLeadingZeros(); // Sanity check against expected width - if (bs.bitLength() > 64) { - throw new IllegalArgumentException( - "hub.account/NONCE has invalid width (" + bs.bitLength() + "bits)"); - } + if(bs.bitLength() > 64) { throw new IllegalArgumentException("hub.account/NONCE has invalid width (" + bs.bitLength() + "bits)"); } // Write padding (if necessary) - for (int i = bs.size(); i < 8; i++) { - nonceXorStpGasMxpXorBasefee.put((byte) 0); - } + for(int i=bs.size(); i<8; i++) { nonceXorStpGasMxpXorPrcCalleeGasXorBasefee.put((byte) 0); } // Write bytes - for (int j = 0; j < bs.size(); j++) { - nonceXorStpGasMxpXorBasefee.put(bs.get(j)); - } + for(int j=0; j 64) { - throw new IllegalArgumentException( - "hub.account/NONCE_NEW has invalid width (" + bs.bitLength() + "bits)"); - } + if(bs.bitLength() > 64) { throw new IllegalArgumentException("hub.account/NONCE_NEW has invalid width (" + bs.bitLength() + "bits)"); } // Write padding (if necessary) - for (int i = bs.size(); i < 8; i++) { - nonceNewXorStpGasPaidOutOfPocketXorGasInitiallyAvailable.put((byte) 0); - } + for(int i=bs.size(); i<8; i++) { nonceNewXorStpGasPaidOutOfPocketXorPrcCallerGasXorGasInitiallyAvailable.put((byte) 0); } // Write bytes - for (int j = 0; j < bs.size(); j++) { - nonceNewXorStpGasPaidOutOfPocketXorGasInitiallyAvailable.put(bs.get(j)); - } + for(int j=0; j= 4294967296L) { - throw new IllegalArgumentException( - "hub.account/RLPADDR_DEP_ADDR_HI has invalid value (" + b + ")"); - } + if(b >= 4294967296L) { throw new IllegalArgumentException("hub.account/RLPADDR_DEP_ADDR_HI has invalid value (" + b + ")"); } rlpaddrDepAddrHiXorCallDataContextNumberXorMmuRefSize.put((byte) (b >> 24)); rlpaddrDepAddrHiXorCallDataContextNumberXorMmuRefSize.put((byte) (b >> 16)); rlpaddrDepAddrHiXorCallDataContextNumberXorMmuRefSize.put((byte) (b >> 8)); rlpaddrDepAddrHiXorCallDataContextNumberXorMmuRefSize.put((byte) b); + return this; } @@ -1951,18 +1538,11 @@ public Trace pAccountRlpaddrDepAddrLo(final Bytes b) { // Trim array to size Bytes bs = b.trimLeadingZeros(); // Sanity check against expected width - if (bs.bitLength() > 128) { - throw new IllegalArgumentException( - "hub.account/RLPADDR_DEP_ADDR_LO has invalid width (" + bs.bitLength() + "bits)"); - } + if(bs.bitLength() > 128) { throw new IllegalArgumentException("hub.account/RLPADDR_DEP_ADDR_LO has invalid width (" + bs.bitLength() + "bits)"); } // Write padding (if necessary) - for (int i = bs.size(); i < 16; i++) { - rlpaddrDepAddrLoXorMmuSrcOffsetHiXorStackItemValueHi4XorValueOrigHi.put((byte) 0); - } + for(int i=bs.size(); i<16; i++) { rlpaddrDepAddrLoXorMmuSrcOffsetHiXorStackItemValueHi4XorValueOrigHi.put((byte) 0); } // Write bytes - for (int j = 0; j < bs.size(); j++) { - rlpaddrDepAddrLoXorMmuSrcOffsetHiXorStackItemValueHi4XorValueOrigHi.put(bs.get(j)); - } + for(int j=0; j 128) { - throw new IllegalArgumentException( - "hub.account/RLPADDR_KEC_HI has invalid width (" + bs.bitLength() + "bits)"); - } + if(bs.bitLength() > 128) { throw new IllegalArgumentException("hub.account/RLPADDR_KEC_HI has invalid width (" + bs.bitLength() + "bits)"); } // Write padding (if necessary) - for (int i = bs.size(); i < 16; i++) { - rlpaddrKecHiXorMmuSrcOffsetLoXorStackItemValueLo1XorValueOrigLo.put((byte) 0); - } + for(int i=bs.size(); i<16; i++) { rlpaddrKecHiXorMmuSrcOffsetLoXorStackItemValueLo1XorValueOrigLo.put((byte) 0); } // Write bytes - for (int j = 0; j < bs.size(); j++) { - rlpaddrKecHiXorMmuSrcOffsetLoXorStackItemValueLo1XorValueOrigLo.put(bs.get(j)); - } + for(int j=0; j 128) { - throw new IllegalArgumentException( - "hub.account/RLPADDR_KEC_LO has invalid width (" + bs.bitLength() + "bits)"); - } + if(bs.bitLength() > 128) { throw new IllegalArgumentException("hub.account/RLPADDR_KEC_LO has invalid width (" + bs.bitLength() + "bits)"); } // Write padding (if necessary) - for (int i = bs.size(); i < 16; i++) { - rlpaddrKecLoXorMmuTgtOffsetLoXorStackItemValueLo2.put((byte) 0); - } + for(int i=bs.size(); i<16; i++) { rlpaddrKecLoXorMmuTgtOffsetLoXorStackItemValueLo2.put((byte) 0); } // Write bytes - for (int j = 0; j < bs.size(); j++) { - rlpaddrKecLoXorMmuTgtOffsetLoXorStackItemValueLo2.put(bs.get(j)); - } + for(int j=0; j= 256L) { - throw new IllegalArgumentException( - "hub.account/RLPADDR_RECIPE has invalid value (" + b + ")"); - } + if(b >= 256L) { throw new IllegalArgumentException("hub.account/RLPADDR_RECIPE has invalid value (" + b + ")"); } rlpaddrRecipe.put((byte) b); + return this; } @@ -2058,18 +1621,11 @@ public Trace pAccountRlpaddrSaltHi(final Bytes b) { // Trim array to size Bytes bs = b.trimLeadingZeros(); // Sanity check against expected width - if (bs.bitLength() > 128) { - throw new IllegalArgumentException( - "hub.account/RLPADDR_SALT_HI has invalid width (" + bs.bitLength() + "bits)"); - } + if(bs.bitLength() > 128) { throw new IllegalArgumentException("hub.account/RLPADDR_SALT_HI has invalid width (" + bs.bitLength() + "bits)"); } // Write padding (if necessary) - for (int i = bs.size(); i < 16; i++) { - rlpaddrSaltHiXorMxpGasMxpXorStackItemValueLo3.put((byte) 0); - } + for(int i=bs.size(); i<16; i++) { rlpaddrSaltHiXorMxpGasMxpXorStackItemValueLo3.put((byte) 0); } // Write bytes - for (int j = 0; j < bs.size(); j++) { - rlpaddrSaltHiXorMxpGasMxpXorStackItemValueLo3.put(bs.get(j)); - } + for(int j=0; j 128) { - throw new IllegalArgumentException( - "hub.account/RLPADDR_SALT_LO has invalid width (" + bs.bitLength() + "bits)"); - } + if(bs.bitLength() > 128) { throw new IllegalArgumentException("hub.account/RLPADDR_SALT_LO has invalid width (" + bs.bitLength() + "bits)"); } // Write padding (if necessary) - for (int i = bs.size(); i < 16; i++) { - rlpaddrSaltLoXorMxpOffset1HiXorStackItemValueLo4.put((byte) 0); - } + for(int i=bs.size(); i<16; i++) { rlpaddrSaltLoXorMxpOffset1HiXorStackItemValueLo4.put((byte) 0); } // Write bytes - for (int j = 0; j < bs.size(); j++) { - rlpaddrSaltLoXorMxpOffset1HiXorStackItemValueLo4.put(bs.get(j)); - } + for(int j=0; j 128) { - throw new IllegalArgumentException( - "hub.account/TRM_RAW_ADDRESS_HI has invalid width (" + bs.bitLength() + "bits)"); - } + if(bs.bitLength() > 128) { throw new IllegalArgumentException("hub.account/TRM_RAW_ADDRESS_HI has invalid width (" + bs.bitLength() + "bits)"); } // Write padding (if necessary) - for (int i = bs.size(); i < 16; i++) { - trmRawAddressHiXorMxpOffset1Lo.put((byte) 0); - } + for(int i=bs.size(); i<16; i++) { trmRawAddressHiXorMxpOffset1Lo.put((byte) 0); } // Write bytes - for (int j = 0; j < bs.size(); j++) { - trmRawAddressHiXorMxpOffset1Lo.put(bs.get(j)); - } + for(int j=0; j= 4294967296L) { - throw new IllegalArgumentException( - "hub.context/ACCOUNT_ADDRESS_HI has invalid value (" + b + ")"); - } - addressHiXorAccountAddressHiXorCcrsStampXorPrcCalleeGasXorStaticGasXorAddressHiXorCallDataSize - .put((byte) (b >> 24)); - addressHiXorAccountAddressHiXorCcrsStampXorPrcCalleeGasXorStaticGasXorAddressHiXorCallDataSize - .put((byte) (b >> 16)); - addressHiXorAccountAddressHiXorCcrsStampXorPrcCalleeGasXorStaticGasXorAddressHiXorCallDataSize - .put((byte) (b >> 8)); - addressHiXorAccountAddressHiXorCcrsStampXorPrcCalleeGasXorStaticGasXorAddressHiXorCallDataSize - .put((byte) b); + if(b >= 4294967296L) { throw new IllegalArgumentException("hub.context/ACCOUNT_ADDRESS_HI has invalid value (" + b + ")"); } + addressHiXorAccountAddressHiXorCcrsStampXorPrcCdoXorStaticGasXorAddressHiXorCallDataSize.put((byte) (b >> 24)); + addressHiXorAccountAddressHiXorCcrsStampXorPrcCdoXorStaticGasXorAddressHiXorCallDataSize.put((byte) (b >> 16)); + addressHiXorAccountAddressHiXorCcrsStampXorPrcCdoXorStaticGasXorAddressHiXorCallDataSize.put((byte) (b >> 8)); + addressHiXorAccountAddressHiXorCcrsStampXorPrcCdoXorStaticGasXorAddressHiXorCallDataSize.put((byte) b); + return this; } @@ -2207,20 +1743,11 @@ public Trace pContextAccountAddressLo(final Bytes b) { // Trim array to size Bytes bs = b.trimLeadingZeros(); // Sanity check against expected width - if (bs.bitLength() > 128) { - throw new IllegalArgumentException( - "hub.context/ACCOUNT_ADDRESS_LO has invalid width (" + bs.bitLength() + "bits)"); - } + if(bs.bitLength() > 128) { throw new IllegalArgumentException("hub.context/ACCOUNT_ADDRESS_LO has invalid width (" + bs.bitLength() + "bits)"); } // Write padding (if necessary) - for (int i = bs.size(); i < 16; i++) { - addressLoXorAccountAddressLoXorExpData1XorHashInfoKeccakHiXorAddressLoXorCoinbaseAddressLo - .put((byte) 0); - } + for(int i=bs.size(); i<16; i++) { addressLoXorAccountAddressLoXorExpData1XorHashInfoKeccakHiXorAddressLoXorCoinbaseAddressLo.put((byte) 0); } // Write bytes - for (int j = 0; j < bs.size(); j++) { - addressLoXorAccountAddressLoXorExpData1XorHashInfoKeccakHiXorAddressLoXorCoinbaseAddressLo - .put(bs.get(j)); - } + for(int j=0; j= 4294967296L) { - throw new IllegalArgumentException( - "hub.context/ACCOUNT_DEPLOYMENT_NUMBER has invalid value (" + b + ")"); - } - codeFragmentIndexXorAccountDeploymentNumberXorExpInstXorPrcCallerGasXorDeploymentNumberXorCoinbaseAddressHi - .put((byte) (b >> 24)); - codeFragmentIndexXorAccountDeploymentNumberXorExpInstXorPrcCallerGasXorDeploymentNumberXorCoinbaseAddressHi - .put((byte) (b >> 16)); - codeFragmentIndexXorAccountDeploymentNumberXorExpInstXorPrcCallerGasXorDeploymentNumberXorCoinbaseAddressHi - .put((byte) (b >> 8)); - codeFragmentIndexXorAccountDeploymentNumberXorExpInstXorPrcCallerGasXorDeploymentNumberXorCoinbaseAddressHi - .put((byte) b); + if(b >= 4294967296L) { throw new IllegalArgumentException("hub.context/ACCOUNT_DEPLOYMENT_NUMBER has invalid value (" + b + ")"); } + codeFragmentIndexXorAccountDeploymentNumberXorExpInstXorPrcCdsXorDeploymentNumberXorCoinbaseAddressHi.put((byte) (b >> 24)); + codeFragmentIndexXorAccountDeploymentNumberXorExpInstXorPrcCdsXorDeploymentNumberXorCoinbaseAddressHi.put((byte) (b >> 16)); + codeFragmentIndexXorAccountDeploymentNumberXorExpInstXorPrcCdsXorDeploymentNumberXorCoinbaseAddressHi.put((byte) (b >> 8)); + codeFragmentIndexXorAccountDeploymentNumberXorExpInstXorPrcCdsXorDeploymentNumberXorCoinbaseAddressHi.put((byte) b); + return this; } @@ -2255,18 +1776,12 @@ public Trace pContextByteCodeAddressHi(final long b) { filled.set(105); } - if (b >= 4294967296L) { - throw new IllegalArgumentException( - "hub.context/BYTE_CODE_ADDRESS_HI has invalid value (" + b + ")"); - } - codeSizeXorByteCodeAddressHiXorMmuAuxIdXorPrcCdoXorDeploymentNumberInftyXorFromAddressHi.put( - (byte) (b >> 24)); - codeSizeXorByteCodeAddressHiXorMmuAuxIdXorPrcCdoXorDeploymentNumberInftyXorFromAddressHi.put( - (byte) (b >> 16)); - codeSizeXorByteCodeAddressHiXorMmuAuxIdXorPrcCdoXorDeploymentNumberInftyXorFromAddressHi.put( - (byte) (b >> 8)); - codeSizeXorByteCodeAddressHiXorMmuAuxIdXorPrcCdoXorDeploymentNumberInftyXorFromAddressHi.put( - (byte) b); + if(b >= 4294967296L) { throw new IllegalArgumentException("hub.context/BYTE_CODE_ADDRESS_HI has invalid value (" + b + ")"); } + codeSizeXorByteCodeAddressHiXorMmuAuxIdXorPrcRacXorDeploymentNumberInftyXorFromAddressHi.put((byte) (b >> 24)); + codeSizeXorByteCodeAddressHiXorMmuAuxIdXorPrcRacXorDeploymentNumberInftyXorFromAddressHi.put((byte) (b >> 16)); + codeSizeXorByteCodeAddressHiXorMmuAuxIdXorPrcRacXorDeploymentNumberInftyXorFromAddressHi.put((byte) (b >> 8)); + codeSizeXorByteCodeAddressHiXorMmuAuxIdXorPrcRacXorDeploymentNumberInftyXorFromAddressHi.put((byte) b); + return this; } @@ -2281,20 +1796,11 @@ public Trace pContextByteCodeAddressLo(final Bytes b) { // Trim array to size Bytes bs = b.trimLeadingZeros(); // Sanity check against expected width - if (bs.bitLength() > 128) { - throw new IllegalArgumentException( - "hub.context/BYTE_CODE_ADDRESS_LO has invalid width (" + bs.bitLength() + "bits)"); - } + if(bs.bitLength() > 128) { throw new IllegalArgumentException("hub.context/BYTE_CODE_ADDRESS_LO has invalid width (" + bs.bitLength() + "bits)"); } // Write padding (if necessary) - for (int i = bs.size(); i < 16; i++) { - balanceXorByteCodeAddressLoXorExpData2XorHashInfoKeccakLoXorStorageKeyHiXorFromAddressLo.put( - (byte) 0); - } + for(int i=bs.size(); i<16; i++) { balanceXorByteCodeAddressLoXorExpData2XorHashInfoKeccakLoXorStorageKeyHiXorFromAddressLo.put((byte) 0); } // Write bytes - for (int j = 0; j < bs.size(); j++) { - balanceXorByteCodeAddressLoXorExpData2XorHashInfoKeccakLoXorStorageKeyHiXorFromAddressLo.put( - bs.get(j)); - } + for(int j=0; j= 4294967296L) { - throw new IllegalArgumentException( - "hub.context/BYTE_CODE_CODE_FRAGMENT_INDEX has invalid value (" + b + ")"); - } - codeSizeNewXorByteCodeCodeFragmentIndexXorMmuExoSumXorPrcCdsXorInitCodeSize.put( - (byte) (b >> 24)); - codeSizeNewXorByteCodeCodeFragmentIndexXorMmuExoSumXorPrcCdsXorInitCodeSize.put( - (byte) (b >> 16)); - codeSizeNewXorByteCodeCodeFragmentIndexXorMmuExoSumXorPrcCdsXorInitCodeSize.put( - (byte) (b >> 8)); - codeSizeNewXorByteCodeCodeFragmentIndexXorMmuExoSumXorPrcCdsXorInitCodeSize.put((byte) b); + if(b >= 4294967296L) { throw new IllegalArgumentException("hub.context/BYTE_CODE_CODE_FRAGMENT_INDEX has invalid value (" + b + ")"); } + codeSizeNewXorByteCodeCodeFragmentIndexXorMmuExoSumXorPrcRaoXorInitCodeSize.put((byte) (b >> 24)); + codeSizeNewXorByteCodeCodeFragmentIndexXorMmuExoSumXorPrcRaoXorInitCodeSize.put((byte) (b >> 16)); + codeSizeNewXorByteCodeCodeFragmentIndexXorMmuExoSumXorPrcRaoXorInitCodeSize.put((byte) (b >> 8)); + codeSizeNewXorByteCodeCodeFragmentIndexXorMmuExoSumXorPrcRaoXorInitCodeSize.put((byte) b); + return this; } @@ -2328,17 +1829,12 @@ public Trace pContextByteCodeDeploymentNumber(final long b) { filled.set(107); } - if (b >= 4294967296L) { - throw new IllegalArgumentException( - "hub.context/BYTE_CODE_DEPLOYMENT_NUMBER has invalid value (" + b + ")"); - } - deploymentNumberXorByteCodeDeploymentNumberXorMmuInstXorPrcRacXorToAddressHi.put( - (byte) (b >> 24)); - deploymentNumberXorByteCodeDeploymentNumberXorMmuInstXorPrcRacXorToAddressHi.put( - (byte) (b >> 16)); - deploymentNumberXorByteCodeDeploymentNumberXorMmuInstXorPrcRacXorToAddressHi.put( - (byte) (b >> 8)); - deploymentNumberXorByteCodeDeploymentNumberXorMmuInstXorPrcRacXorToAddressHi.put((byte) b); + if(b >= 4294967296L) { throw new IllegalArgumentException("hub.context/BYTE_CODE_DEPLOYMENT_NUMBER has invalid value (" + b + ")"); } + deploymentNumberXorByteCodeDeploymentNumberXorMmuInstXorToAddressHi.put((byte) (b >> 24)); + deploymentNumberXorByteCodeDeploymentNumberXorMmuInstXorToAddressHi.put((byte) (b >> 16)); + deploymentNumberXorByteCodeDeploymentNumberXorMmuInstXorToAddressHi.put((byte) (b >> 8)); + deploymentNumberXorByteCodeDeploymentNumberXorMmuInstXorToAddressHi.put((byte) b); + return this; } @@ -2350,14 +1846,12 @@ public Trace pContextByteCodeDeploymentStatus(final long b) { filled.set(108); } - if (b >= 4294967296L) { - throw new IllegalArgumentException( - "hub.context/BYTE_CODE_DEPLOYMENT_STATUS has invalid value (" + b + ")"); - } - deploymentNumberInftyXorByteCodeDeploymentStatusXorMmuPhaseXorPrcRao.put((byte) (b >> 24)); - deploymentNumberInftyXorByteCodeDeploymentStatusXorMmuPhaseXorPrcRao.put((byte) (b >> 16)); - deploymentNumberInftyXorByteCodeDeploymentStatusXorMmuPhaseXorPrcRao.put((byte) (b >> 8)); - deploymentNumberInftyXorByteCodeDeploymentStatusXorMmuPhaseXorPrcRao.put((byte) b); + if(b >= 4294967296L) { throw new IllegalArgumentException("hub.context/BYTE_CODE_DEPLOYMENT_STATUS has invalid value (" + b + ")"); } + deploymentNumberInftyXorByteCodeDeploymentStatusXorMmuPhase.put((byte) (b >> 24)); + deploymentNumberInftyXorByteCodeDeploymentStatusXorMmuPhase.put((byte) (b >> 16)); + deploymentNumberInftyXorByteCodeDeploymentStatusXorMmuPhase.put((byte) (b >> 8)); + deploymentNumberInftyXorByteCodeDeploymentStatusXorMmuPhase.put((byte) b); + return this; } @@ -2369,15 +1863,13 @@ public Trace pContextCallDataContextNumber(final long b) { filled.set(110); } - if (b >= 4294967296L) { - throw new IllegalArgumentException( - "hub.context/CALL_DATA_CONTEXT_NUMBER has invalid value (" + b + ")"); - } + if(b >= 4294967296L) { throw new IllegalArgumentException("hub.context/CALL_DATA_CONTEXT_NUMBER has invalid value (" + b + ")"); } rlpaddrDepAddrHiXorCallDataContextNumberXorMmuRefSize.put((byte) (b >> 24)); rlpaddrDepAddrHiXorCallDataContextNumberXorMmuRefSize.put((byte) (b >> 16)); rlpaddrDepAddrHiXorCallDataContextNumberXorMmuRefSize.put((byte) (b >> 8)); rlpaddrDepAddrHiXorCallDataContextNumberXorMmuRefSize.put((byte) b); + return this; } @@ -2388,15 +1880,13 @@ public Trace pContextCallDataOffset(final long b) { filled.set(111); } - if (b >= 4294967296L) { - throw new IllegalArgumentException( - "hub.context/CALL_DATA_OFFSET has invalid value (" + b + ")"); - } + if(b >= 4294967296L) { throw new IllegalArgumentException("hub.context/CALL_DATA_OFFSET has invalid value (" + b + ")"); } callDataOffsetXorMmuSize.put((byte) (b >> 24)); callDataOffsetXorMmuSize.put((byte) (b >> 16)); callDataOffsetXorMmuSize.put((byte) (b >> 8)); callDataOffsetXorMmuSize.put((byte) b); + return this; } @@ -2407,15 +1897,13 @@ public Trace pContextCallDataSize(final long b) { filled.set(112); } - if (b >= 4294967296L) { - throw new IllegalArgumentException( - "hub.context/CALL_DATA_SIZE has invalid value (" + b + ")"); - } + if(b >= 4294967296L) { throw new IllegalArgumentException("hub.context/CALL_DATA_SIZE has invalid value (" + b + ")"); } callDataSizeXorMmuSrcId.put((byte) (b >> 24)); callDataSizeXorMmuSrcId.put((byte) (b >> 16)); callDataSizeXorMmuSrcId.put((byte) (b >> 8)); callDataSizeXorMmuSrcId.put((byte) b); + return this; } @@ -2426,13 +1914,11 @@ public Trace pContextCallStackDepth(final long b) { filled.set(97); } - if (b >= 2048L) { - throw new IllegalArgumentException( - "hub.context/CALL_STACK_DEPTH has invalid value (" + b + ")"); - } + if(b >= 2048L) { throw new IllegalArgumentException("hub.context/CALL_STACK_DEPTH has invalid value (" + b + ")"); } callStackDepthXorStackItemHeight1.put((byte) (b >> 8)); callStackDepthXorStackItemHeight1.put((byte) b); + return this; } @@ -2446,18 +1932,11 @@ public Trace pContextCallValue(final Bytes b) { // Trim array to size Bytes bs = b.trimLeadingZeros(); // Sanity check against expected width - if (bs.bitLength() > 128) { - throw new IllegalArgumentException( - "hub.context/CALL_VALUE has invalid width (" + bs.bitLength() + "bits)"); - } + if(bs.bitLength() > 128) { throw new IllegalArgumentException("hub.context/CALL_VALUE has invalid width (" + bs.bitLength() + "bits)"); } // Write padding (if necessary) - for (int i = bs.size(); i < 16; i++) { - codeHashHiXorCallValueXorExpData4XorPushValueLoXorValueCurrHiXorToAddressLo.put((byte) 0); - } + for(int i=bs.size(); i<16; i++) { codeHashHiXorCallValueXorExpData4XorPushValueLoXorValueCurrHiXorToAddressLo.put((byte) 0); } // Write bytes - for (int j = 0; j < bs.size(); j++) { - codeHashHiXorCallValueXorExpData4XorPushValueLoXorValueCurrHiXorToAddressLo.put(bs.get(j)); - } + for(int j=0; j= 4294967296L) { - throw new IllegalArgumentException( - "hub.context/CALLER_ADDRESS_HI has invalid value (" + b + ")"); - } - deploymentNumberNewXorCallerAddressHiXorMmuRefOffsetXorPrcReturnGas.put((byte) (b >> 24)); - deploymentNumberNewXorCallerAddressHiXorMmuRefOffsetXorPrcReturnGas.put((byte) (b >> 16)); - deploymentNumberNewXorCallerAddressHiXorMmuRefOffsetXorPrcReturnGas.put((byte) (b >> 8)); - deploymentNumberNewXorCallerAddressHiXorMmuRefOffsetXorPrcReturnGas.put((byte) b); + if(b >= 4294967296L) { throw new IllegalArgumentException("hub.context/CALLER_ADDRESS_HI has invalid value (" + b + ")"); } + deploymentNumberNewXorCallerAddressHiXorMmuRefOffset.put((byte) (b >> 24)); + deploymentNumberNewXorCallerAddressHiXorMmuRefOffset.put((byte) (b >> 16)); + deploymentNumberNewXorCallerAddressHiXorMmuRefOffset.put((byte) (b >> 8)); + deploymentNumberNewXorCallerAddressHiXorMmuRefOffset.put((byte) b); + return this; } @@ -2491,20 +1968,11 @@ public Trace pContextCallerAddressLo(final Bytes b) { // Trim array to size Bytes bs = b.trimLeadingZeros(); // Sanity check against expected width - if (bs.bitLength() > 128) { - throw new IllegalArgumentException( - "hub.context/CALLER_ADDRESS_LO has invalid width (" + bs.bitLength() + "bits)"); - } + if(bs.bitLength() > 128) { throw new IllegalArgumentException("hub.context/CALLER_ADDRESS_LO has invalid width (" + bs.bitLength() + "bits)"); } // Write padding (if necessary) - for (int i = bs.size(); i < 16; i++) { - balanceNewXorCallerAddressLoXorExpData3XorPushValueHiXorStorageKeyLoXorInitialBalance.put( - (byte) 0); - } + for(int i=bs.size(); i<16; i++) { balanceNewXorCallerAddressLoXorExpData3XorPushValueHiXorStorageKeyLoXorInitialBalance.put((byte) 0); } // Write bytes - for (int j = 0; j < bs.size(); j++) { - balanceNewXorCallerAddressLoXorExpData3XorPushValueHiXorStorageKeyLoXorInitialBalance.put( - bs.get(j)); - } + for(int j=0; j= 4294967296L) { - throw new IllegalArgumentException( - "hub.context/CONTEXT_NUMBER has invalid value (" + b + ")"); - } + if(b >= 4294967296L) { throw new IllegalArgumentException("hub.context/CONTEXT_NUMBER has invalid value (" + b + ")"); } contextNumberXorMmuTgtId.put((byte) (b >> 24)); contextNumberXorMmuTgtId.put((byte) (b >> 16)); contextNumberXorMmuTgtId.put((byte) (b >> 8)); contextNumberXorMmuTgtId.put((byte) b); + return this; } @@ -2535,8 +2001,7 @@ public Trace pContextIsRoot(final Boolean b) { filled.set(45); } - againInBlkXorIsRootXorCcsrFlagXorCallAbortWillRevertXorAccFlagXorAgainInBlkXorCopyTxcd.put( - (byte) (b ? 1 : 0)); + againInBlkXorIsRootXorCcsrFlagXorCallAbortWillRevertXorAccFlagXorAgainInBlkXorCopyTxcd.put((byte) (b ? 1 : 0)); return this; } @@ -2548,8 +2013,7 @@ public Trace pContextIsStatic(final Boolean b) { filled.set(46); } - againInCnfXorIsStaticXorExpFlagXorCallAbortWontRevertXorAddFlagXorAgainInCnfXorIsDeployment.put( - (byte) (b ? 1 : 0)); + againInCnfXorIsStaticXorExpFlagXorCallAbortWontRevertXorAddFlagXorAgainInCnfXorIsDeployment.put((byte) (b ? 1 : 0)); return this; } @@ -2561,15 +2025,13 @@ public Trace pContextReturnAtCapacity(final long b) { filled.set(114); } - if (b >= 4294967296L) { - throw new IllegalArgumentException( - "hub.context/RETURN_AT_CAPACITY has invalid value (" + b + ")"); - } + if(b >= 4294967296L) { throw new IllegalArgumentException("hub.context/RETURN_AT_CAPACITY has invalid value (" + b + ")"); } returnAtCapacityXorMxpInst.put((byte) (b >> 24)); returnAtCapacityXorMxpInst.put((byte) (b >> 16)); returnAtCapacityXorMxpInst.put((byte) (b >> 8)); returnAtCapacityXorMxpInst.put((byte) b); + return this; } @@ -2580,15 +2042,13 @@ public Trace pContextReturnAtOffset(final long b) { filled.set(115); } - if (b >= 4294967296L) { - throw new IllegalArgumentException( - "hub.context/RETURN_AT_OFFSET has invalid value (" + b + ")"); - } + if(b >= 4294967296L) { throw new IllegalArgumentException("hub.context/RETURN_AT_OFFSET has invalid value (" + b + ")"); } returnAtOffsetXorOobInst.put((byte) (b >> 24)); returnAtOffsetXorOobInst.put((byte) (b >> 16)); returnAtOffsetXorOobInst.put((byte) (b >> 8)); returnAtOffsetXorOobInst.put((byte) b); + return this; } @@ -2599,15 +2059,13 @@ public Trace pContextReturnDataContextNumber(final long b) { filled.set(116); } - if (b >= 4294967296L) { - throw new IllegalArgumentException( - "hub.context/RETURN_DATA_CONTEXT_NUMBER has invalid value (" + b + ")"); - } + if(b >= 4294967296L) { throw new IllegalArgumentException("hub.context/RETURN_DATA_CONTEXT_NUMBER has invalid value (" + b + ")"); } returnDataContextNumberXorStpGasStipend.put((byte) (b >> 24)); returnDataContextNumberXorStpGasStipend.put((byte) (b >> 16)); returnDataContextNumberXorStpGasStipend.put((byte) (b >> 8)); returnDataContextNumberXorStpGasStipend.put((byte) b); + return this; } @@ -2618,15 +2076,13 @@ public Trace pContextReturnDataOffset(final long b) { filled.set(117); } - if (b >= 4294967296L) { - throw new IllegalArgumentException( - "hub.context/RETURN_DATA_OFFSET has invalid value (" + b + ")"); - } + if(b >= 4294967296L) { throw new IllegalArgumentException("hub.context/RETURN_DATA_OFFSET has invalid value (" + b + ")"); } returnDataOffsetXorStpInstruction.put((byte) (b >> 24)); returnDataOffsetXorStpInstruction.put((byte) (b >> 16)); returnDataOffsetXorStpInstruction.put((byte) (b >> 8)); returnDataOffsetXorStpInstruction.put((byte) b); + return this; } @@ -2637,15 +2093,13 @@ public Trace pContextReturnDataSize(final long b) { filled.set(118); } - if (b >= 4294967296L) { - throw new IllegalArgumentException( - "hub.context/RETURN_DATA_SIZE has invalid value (" + b + ")"); - } + if(b >= 4294967296L) { throw new IllegalArgumentException("hub.context/RETURN_DATA_SIZE has invalid value (" + b + ")"); } returnDataSize.put((byte) (b >> 24)); returnDataSize.put((byte) (b >> 16)); returnDataSize.put((byte) (b >> 8)); returnDataSize.put((byte) b); + return this; } @@ -2656,8 +2110,7 @@ public Trace pContextUpdate(final Boolean b) { filled.set(47); } - againInTxnXorUpdateXorMmuFlagXorCallEoaSuccessCallerWillRevertXorBinFlagXorAgainInTxnXorIsType2 - .put((byte) (b ? 1 : 0)); + againInTxnXorUpdateXorMmuFlagXorCallEoaSuccessCallerWillRevertXorBinFlagXorAgainInTxnXorIsType2.put((byte) (b ? 1 : 0)); return this; } @@ -2669,17 +2122,12 @@ public Trace pMiscCcrsStamp(final long b) { filled.set(103); } - if (b >= 4294967296L) { - throw new IllegalArgumentException("hub.misc/CCRS_STAMP has invalid value (" + b + ")"); - } - addressHiXorAccountAddressHiXorCcrsStampXorPrcCalleeGasXorStaticGasXorAddressHiXorCallDataSize - .put((byte) (b >> 24)); - addressHiXorAccountAddressHiXorCcrsStampXorPrcCalleeGasXorStaticGasXorAddressHiXorCallDataSize - .put((byte) (b >> 16)); - addressHiXorAccountAddressHiXorCcrsStampXorPrcCalleeGasXorStaticGasXorAddressHiXorCallDataSize - .put((byte) (b >> 8)); - addressHiXorAccountAddressHiXorCcrsStampXorPrcCalleeGasXorStaticGasXorAddressHiXorCallDataSize - .put((byte) b); + if(b >= 4294967296L) { throw new IllegalArgumentException("hub.misc/CCRS_STAMP has invalid value (" + b + ")"); } + addressHiXorAccountAddressHiXorCcrsStampXorPrcCdoXorStaticGasXorAddressHiXorCallDataSize.put((byte) (b >> 24)); + addressHiXorAccountAddressHiXorCcrsStampXorPrcCdoXorStaticGasXorAddressHiXorCallDataSize.put((byte) (b >> 16)); + addressHiXorAccountAddressHiXorCcrsStampXorPrcCdoXorStaticGasXorAddressHiXorCallDataSize.put((byte) (b >> 8)); + addressHiXorAccountAddressHiXorCcrsStampXorPrcCdoXorStaticGasXorAddressHiXorCallDataSize.put((byte) b); + return this; } @@ -2691,8 +2139,7 @@ public Trace pMiscCcsrFlag(final Boolean b) { filled.set(45); } - againInBlkXorIsRootXorCcsrFlagXorCallAbortWillRevertXorAccFlagXorAgainInBlkXorCopyTxcd.put( - (byte) (b ? 1 : 0)); + againInBlkXorIsRootXorCcsrFlagXorCallAbortWillRevertXorAccFlagXorAgainInBlkXorCopyTxcd.put((byte) (b ? 1 : 0)); return this; } @@ -2707,20 +2154,11 @@ public Trace pMiscExpData1(final Bytes b) { // Trim array to size Bytes bs = b.trimLeadingZeros(); // Sanity check against expected width - if (bs.bitLength() > 128) { - throw new IllegalArgumentException( - "hub.misc/EXP_DATA_1 has invalid width (" + bs.bitLength() + "bits)"); - } + if(bs.bitLength() > 128) { throw new IllegalArgumentException("hub.misc/EXP_DATA_1 has invalid width (" + bs.bitLength() + "bits)"); } // Write padding (if necessary) - for (int i = bs.size(); i < 16; i++) { - addressLoXorAccountAddressLoXorExpData1XorHashInfoKeccakHiXorAddressLoXorCoinbaseAddressLo - .put((byte) 0); - } + for(int i=bs.size(); i<16; i++) { addressLoXorAccountAddressLoXorExpData1XorHashInfoKeccakHiXorAddressLoXorCoinbaseAddressLo.put((byte) 0); } // Write bytes - for (int j = 0; j < bs.size(); j++) { - addressLoXorAccountAddressLoXorExpData1XorHashInfoKeccakHiXorAddressLoXorCoinbaseAddressLo - .put(bs.get(j)); - } + for(int j=0; j 128) { - throw new IllegalArgumentException( - "hub.misc/EXP_DATA_2 has invalid width (" + bs.bitLength() + "bits)"); - } + if(bs.bitLength() > 128) { throw new IllegalArgumentException("hub.misc/EXP_DATA_2 has invalid width (" + bs.bitLength() + "bits)"); } // Write padding (if necessary) - for (int i = bs.size(); i < 16; i++) { - balanceXorByteCodeAddressLoXorExpData2XorHashInfoKeccakLoXorStorageKeyHiXorFromAddressLo.put( - (byte) 0); - } + for(int i=bs.size(); i<16; i++) { balanceXorByteCodeAddressLoXorExpData2XorHashInfoKeccakLoXorStorageKeyHiXorFromAddressLo.put((byte) 0); } // Write bytes - for (int j = 0; j < bs.size(); j++) { - balanceXorByteCodeAddressLoXorExpData2XorHashInfoKeccakLoXorStorageKeyHiXorFromAddressLo.put( - bs.get(j)); - } + for(int j=0; j 128) { - throw new IllegalArgumentException( - "hub.misc/EXP_DATA_3 has invalid width (" + bs.bitLength() + "bits)"); - } + if(bs.bitLength() > 128) { throw new IllegalArgumentException("hub.misc/EXP_DATA_3 has invalid width (" + bs.bitLength() + "bits)"); } // Write padding (if necessary) - for (int i = bs.size(); i < 16; i++) { - balanceNewXorCallerAddressLoXorExpData3XorPushValueHiXorStorageKeyLoXorInitialBalance.put( - (byte) 0); - } + for(int i=bs.size(); i<16; i++) { balanceNewXorCallerAddressLoXorExpData3XorPushValueHiXorStorageKeyLoXorInitialBalance.put((byte) 0); } // Write bytes - for (int j = 0; j < bs.size(); j++) { - balanceNewXorCallerAddressLoXorExpData3XorPushValueHiXorStorageKeyLoXorInitialBalance.put( - bs.get(j)); - } + for(int j=0; j 128) { - throw new IllegalArgumentException( - "hub.misc/EXP_DATA_4 has invalid width (" + bs.bitLength() + "bits)"); - } + if(bs.bitLength() > 128) { throw new IllegalArgumentException("hub.misc/EXP_DATA_4 has invalid width (" + bs.bitLength() + "bits)"); } // Write padding (if necessary) - for (int i = bs.size(); i < 16; i++) { - codeHashHiXorCallValueXorExpData4XorPushValueLoXorValueCurrHiXorToAddressLo.put((byte) 0); - } + for(int i=bs.size(); i<16; i++) { codeHashHiXorCallValueXorExpData4XorPushValueLoXorValueCurrHiXorToAddressLo.put((byte) 0); } // Write bytes - for (int j = 0; j < bs.size(); j++) { - codeHashHiXorCallValueXorExpData4XorPushValueLoXorValueCurrHiXorToAddressLo.put(bs.get(j)); - } + for(int j=0; j 128) { - throw new IllegalArgumentException( - "hub.misc/EXP_DATA_5 has invalid width (" + bs.bitLength() + "bits)"); - } + if(bs.bitLength() > 128) { throw new IllegalArgumentException("hub.misc/EXP_DATA_5 has invalid width (" + bs.bitLength() + "bits)"); } // Write padding (if necessary) - for (int i = bs.size(); i < 16; i++) { - codeHashHiNewXorExpData5XorStackItemValueHi1XorValueCurrLoXorValue.put((byte) 0); - } + for(int i=bs.size(); i<16; i++) { codeHashHiNewXorExpData5XorStackItemValueHi1XorValueCurrLoXorValue.put((byte) 0); } // Write bytes - for (int j = 0; j < bs.size(); j++) { - codeHashHiNewXorExpData5XorStackItemValueHi1XorValueCurrLoXorValue.put(bs.get(j)); - } + for(int j=0; j= 4294967296L) { - throw new IllegalArgumentException("hub.misc/EXP_INST has invalid value (" + b + ")"); - } - codeFragmentIndexXorAccountDeploymentNumberXorExpInstXorPrcCallerGasXorDeploymentNumberXorCoinbaseAddressHi - .put((byte) (b >> 24)); - codeFragmentIndexXorAccountDeploymentNumberXorExpInstXorPrcCallerGasXorDeploymentNumberXorCoinbaseAddressHi - .put((byte) (b >> 16)); - codeFragmentIndexXorAccountDeploymentNumberXorExpInstXorPrcCallerGasXorDeploymentNumberXorCoinbaseAddressHi - .put((byte) (b >> 8)); - codeFragmentIndexXorAccountDeploymentNumberXorExpInstXorPrcCallerGasXorDeploymentNumberXorCoinbaseAddressHi - .put((byte) b); + if(b >= 4294967296L) { throw new IllegalArgumentException("hub.misc/EXP_INST has invalid value (" + b + ")"); } + codeFragmentIndexXorAccountDeploymentNumberXorExpInstXorPrcCdsXorDeploymentNumberXorCoinbaseAddressHi.put((byte) (b >> 24)); + codeFragmentIndexXorAccountDeploymentNumberXorExpInstXorPrcCdsXorDeploymentNumberXorCoinbaseAddressHi.put((byte) (b >> 16)); + codeFragmentIndexXorAccountDeploymentNumberXorExpInstXorPrcCdsXorDeploymentNumberXorCoinbaseAddressHi.put((byte) (b >> 8)); + codeFragmentIndexXorAccountDeploymentNumberXorExpInstXorPrcCdsXorDeploymentNumberXorCoinbaseAddressHi.put((byte) b); + return this; } @@ -2875,17 +2275,12 @@ public Trace pMiscMmuAuxId(final long b) { filled.set(105); } - if (b >= 4294967296L) { - throw new IllegalArgumentException("hub.misc/MMU_AUX_ID has invalid value (" + b + ")"); - } - codeSizeXorByteCodeAddressHiXorMmuAuxIdXorPrcCdoXorDeploymentNumberInftyXorFromAddressHi.put( - (byte) (b >> 24)); - codeSizeXorByteCodeAddressHiXorMmuAuxIdXorPrcCdoXorDeploymentNumberInftyXorFromAddressHi.put( - (byte) (b >> 16)); - codeSizeXorByteCodeAddressHiXorMmuAuxIdXorPrcCdoXorDeploymentNumberInftyXorFromAddressHi.put( - (byte) (b >> 8)); - codeSizeXorByteCodeAddressHiXorMmuAuxIdXorPrcCdoXorDeploymentNumberInftyXorFromAddressHi.put( - (byte) b); + if(b >= 4294967296L) { throw new IllegalArgumentException("hub.misc/MMU_AUX_ID has invalid value (" + b + ")"); } + codeSizeXorByteCodeAddressHiXorMmuAuxIdXorPrcRacXorDeploymentNumberInftyXorFromAddressHi.put((byte) (b >> 24)); + codeSizeXorByteCodeAddressHiXorMmuAuxIdXorPrcRacXorDeploymentNumberInftyXorFromAddressHi.put((byte) (b >> 16)); + codeSizeXorByteCodeAddressHiXorMmuAuxIdXorPrcRacXorDeploymentNumberInftyXorFromAddressHi.put((byte) (b >> 8)); + codeSizeXorByteCodeAddressHiXorMmuAuxIdXorPrcRacXorDeploymentNumberInftyXorFromAddressHi.put((byte) b); + return this; } @@ -2897,16 +2292,12 @@ public Trace pMiscMmuExoSum(final long b) { filled.set(106); } - if (b >= 4294967296L) { - throw new IllegalArgumentException("hub.misc/MMU_EXO_SUM has invalid value (" + b + ")"); - } - codeSizeNewXorByteCodeCodeFragmentIndexXorMmuExoSumXorPrcCdsXorInitCodeSize.put( - (byte) (b >> 24)); - codeSizeNewXorByteCodeCodeFragmentIndexXorMmuExoSumXorPrcCdsXorInitCodeSize.put( - (byte) (b >> 16)); - codeSizeNewXorByteCodeCodeFragmentIndexXorMmuExoSumXorPrcCdsXorInitCodeSize.put( - (byte) (b >> 8)); - codeSizeNewXorByteCodeCodeFragmentIndexXorMmuExoSumXorPrcCdsXorInitCodeSize.put((byte) b); + if(b >= 4294967296L) { throw new IllegalArgumentException("hub.misc/MMU_EXO_SUM has invalid value (" + b + ")"); } + codeSizeNewXorByteCodeCodeFragmentIndexXorMmuExoSumXorPrcRaoXorInitCodeSize.put((byte) (b >> 24)); + codeSizeNewXorByteCodeCodeFragmentIndexXorMmuExoSumXorPrcRaoXorInitCodeSize.put((byte) (b >> 16)); + codeSizeNewXorByteCodeCodeFragmentIndexXorMmuExoSumXorPrcRaoXorInitCodeSize.put((byte) (b >> 8)); + codeSizeNewXorByteCodeCodeFragmentIndexXorMmuExoSumXorPrcRaoXorInitCodeSize.put((byte) b); + return this; } @@ -2918,8 +2309,7 @@ public Trace pMiscMmuFlag(final Boolean b) { filled.set(47); } - againInTxnXorUpdateXorMmuFlagXorCallEoaSuccessCallerWillRevertXorBinFlagXorAgainInTxnXorIsType2 - .put((byte) (b ? 1 : 0)); + againInTxnXorUpdateXorMmuFlagXorCallEoaSuccessCallerWillRevertXorBinFlagXorAgainInTxnXorIsType2.put((byte) (b ? 1 : 0)); return this; } @@ -2931,16 +2321,12 @@ public Trace pMiscMmuInst(final long b) { filled.set(107); } - if (b >= 4294967296L) { - throw new IllegalArgumentException("hub.misc/MMU_INST has invalid value (" + b + ")"); - } - deploymentNumberXorByteCodeDeploymentNumberXorMmuInstXorPrcRacXorToAddressHi.put( - (byte) (b >> 24)); - deploymentNumberXorByteCodeDeploymentNumberXorMmuInstXorPrcRacXorToAddressHi.put( - (byte) (b >> 16)); - deploymentNumberXorByteCodeDeploymentNumberXorMmuInstXorPrcRacXorToAddressHi.put( - (byte) (b >> 8)); - deploymentNumberXorByteCodeDeploymentNumberXorMmuInstXorPrcRacXorToAddressHi.put((byte) b); + if(b >= 4294967296L) { throw new IllegalArgumentException("hub.misc/MMU_INST has invalid value (" + b + ")"); } + deploymentNumberXorByteCodeDeploymentNumberXorMmuInstXorToAddressHi.put((byte) (b >> 24)); + deploymentNumberXorByteCodeDeploymentNumberXorMmuInstXorToAddressHi.put((byte) (b >> 16)); + deploymentNumberXorByteCodeDeploymentNumberXorMmuInstXorToAddressHi.put((byte) (b >> 8)); + deploymentNumberXorByteCodeDeploymentNumberXorMmuInstXorToAddressHi.put((byte) b); + return this; } @@ -2955,18 +2341,11 @@ public Trace pMiscMmuLimb1(final Bytes b) { // Trim array to size Bytes bs = b.trimLeadingZeros(); // Sanity check against expected width - if (bs.bitLength() > 128) { - throw new IllegalArgumentException( - "hub.misc/MMU_LIMB_1 has invalid width (" + bs.bitLength() + "bits)"); - } + if(bs.bitLength() > 128) { throw new IllegalArgumentException("hub.misc/MMU_LIMB_1 has invalid width (" + bs.bitLength() + "bits)"); } // Write padding (if necessary) - for (int i = bs.size(); i < 16; i++) { - codeHashLoXorMmuLimb1XorStackItemValueHi2XorValueNextHi.put((byte) 0); - } + for(int i=bs.size(); i<16; i++) { codeHashLoXorMmuLimb1XorStackItemValueHi2XorValueNextHi.put((byte) 0); } // Write bytes - for (int j = 0; j < bs.size(); j++) { - codeHashLoXorMmuLimb1XorStackItemValueHi2XorValueNextHi.put(bs.get(j)); - } + for(int j=0; j 128) { - throw new IllegalArgumentException( - "hub.misc/MMU_LIMB_2 has invalid width (" + bs.bitLength() + "bits)"); - } + if(bs.bitLength() > 128) { throw new IllegalArgumentException("hub.misc/MMU_LIMB_2 has invalid width (" + bs.bitLength() + "bits)"); } // Write padding (if necessary) - for (int i = bs.size(); i < 16; i++) { - codeHashLoNewXorMmuLimb2XorStackItemValueHi3XorValueNextLo.put((byte) 0); - } + for(int i=bs.size(); i<16; i++) { codeHashLoNewXorMmuLimb2XorStackItemValueHi3XorValueNextLo.put((byte) 0); } // Write bytes - for (int j = 0; j < bs.size(); j++) { - codeHashLoNewXorMmuLimb2XorStackItemValueHi3XorValueNextLo.put(bs.get(j)); - } + for(int j=0; j= 4294967296L) { - throw new IllegalArgumentException("hub.misc/MMU_PHASE has invalid value (" + b + ")"); - } - deploymentNumberInftyXorByteCodeDeploymentStatusXorMmuPhaseXorPrcRao.put((byte) (b >> 24)); - deploymentNumberInftyXorByteCodeDeploymentStatusXorMmuPhaseXorPrcRao.put((byte) (b >> 16)); - deploymentNumberInftyXorByteCodeDeploymentStatusXorMmuPhaseXorPrcRao.put((byte) (b >> 8)); - deploymentNumberInftyXorByteCodeDeploymentStatusXorMmuPhaseXorPrcRao.put((byte) b); + if(b >= 4294967296L) { throw new IllegalArgumentException("hub.misc/MMU_PHASE has invalid value (" + b + ")"); } + deploymentNumberInftyXorByteCodeDeploymentStatusXorMmuPhase.put((byte) (b >> 24)); + deploymentNumberInftyXorByteCodeDeploymentStatusXorMmuPhase.put((byte) (b >> 16)); + deploymentNumberInftyXorByteCodeDeploymentStatusXorMmuPhase.put((byte) (b >> 8)); + deploymentNumberInftyXorByteCodeDeploymentStatusXorMmuPhase.put((byte) b); + return this; } @@ -3022,13 +2393,12 @@ public Trace pMiscMmuRefOffset(final long b) { filled.set(109); } - if (b >= 4294967296L) { - throw new IllegalArgumentException("hub.misc/MMU_REF_OFFSET has invalid value (" + b + ")"); - } - deploymentNumberNewXorCallerAddressHiXorMmuRefOffsetXorPrcReturnGas.put((byte) (b >> 24)); - deploymentNumberNewXorCallerAddressHiXorMmuRefOffsetXorPrcReturnGas.put((byte) (b >> 16)); - deploymentNumberNewXorCallerAddressHiXorMmuRefOffsetXorPrcReturnGas.put((byte) (b >> 8)); - deploymentNumberNewXorCallerAddressHiXorMmuRefOffsetXorPrcReturnGas.put((byte) b); + if(b >= 4294967296L) { throw new IllegalArgumentException("hub.misc/MMU_REF_OFFSET has invalid value (" + b + ")"); } + deploymentNumberNewXorCallerAddressHiXorMmuRefOffset.put((byte) (b >> 24)); + deploymentNumberNewXorCallerAddressHiXorMmuRefOffset.put((byte) (b >> 16)); + deploymentNumberNewXorCallerAddressHiXorMmuRefOffset.put((byte) (b >> 8)); + deploymentNumberNewXorCallerAddressHiXorMmuRefOffset.put((byte) b); + return this; } @@ -3040,14 +2410,13 @@ public Trace pMiscMmuRefSize(final long b) { filled.set(110); } - if (b >= 4294967296L) { - throw new IllegalArgumentException("hub.misc/MMU_REF_SIZE has invalid value (" + b + ")"); - } + if(b >= 4294967296L) { throw new IllegalArgumentException("hub.misc/MMU_REF_SIZE has invalid value (" + b + ")"); } rlpaddrDepAddrHiXorCallDataContextNumberXorMmuRefSize.put((byte) (b >> 24)); rlpaddrDepAddrHiXorCallDataContextNumberXorMmuRefSize.put((byte) (b >> 16)); rlpaddrDepAddrHiXorCallDataContextNumberXorMmuRefSize.put((byte) (b >> 8)); rlpaddrDepAddrHiXorCallDataContextNumberXorMmuRefSize.put((byte) b); + return this; } @@ -3058,14 +2427,13 @@ public Trace pMiscMmuSize(final long b) { filled.set(111); } - if (b >= 4294967296L) { - throw new IllegalArgumentException("hub.misc/MMU_SIZE has invalid value (" + b + ")"); - } + if(b >= 4294967296L) { throw new IllegalArgumentException("hub.misc/MMU_SIZE has invalid value (" + b + ")"); } callDataOffsetXorMmuSize.put((byte) (b >> 24)); callDataOffsetXorMmuSize.put((byte) (b >> 16)); callDataOffsetXorMmuSize.put((byte) (b >> 8)); callDataOffsetXorMmuSize.put((byte) b); + return this; } @@ -3076,14 +2444,13 @@ public Trace pMiscMmuSrcId(final long b) { filled.set(112); } - if (b >= 4294967296L) { - throw new IllegalArgumentException("hub.misc/MMU_SRC_ID has invalid value (" + b + ")"); - } + if(b >= 4294967296L) { throw new IllegalArgumentException("hub.misc/MMU_SRC_ID has invalid value (" + b + ")"); } callDataSizeXorMmuSrcId.put((byte) (b >> 24)); callDataSizeXorMmuSrcId.put((byte) (b >> 16)); callDataSizeXorMmuSrcId.put((byte) (b >> 8)); callDataSizeXorMmuSrcId.put((byte) b); + return this; } @@ -3097,18 +2464,11 @@ public Trace pMiscMmuSrcOffsetHi(final Bytes b) { // Trim array to size Bytes bs = b.trimLeadingZeros(); // Sanity check against expected width - if (bs.bitLength() > 128) { - throw new IllegalArgumentException( - "hub.misc/MMU_SRC_OFFSET_HI has invalid width (" + bs.bitLength() + "bits)"); - } + if(bs.bitLength() > 128) { throw new IllegalArgumentException("hub.misc/MMU_SRC_OFFSET_HI has invalid width (" + bs.bitLength() + "bits)"); } // Write padding (if necessary) - for (int i = bs.size(); i < 16; i++) { - rlpaddrDepAddrLoXorMmuSrcOffsetHiXorStackItemValueHi4XorValueOrigHi.put((byte) 0); - } + for(int i=bs.size(); i<16; i++) { rlpaddrDepAddrLoXorMmuSrcOffsetHiXorStackItemValueHi4XorValueOrigHi.put((byte) 0); } // Write bytes - for (int j = 0; j < bs.size(); j++) { - rlpaddrDepAddrLoXorMmuSrcOffsetHiXorStackItemValueHi4XorValueOrigHi.put(bs.get(j)); - } + for(int j=0; j 128) { - throw new IllegalArgumentException( - "hub.misc/MMU_SRC_OFFSET_LO has invalid width (" + bs.bitLength() + "bits)"); - } + if(bs.bitLength() > 128) { throw new IllegalArgumentException("hub.misc/MMU_SRC_OFFSET_LO has invalid width (" + bs.bitLength() + "bits)"); } // Write padding (if necessary) - for (int i = bs.size(); i < 16; i++) { - rlpaddrKecHiXorMmuSrcOffsetLoXorStackItemValueLo1XorValueOrigLo.put((byte) 0); - } + for(int i=bs.size(); i<16; i++) { rlpaddrKecHiXorMmuSrcOffsetLoXorStackItemValueLo1XorValueOrigLo.put((byte) 0); } // Write bytes - for (int j = 0; j < bs.size(); j++) { - rlpaddrKecHiXorMmuSrcOffsetLoXorStackItemValueLo1XorValueOrigLo.put(bs.get(j)); - } + for(int j=0; j= 4294967296L) { - throw new IllegalArgumentException("hub.misc/MMU_TGT_ID has invalid value (" + b + ")"); - } + if(b >= 4294967296L) { throw new IllegalArgumentException("hub.misc/MMU_TGT_ID has invalid value (" + b + ")"); } contextNumberXorMmuTgtId.put((byte) (b >> 24)); contextNumberXorMmuTgtId.put((byte) (b >> 16)); contextNumberXorMmuTgtId.put((byte) (b >> 8)); contextNumberXorMmuTgtId.put((byte) b); + return this; } @@ -3180,18 +2531,11 @@ public Trace pMiscMmuTgtOffsetLo(final Bytes b) { // Trim array to size Bytes bs = b.trimLeadingZeros(); // Sanity check against expected width - if (bs.bitLength() > 128) { - throw new IllegalArgumentException( - "hub.misc/MMU_TGT_OFFSET_LO has invalid width (" + bs.bitLength() + "bits)"); - } + if(bs.bitLength() > 128) { throw new IllegalArgumentException("hub.misc/MMU_TGT_OFFSET_LO has invalid width (" + bs.bitLength() + "bits)"); } // Write padding (if necessary) - for (int i = bs.size(); i < 16; i++) { - rlpaddrKecLoXorMmuTgtOffsetLoXorStackItemValueLo2.put((byte) 0); - } + for(int i=bs.size(); i<16; i++) { rlpaddrKecLoXorMmuTgtOffsetLoXorStackItemValueLo2.put((byte) 0); } // Write bytes - for (int j = 0; j < bs.size(); j++) { - rlpaddrKecLoXorMmuTgtOffsetLoXorStackItemValueLo2.put(bs.get(j)); - } + for(int j=0; j 128) { - throw new IllegalArgumentException( - "hub.misc/MXP_GAS_MXP has invalid width (" + bs.bitLength() + "bits)"); - } + if(bs.bitLength() > 128) { throw new IllegalArgumentException("hub.misc/MXP_GAS_MXP has invalid width (" + bs.bitLength() + "bits)"); } // Write padding (if necessary) - for (int i = bs.size(); i < 16; i++) { - rlpaddrSaltHiXorMxpGasMxpXorStackItemValueLo3.put((byte) 0); - } + for(int i=bs.size(); i<16; i++) { rlpaddrSaltHiXorMxpGasMxpXorStackItemValueLo3.put((byte) 0); } // Write bytes - for (int j = 0; j < bs.size(); j++) { - rlpaddrSaltHiXorMxpGasMxpXorStackItemValueLo3.put(bs.get(j)); - } + for(int j=0; j= 4294967296L) { - throw new IllegalArgumentException("hub.misc/MXP_INST has invalid value (" + b + ")"); - } + if(b >= 4294967296L) { throw new IllegalArgumentException("hub.misc/MXP_INST has invalid value (" + b + ")"); } returnAtCapacityXorMxpInst.put((byte) (b >> 24)); returnAtCapacityXorMxpInst.put((byte) (b >> 16)); returnAtCapacityXorMxpInst.put((byte) (b >> 8)); returnAtCapacityXorMxpInst.put((byte) b); + return this; } @@ -3272,8 +2607,7 @@ public Trace pMiscMxpMtntop(final Boolean b) { filled.set(51); } - existsXorMxpMtntopXorCallPrcSuccessCallerWillRevertXorCopyFlagXorFirstInBlk.put( - (byte) (b ? 1 : 0)); + existsXorMxpMtntopXorCallPrcSuccessCallerWillRevertXorCopyFlagXorFirstInBlk.put((byte) (b ? 1 : 0)); return this; } @@ -3285,8 +2619,7 @@ public Trace pMiscMxpMxpx(final Boolean b) { filled.set(52); } - existsNewXorMxpMxpxXorCallPrcSuccessCallerWontRevertXorCreateFlagXorFirstInCnf.put( - (byte) (b ? 1 : 0)); + existsNewXorMxpMxpxXorCallPrcSuccessCallerWontRevertXorCreateFlagXorFirstInCnf.put((byte) (b ? 1 : 0)); return this; } @@ -3301,18 +2634,11 @@ public Trace pMiscMxpOffset1Hi(final Bytes b) { // Trim array to size Bytes bs = b.trimLeadingZeros(); // Sanity check against expected width - if (bs.bitLength() > 128) { - throw new IllegalArgumentException( - "hub.misc/MXP_OFFSET_1_HI has invalid width (" + bs.bitLength() + "bits)"); - } + if(bs.bitLength() > 128) { throw new IllegalArgumentException("hub.misc/MXP_OFFSET_1_HI has invalid width (" + bs.bitLength() + "bits)"); } // Write padding (if necessary) - for (int i = bs.size(); i < 16; i++) { - rlpaddrSaltLoXorMxpOffset1HiXorStackItemValueLo4.put((byte) 0); - } + for(int i=bs.size(); i<16; i++) { rlpaddrSaltLoXorMxpOffset1HiXorStackItemValueLo4.put((byte) 0); } // Write bytes - for (int j = 0; j < bs.size(); j++) { - rlpaddrSaltLoXorMxpOffset1HiXorStackItemValueLo4.put(bs.get(j)); - } + for(int j=0; j 128) { - throw new IllegalArgumentException( - "hub.misc/MXP_OFFSET_1_LO has invalid width (" + bs.bitLength() + "bits)"); - } + if(bs.bitLength() > 128) { throw new IllegalArgumentException("hub.misc/MXP_OFFSET_1_LO has invalid width (" + bs.bitLength() + "bits)"); } // Write padding (if necessary) - for (int i = bs.size(); i < 16; i++) { - trmRawAddressHiXorMxpOffset1Lo.put((byte) 0); - } + for(int i=bs.size(); i<16; i++) { trmRawAddressHiXorMxpOffset1Lo.put((byte) 0); } // Write bytes - for (int j = 0; j < bs.size(); j++) { - trmRawAddressHiXorMxpOffset1Lo.put(bs.get(j)); - } + for(int j=0; j 128) { - throw new IllegalArgumentException( - "hub.misc/MXP_OFFSET_2_HI has invalid width (" + bs.bitLength() + "bits)"); - } + if(bs.bitLength() > 128) { throw new IllegalArgumentException("hub.misc/MXP_OFFSET_2_HI has invalid width (" + bs.bitLength() + "bits)"); } // Write padding (if necessary) - for (int i = bs.size(); i < 16; i++) { - mxpOffset2Hi.put((byte) 0); - } + for(int i=bs.size(); i<16; i++) { mxpOffset2Hi.put((byte) 0); } // Write bytes - for (int j = 0; j < bs.size(); j++) { - mxpOffset2Hi.put(bs.get(j)); - } + for(int j=0; j 128) { - throw new IllegalArgumentException( - "hub.misc/MXP_OFFSET_2_LO has invalid width (" + bs.bitLength() + "bits)"); - } + if(bs.bitLength() > 128) { throw new IllegalArgumentException("hub.misc/MXP_OFFSET_2_LO has invalid width (" + bs.bitLength() + "bits)"); } // Write padding (if necessary) - for (int i = bs.size(); i < 16; i++) { - mxpOffset2Lo.put((byte) 0); - } + for(int i=bs.size(); i<16; i++) { mxpOffset2Lo.put((byte) 0); } // Write bytes - for (int j = 0; j < bs.size(); j++) { - mxpOffset2Lo.put(bs.get(j)); - } + for(int j=0; j 128) { - throw new IllegalArgumentException( - "hub.misc/MXP_SIZE_1_HI has invalid width (" + bs.bitLength() + "bits)"); - } + if(bs.bitLength() > 128) { throw new IllegalArgumentException("hub.misc/MXP_SIZE_1_HI has invalid width (" + bs.bitLength() + "bits)"); } // Write padding (if necessary) - for (int i = bs.size(); i < 16; i++) { - mxpSize1Hi.put((byte) 0); - } + for(int i=bs.size(); i<16; i++) { mxpSize1Hi.put((byte) 0); } // Write bytes - for (int j = 0; j < bs.size(); j++) { - mxpSize1Hi.put(bs.get(j)); - } + for(int j=0; j 128) { - throw new IllegalArgumentException( - "hub.misc/MXP_SIZE_1_LO has invalid width (" + bs.bitLength() + "bits)"); - } + if(bs.bitLength() > 128) { throw new IllegalArgumentException("hub.misc/MXP_SIZE_1_LO has invalid width (" + bs.bitLength() + "bits)"); } // Write padding (if necessary) - for (int i = bs.size(); i < 16; i++) { - mxpSize1Lo.put((byte) 0); - } + for(int i=bs.size(); i<16; i++) { mxpSize1Lo.put((byte) 0); } // Write bytes - for (int j = 0; j < bs.size(); j++) { - mxpSize1Lo.put(bs.get(j)); - } + for(int j=0; j 128) { - throw new IllegalArgumentException( - "hub.misc/MXP_SIZE_2_HI has invalid width (" + bs.bitLength() + "bits)"); - } + if(bs.bitLength() > 128) { throw new IllegalArgumentException("hub.misc/MXP_SIZE_2_HI has invalid width (" + bs.bitLength() + "bits)"); } // Write padding (if necessary) - for (int i = bs.size(); i < 16; i++) { - mxpSize2Hi.put((byte) 0); - } + for(int i=bs.size(); i<16; i++) { mxpSize2Hi.put((byte) 0); } // Write bytes - for (int j = 0; j < bs.size(); j++) { - mxpSize2Hi.put(bs.get(j)); - } + for(int j=0; j 128) { - throw new IllegalArgumentException( - "hub.misc/MXP_SIZE_2_LO has invalid width (" + bs.bitLength() + "bits)"); - } + if(bs.bitLength() > 128) { throw new IllegalArgumentException("hub.misc/MXP_SIZE_2_LO has invalid width (" + bs.bitLength() + "bits)"); } // Write padding (if necessary) - for (int i = bs.size(); i < 16; i++) { - mxpSize2Lo.put((byte) 0); - } + for(int i=bs.size(); i<16; i++) { mxpSize2Lo.put((byte) 0); } // Write bytes - for (int j = 0; j < bs.size(); j++) { - mxpSize2Lo.put(bs.get(j)); - } + for(int j=0; j 128) { - throw new IllegalArgumentException( - "hub.misc/MXP_WORDS has invalid width (" + bs.bitLength() + "bits)"); - } + if(bs.bitLength() > 128) { throw new IllegalArgumentException("hub.misc/MXP_WORDS has invalid width (" + bs.bitLength() + "bits)"); } // Write padding (if necessary) - for (int i = bs.size(); i < 16; i++) { - mxpWords.put((byte) 0); - } + for(int i=bs.size(); i<16; i++) { mxpWords.put((byte) 0); } // Write bytes - for (int j = 0; j < bs.size(); j++) { - mxpWords.put(bs.get(j)); - } + for(int j=0; j 128) { - throw new IllegalArgumentException( - "hub.misc/OOB_DATA_1 has invalid width (" + bs.bitLength() + "bits)"); - } + if(bs.bitLength() > 128) { throw new IllegalArgumentException("hub.misc/OOB_DATA_1 has invalid width (" + bs.bitLength() + "bits)"); } // Write padding (if necessary) - for (int i = bs.size(); i < 16; i++) { - oobData1.put((byte) 0); - } + for(int i=bs.size(); i<16; i++) { oobData1.put((byte) 0); } // Write bytes - for (int j = 0; j < bs.size(); j++) { - oobData1.put(bs.get(j)); - } + for(int j=0; j 128) { - throw new IllegalArgumentException( - "hub.misc/OOB_DATA_2 has invalid width (" + bs.bitLength() + "bits)"); - } + if(bs.bitLength() > 128) { throw new IllegalArgumentException("hub.misc/OOB_DATA_2 has invalid width (" + bs.bitLength() + "bits)"); } // Write padding (if necessary) - for (int i = bs.size(); i < 16; i++) { - oobData2.put((byte) 0); - } + for(int i=bs.size(); i<16; i++) { oobData2.put((byte) 0); } // Write bytes - for (int j = 0; j < bs.size(); j++) { - oobData2.put(bs.get(j)); - } + for(int j=0; j 128) { - throw new IllegalArgumentException( - "hub.misc/OOB_DATA_3 has invalid width (" + bs.bitLength() + "bits)"); - } + if(bs.bitLength() > 128) { throw new IllegalArgumentException("hub.misc/OOB_DATA_3 has invalid width (" + bs.bitLength() + "bits)"); } // Write padding (if necessary) - for (int i = bs.size(); i < 16; i++) { - oobData3.put((byte) 0); - } + for(int i=bs.size(); i<16; i++) { oobData3.put((byte) 0); } // Write bytes - for (int j = 0; j < bs.size(); j++) { - oobData3.put(bs.get(j)); - } + for(int j=0; j 128) { - throw new IllegalArgumentException( - "hub.misc/OOB_DATA_4 has invalid width (" + bs.bitLength() + "bits)"); - } + if(bs.bitLength() > 128) { throw new IllegalArgumentException("hub.misc/OOB_DATA_4 has invalid width (" + bs.bitLength() + "bits)"); } // Write padding (if necessary) - for (int i = bs.size(); i < 16; i++) { - oobData4.put((byte) 0); - } + for(int i=bs.size(); i<16; i++) { oobData4.put((byte) 0); } // Write bytes - for (int j = 0; j < bs.size(); j++) { - oobData4.put(bs.get(j)); - } + for(int j=0; j 128) { - throw new IllegalArgumentException( - "hub.misc/OOB_DATA_5 has invalid width (" + bs.bitLength() + "bits)"); - } + if(bs.bitLength() > 128) { throw new IllegalArgumentException("hub.misc/OOB_DATA_5 has invalid width (" + bs.bitLength() + "bits)"); } // Write padding (if necessary) - for (int i = bs.size(); i < 16; i++) { - oobData5.put((byte) 0); - } + for(int i=bs.size(); i<16; i++) { oobData5.put((byte) 0); } // Write bytes - for (int j = 0; j < bs.size(); j++) { - oobData5.put(bs.get(j)); - } + for(int j=0; j 128) { - throw new IllegalArgumentException( - "hub.misc/OOB_DATA_6 has invalid width (" + bs.bitLength() + "bits)"); - } + if(bs.bitLength() > 128) { throw new IllegalArgumentException("hub.misc/OOB_DATA_6 has invalid width (" + bs.bitLength() + "bits)"); } // Write padding (if necessary) - for (int i = bs.size(); i < 16; i++) { - oobData6.put((byte) 0); - } + for(int i=bs.size(); i<16; i++) { oobData6.put((byte) 0); } // Write bytes - for (int j = 0; j < bs.size(); j++) { - oobData6.put(bs.get(j)); - } + for(int j=0; j 128) { - throw new IllegalArgumentException( - "hub.misc/OOB_DATA_7 has invalid width (" + bs.bitLength() + "bits)"); - } + if(bs.bitLength() > 128) { throw new IllegalArgumentException("hub.misc/OOB_DATA_7 has invalid width (" + bs.bitLength() + "bits)"); } // Write padding (if necessary) - for (int i = bs.size(); i < 16; i++) { - oobData7.put((byte) 0); - } + for(int i=bs.size(); i<16; i++) { oobData7.put((byte) 0); } // Write bytes - for (int j = 0; j < bs.size(); j++) { - oobData7.put(bs.get(j)); - } + for(int j=0; j 128) { - throw new IllegalArgumentException( - "hub.misc/OOB_DATA_8 has invalid width (" + bs.bitLength() + "bits)"); - } + if(bs.bitLength() > 128) { throw new IllegalArgumentException("hub.misc/OOB_DATA_8 has invalid width (" + bs.bitLength() + "bits)"); } // Write padding (if necessary) - for (int i = bs.size(); i < 16; i++) { - oobData8.put((byte) 0); - } + for(int i=bs.size(); i<16; i++) { oobData8.put((byte) 0); } // Write bytes - for (int j = 0; j < bs.size(); j++) { - oobData8.put(bs.get(j)); - } + for(int j=0; j 128) { - throw new IllegalArgumentException( - "hub.misc/OOB_DATA_9 has invalid width (" + bs.bitLength() + "bits)"); - } + if(bs.bitLength() > 128) { throw new IllegalArgumentException("hub.misc/OOB_DATA_9 has invalid width (" + bs.bitLength() + "bits)"); } // Write padding (if necessary) - for (int i = bs.size(); i < 16; i++) { - oobData9.put((byte) 0); - } + for(int i=bs.size(); i<16; i++) { oobData9.put((byte) 0); } // Write bytes - for (int j = 0; j < bs.size(); j++) { - oobData9.put(bs.get(j)); - } + for(int j=0; j= 4294967296L) { - throw new IllegalArgumentException("hub.misc/OOB_INST has invalid value (" + b + ")"); - } + if(b >= 4294967296L) { throw new IllegalArgumentException("hub.misc/OOB_INST has invalid value (" + b + ")"); } returnAtOffsetXorOobInst.put((byte) (b >> 24)); returnAtOffsetXorOobInst.put((byte) (b >> 16)); returnAtOffsetXorOobInst.put((byte) (b >> 8)); returnAtOffsetXorOobInst.put((byte) b); + return this; } @@ -3823,8 +3026,7 @@ public Trace pMiscStpExists(final Boolean b) { filled.set(56); } - firstInBlkXorStpExistsXorCallSmcSuccessCallerWontRevertXorDecFlag4XorValueCurrIsZero.put( - (byte) (b ? 1 : 0)); + firstInBlkXorStpExistsXorCallSmcSuccessCallerWontRevertXorDecFlag4XorValueCurrIsZero.put((byte) (b ? 1 : 0)); return this; } @@ -3851,18 +3053,11 @@ public Trace pMiscStpGasHi(final Bytes b) { // Trim array to size Bytes bs = b.trimLeadingZeros(); // Sanity check against expected width - if (bs.bitLength() > 128) { - throw new IllegalArgumentException( - "hub.misc/STP_GAS_HI has invalid width (" + bs.bitLength() + "bits)"); - } + if(bs.bitLength() > 128) { throw new IllegalArgumentException("hub.misc/STP_GAS_HI has invalid width (" + bs.bitLength() + "bits)"); } // Write padding (if necessary) - for (int i = bs.size(); i < 16; i++) { - stpGasHi.put((byte) 0); - } + for(int i=bs.size(); i<16; i++) { stpGasHi.put((byte) 0); } // Write bytes - for (int j = 0; j < bs.size(); j++) { - stpGasHi.put(bs.get(j)); - } + for(int j=0; j 128) { - throw new IllegalArgumentException( - "hub.misc/STP_GAS_LO has invalid width (" + bs.bitLength() + "bits)"); - } + if(bs.bitLength() > 128) { throw new IllegalArgumentException("hub.misc/STP_GAS_LO has invalid width (" + bs.bitLength() + "bits)"); } // Write padding (if necessary) - for (int i = bs.size(); i < 16; i++) { - stpGasLo.put((byte) 0); - } + for(int i=bs.size(); i<16; i++) { stpGasLo.put((byte) 0); } // Write bytes - for (int j = 0; j < bs.size(); j++) { - stpGasLo.put(bs.get(j)); - } + for(int j=0; j 64) { - throw new IllegalArgumentException( - "hub.misc/STP_GAS_MXP has invalid width (" + bs.bitLength() + "bits)"); - } + if(bs.bitLength() > 64) { throw new IllegalArgumentException("hub.misc/STP_GAS_MXP has invalid width (" + bs.bitLength() + "bits)"); } // Write padding (if necessary) - for (int i = bs.size(); i < 8; i++) { - nonceXorStpGasMxpXorBasefee.put((byte) 0); - } + for(int i=bs.size(); i<8; i++) { nonceXorStpGasMxpXorPrcCalleeGasXorBasefee.put((byte) 0); } // Write bytes - for (int j = 0; j < bs.size(); j++) { - nonceXorStpGasMxpXorBasefee.put(bs.get(j)); - } + for(int j=0; j 64) { - throw new IllegalArgumentException( - "hub.misc/STP_GAS_PAID_OUT_OF_POCKET has invalid width (" + bs.bitLength() + "bits)"); - } + if(bs.bitLength() > 64) { throw new IllegalArgumentException("hub.misc/STP_GAS_PAID_OUT_OF_POCKET has invalid width (" + bs.bitLength() + "bits)"); } // Write padding (if necessary) - for (int i = bs.size(); i < 8; i++) { - nonceNewXorStpGasPaidOutOfPocketXorGasInitiallyAvailable.put((byte) 0); - } + for(int i=bs.size(); i<8; i++) { nonceNewXorStpGasPaidOutOfPocketXorPrcCallerGasXorGasInitiallyAvailable.put((byte) 0); } // Write bytes - for (int j = 0; j < bs.size(); j++) { - nonceNewXorStpGasPaidOutOfPocketXorGasInitiallyAvailable.put(bs.get(j)); - } + for(int j=0; j= 4294967296L) { - throw new IllegalArgumentException("hub.misc/STP_GAS_STIPEND has invalid value (" + b + ")"); - } + if(b >= 4294967296L) { throw new IllegalArgumentException("hub.misc/STP_GAS_STIPEND has invalid value (" + b + ")"); } returnDataContextNumberXorStpGasStipend.put((byte) (b >> 24)); returnDataContextNumberXorStpGasStipend.put((byte) (b >> 16)); returnDataContextNumberXorStpGasStipend.put((byte) (b >> 8)); returnDataContextNumberXorStpGasStipend.put((byte) b); + return this; } @@ -3973,18 +3146,11 @@ public Trace pMiscStpGasUpfrontGasCost(final Bytes b) { // Trim array to size Bytes bs = b.trimLeadingZeros(); // Sanity check against expected width - if (bs.bitLength() > 64) { - throw new IllegalArgumentException( - "hub.misc/STP_GAS_UPFRONT_GAS_COST has invalid width (" + bs.bitLength() + "bits)"); - } + if(bs.bitLength() > 64) { throw new IllegalArgumentException("hub.misc/STP_GAS_UPFRONT_GAS_COST has invalid width (" + bs.bitLength() + "bits)"); } // Write padding (if necessary) - for (int i = bs.size(); i < 8; i++) { - stpGasUpfrontGasCostXorGasLeftover.put((byte) 0); - } + for(int i=bs.size(); i<8; i++) { stpGasUpfrontGasCostXorPrcReturnGasXorGasLeftover.put((byte) 0); } // Write bytes - for (int j = 0; j < bs.size(); j++) { - stpGasUpfrontGasCostXorGasLeftover.put(bs.get(j)); - } + for(int j=0; j= 4294967296L) { - throw new IllegalArgumentException("hub.misc/STP_INSTRUCTION has invalid value (" + b + ")"); - } + if(b >= 4294967296L) { throw new IllegalArgumentException("hub.misc/STP_INSTRUCTION has invalid value (" + b + ")"); } returnDataOffsetXorStpInstruction.put((byte) (b >> 24)); returnDataOffsetXorStpInstruction.put((byte) (b >> 16)); returnDataOffsetXorStpInstruction.put((byte) (b >> 8)); returnDataOffsetXorStpInstruction.put((byte) b); + return this; } @@ -4014,8 +3179,7 @@ public Trace pMiscStpOogx(final Boolean b) { filled.set(58); } - firstInTxnXorStpOogxXorCreateEmptyInitCodeWillRevertXorExtFlagXorValueNextIsOrig.put( - (byte) (b ? 1 : 0)); + firstInTxnXorStpOogxXorCreateEmptyInitCodeWillRevertXorExtFlagXorValueNextIsOrig.put((byte) (b ? 1 : 0)); return this; } @@ -4030,18 +3194,11 @@ public Trace pMiscStpValueHi(final Bytes b) { // Trim array to size Bytes bs = b.trimLeadingZeros(); // Sanity check against expected width - if (bs.bitLength() > 128) { - throw new IllegalArgumentException( - "hub.misc/STP_VALUE_HI has invalid width (" + bs.bitLength() + "bits)"); - } + if(bs.bitLength() > 128) { throw new IllegalArgumentException("hub.misc/STP_VALUE_HI has invalid width (" + bs.bitLength() + "bits)"); } // Write padding (if necessary) - for (int i = bs.size(); i < 16; i++) { - stpValueHi.put((byte) 0); - } + for(int i=bs.size(); i<16; i++) { stpValueHi.put((byte) 0); } // Write bytes - for (int j = 0; j < bs.size(); j++) { - stpValueHi.put(bs.get(j)); - } + for(int j=0; j 128) { - throw new IllegalArgumentException( - "hub.misc/STP_VALUE_LO has invalid width (" + bs.bitLength() + "bits)"); - } + if(bs.bitLength() > 128) { throw new IllegalArgumentException("hub.misc/STP_VALUE_LO has invalid width (" + bs.bitLength() + "bits)"); } // Write padding (if necessary) - for (int i = bs.size(); i < 16; i++) { - stpValueLo.put((byte) 0); - } + for(int i=bs.size(); i<16; i++) { stpValueLo.put((byte) 0); } // Write bytes - for (int j = 0; j < bs.size(); j++) { - stpValueLo.put(bs.get(j)); - } + for(int j=0; j= 4294967296L) { - throw new IllegalArgumentException( - "hub.scenario/PRC_CALLEE_GAS has invalid value (" + b + ")"); - } - addressHiXorAccountAddressHiXorCcrsStampXorPrcCalleeGasXorStaticGasXorAddressHiXorCallDataSize - .put((byte) (b >> 24)); - addressHiXorAccountAddressHiXorCcrsStampXorPrcCalleeGasXorStaticGasXorAddressHiXorCallDataSize - .put((byte) (b >> 16)); - addressHiXorAccountAddressHiXorCcrsStampXorPrcCalleeGasXorStaticGasXorAddressHiXorCallDataSize - .put((byte) (b >> 8)); - addressHiXorAccountAddressHiXorCcrsStampXorPrcCalleeGasXorStaticGasXorAddressHiXorCallDataSize - .put((byte) b); + // Trim array to size + Bytes bs = b.trimLeadingZeros(); + // Sanity check against expected width + if(bs.bitLength() > 64) { throw new IllegalArgumentException("hub.scenario/PRC_CALLEE_GAS has invalid width (" + bs.bitLength() + "bits)"); } + // Write padding (if necessary) + for(int i=bs.size(); i<8; i++) { nonceXorStpGasMxpXorPrcCalleeGasXorBasefee.put((byte) 0); } + // Write bytes + for(int j=0; j= 4294967296L) { - throw new IllegalArgumentException( - "hub.scenario/PRC_CALLER_GAS has invalid value (" + b + ")"); - } - codeFragmentIndexXorAccountDeploymentNumberXorExpInstXorPrcCallerGasXorDeploymentNumberXorCoinbaseAddressHi - .put((byte) (b >> 24)); - codeFragmentIndexXorAccountDeploymentNumberXorExpInstXorPrcCallerGasXorDeploymentNumberXorCoinbaseAddressHi - .put((byte) (b >> 16)); - codeFragmentIndexXorAccountDeploymentNumberXorExpInstXorPrcCallerGasXorDeploymentNumberXorCoinbaseAddressHi - .put((byte) (b >> 8)); - codeFragmentIndexXorAccountDeploymentNumberXorExpInstXorPrcCallerGasXorDeploymentNumberXorCoinbaseAddressHi - .put((byte) b); + // Trim array to size + Bytes bs = b.trimLeadingZeros(); + // Sanity check against expected width + if(bs.bitLength() > 64) { throw new IllegalArgumentException("hub.scenario/PRC_CALLER_GAS has invalid width (" + bs.bitLength() + "bits)"); } + // Write padding (if necessary) + for(int i=bs.size(); i<8; i++) { nonceNewXorStpGasPaidOutOfPocketXorPrcCallerGasXorGasInitiallyAvailable.put((byte) 0); } + // Write bytes + for(int j=0; j= 4294967296L) { - throw new IllegalArgumentException("hub.scenario/PRC_CDO has invalid value (" + b + ")"); - } - codeSizeXorByteCodeAddressHiXorMmuAuxIdXorPrcCdoXorDeploymentNumberInftyXorFromAddressHi.put( - (byte) (b >> 24)); - codeSizeXorByteCodeAddressHiXorMmuAuxIdXorPrcCdoXorDeploymentNumberInftyXorFromAddressHi.put( - (byte) (b >> 16)); - codeSizeXorByteCodeAddressHiXorMmuAuxIdXorPrcCdoXorDeploymentNumberInftyXorFromAddressHi.put( - (byte) (b >> 8)); - codeSizeXorByteCodeAddressHiXorMmuAuxIdXorPrcCdoXorDeploymentNumberInftyXorFromAddressHi.put( - (byte) b); + if(b >= 4294967296L) { throw new IllegalArgumentException("hub.scenario/PRC_CDO has invalid value (" + b + ")"); } + addressHiXorAccountAddressHiXorCcrsStampXorPrcCdoXorStaticGasXorAddressHiXorCallDataSize.put((byte) (b >> 24)); + addressHiXorAccountAddressHiXorCcrsStampXorPrcCdoXorStaticGasXorAddressHiXorCallDataSize.put((byte) (b >> 16)); + addressHiXorAccountAddressHiXorCcrsStampXorPrcCdoXorStaticGasXorAddressHiXorCallDataSize.put((byte) (b >> 8)); + addressHiXorAccountAddressHiXorCcrsStampXorPrcCdoXorStaticGasXorAddressHiXorCallDataSize.put((byte) b); + return this; } public Trace pScenarioPrcCds(final long b) { - if (filled.get(106)) { + if (filled.get(104)) { throw new IllegalStateException("hub.scenario/PRC_CDS already set"); } else { - filled.set(106); + filled.set(104); } - if (b >= 4294967296L) { - throw new IllegalArgumentException("hub.scenario/PRC_CDS has invalid value (" + b + ")"); - } - codeSizeNewXorByteCodeCodeFragmentIndexXorMmuExoSumXorPrcCdsXorInitCodeSize.put( - (byte) (b >> 24)); - codeSizeNewXorByteCodeCodeFragmentIndexXorMmuExoSumXorPrcCdsXorInitCodeSize.put( - (byte) (b >> 16)); - codeSizeNewXorByteCodeCodeFragmentIndexXorMmuExoSumXorPrcCdsXorInitCodeSize.put( - (byte) (b >> 8)); - codeSizeNewXorByteCodeCodeFragmentIndexXorMmuExoSumXorPrcCdsXorInitCodeSize.put((byte) b); + if(b >= 4294967296L) { throw new IllegalArgumentException("hub.scenario/PRC_CDS has invalid value (" + b + ")"); } + codeFragmentIndexXorAccountDeploymentNumberXorExpInstXorPrcCdsXorDeploymentNumberXorCoinbaseAddressHi.put((byte) (b >> 24)); + codeFragmentIndexXorAccountDeploymentNumberXorExpInstXorPrcCdsXorDeploymentNumberXorCoinbaseAddressHi.put((byte) (b >> 16)); + codeFragmentIndexXorAccountDeploymentNumberXorExpInstXorPrcCdsXorDeploymentNumberXorCoinbaseAddressHi.put((byte) (b >> 8)); + codeFragmentIndexXorAccountDeploymentNumberXorExpInstXorPrcCdsXorDeploymentNumberXorCoinbaseAddressHi.put((byte) b); + return this; } @@ -4579,59 +3679,54 @@ public Trace pScenarioPrcModexp(final Boolean b) { } public Trace pScenarioPrcRac(final long b) { - if (filled.get(107)) { + if (filled.get(105)) { throw new IllegalStateException("hub.scenario/PRC_RAC already set"); } else { - filled.set(107); + filled.set(105); } - if (b >= 4294967296L) { - throw new IllegalArgumentException("hub.scenario/PRC_RAC has invalid value (" + b + ")"); - } - deploymentNumberXorByteCodeDeploymentNumberXorMmuInstXorPrcRacXorToAddressHi.put( - (byte) (b >> 24)); - deploymentNumberXorByteCodeDeploymentNumberXorMmuInstXorPrcRacXorToAddressHi.put( - (byte) (b >> 16)); - deploymentNumberXorByteCodeDeploymentNumberXorMmuInstXorPrcRacXorToAddressHi.put( - (byte) (b >> 8)); - deploymentNumberXorByteCodeDeploymentNumberXorMmuInstXorPrcRacXorToAddressHi.put((byte) b); + if(b >= 4294967296L) { throw new IllegalArgumentException("hub.scenario/PRC_RAC has invalid value (" + b + ")"); } + codeSizeXorByteCodeAddressHiXorMmuAuxIdXorPrcRacXorDeploymentNumberInftyXorFromAddressHi.put((byte) (b >> 24)); + codeSizeXorByteCodeAddressHiXorMmuAuxIdXorPrcRacXorDeploymentNumberInftyXorFromAddressHi.put((byte) (b >> 16)); + codeSizeXorByteCodeAddressHiXorMmuAuxIdXorPrcRacXorDeploymentNumberInftyXorFromAddressHi.put((byte) (b >> 8)); + codeSizeXorByteCodeAddressHiXorMmuAuxIdXorPrcRacXorDeploymentNumberInftyXorFromAddressHi.put((byte) b); + return this; } public Trace pScenarioPrcRao(final long b) { - if (filled.get(108)) { + if (filled.get(106)) { throw new IllegalStateException("hub.scenario/PRC_RAO already set"); } else { - filled.set(108); + filled.set(106); } - if (b >= 4294967296L) { - throw new IllegalArgumentException("hub.scenario/PRC_RAO has invalid value (" + b + ")"); - } - deploymentNumberInftyXorByteCodeDeploymentStatusXorMmuPhaseXorPrcRao.put((byte) (b >> 24)); - deploymentNumberInftyXorByteCodeDeploymentStatusXorMmuPhaseXorPrcRao.put((byte) (b >> 16)); - deploymentNumberInftyXorByteCodeDeploymentStatusXorMmuPhaseXorPrcRao.put((byte) (b >> 8)); - deploymentNumberInftyXorByteCodeDeploymentStatusXorMmuPhaseXorPrcRao.put((byte) b); + if(b >= 4294967296L) { throw new IllegalArgumentException("hub.scenario/PRC_RAO has invalid value (" + b + ")"); } + codeSizeNewXorByteCodeCodeFragmentIndexXorMmuExoSumXorPrcRaoXorInitCodeSize.put((byte) (b >> 24)); + codeSizeNewXorByteCodeCodeFragmentIndexXorMmuExoSumXorPrcRaoXorInitCodeSize.put((byte) (b >> 16)); + codeSizeNewXorByteCodeCodeFragmentIndexXorMmuExoSumXorPrcRaoXorInitCodeSize.put((byte) (b >> 8)); + codeSizeNewXorByteCodeCodeFragmentIndexXorMmuExoSumXorPrcRaoXorInitCodeSize.put((byte) b); + return this; } - public Trace pScenarioPrcReturnGas(final long b) { - if (filled.get(109)) { + public Trace pScenarioPrcReturnGas(final Bytes b) { + if (filled.get(125)) { throw new IllegalStateException("hub.scenario/PRC_RETURN_GAS already set"); } else { - filled.set(109); + filled.set(125); } - if (b >= 4294967296L) { - throw new IllegalArgumentException( - "hub.scenario/PRC_RETURN_GAS has invalid value (" + b + ")"); - } - deploymentNumberNewXorCallerAddressHiXorMmuRefOffsetXorPrcReturnGas.put((byte) (b >> 24)); - deploymentNumberNewXorCallerAddressHiXorMmuRefOffsetXorPrcReturnGas.put((byte) (b >> 16)); - deploymentNumberNewXorCallerAddressHiXorMmuRefOffsetXorPrcReturnGas.put((byte) (b >> 8)); - deploymentNumberNewXorCallerAddressHiXorMmuRefOffsetXorPrcReturnGas.put((byte) b); + // Trim array to size + Bytes bs = b.trimLeadingZeros(); + // Sanity check against expected width + if(bs.bitLength() > 64) { throw new IllegalArgumentException("hub.scenario/PRC_RETURN_GAS has invalid width (" + bs.bitLength() + "bits)"); } + // Write padding (if necessary) + for(int i=bs.size(); i<8; i++) { stpGasUpfrontGasCostXorPrcReturnGasXorGasLeftover.put((byte) 0); } + // Write bytes + for(int j=0; j 128) { - throw new IllegalArgumentException( - "hub.stack/HASH_INFO_KECCAK_HI has invalid width (" + bs.bitLength() + "bits)"); - } + if(bs.bitLength() > 128) { throw new IllegalArgumentException("hub.stack/HASH_INFO_KECCAK_HI has invalid width (" + bs.bitLength() + "bits)"); } // Write padding (if necessary) - for (int i = bs.size(); i < 16; i++) { - addressLoXorAccountAddressLoXorExpData1XorHashInfoKeccakHiXorAddressLoXorCoinbaseAddressLo - .put((byte) 0); - } + for(int i=bs.size(); i<16; i++) { addressLoXorAccountAddressLoXorExpData1XorHashInfoKeccakHiXorAddressLoXorCoinbaseAddressLo.put((byte) 0); } // Write bytes - for (int j = 0; j < bs.size(); j++) { - addressLoXorAccountAddressLoXorExpData1XorHashInfoKeccakHiXorAddressLoXorCoinbaseAddressLo - .put(bs.get(j)); - } + for(int j=0; j 128) { - throw new IllegalArgumentException( - "hub.stack/HASH_INFO_KECCAK_LO has invalid width (" + bs.bitLength() + "bits)"); - } + if(bs.bitLength() > 128) { throw new IllegalArgumentException("hub.stack/HASH_INFO_KECCAK_LO has invalid width (" + bs.bitLength() + "bits)"); } // Write padding (if necessary) - for (int i = bs.size(); i < 16; i++) { - balanceXorByteCodeAddressLoXorExpData2XorHashInfoKeccakLoXorStorageKeyHiXorFromAddressLo.put( - (byte) 0); - } + for(int i=bs.size(); i<16; i++) { balanceXorByteCodeAddressLoXorExpData2XorHashInfoKeccakLoXorStorageKeyHiXorFromAddressLo.put((byte) 0); } // Write bytes - for (int j = 0; j < bs.size(); j++) { - balanceXorByteCodeAddressLoXorExpData2XorHashInfoKeccakLoXorStorageKeyHiXorFromAddressLo.put( - bs.get(j)); - } + for(int j=0; j 256) { - throw new IllegalArgumentException( - "hub.stack/INSTRUCTION has invalid width (" + bs.bitLength() + "bits)"); - } + if(bs.bitLength() > 256) { throw new IllegalArgumentException("hub.stack/INSTRUCTION has invalid width (" + bs.bitLength() + "bits)"); } // Write padding (if necessary) - for (int i = bs.size(); i < 32; i++) { - instruction.put((byte) 0); - } + for(int i=bs.size(); i<32; i++) { instruction.put((byte) 0); } // Write bytes - for (int j = 0; j < bs.size(); j++) { - instruction.put(bs.get(j)); - } + for(int j=0; j 128) { - throw new IllegalArgumentException( - "hub.stack/PUSH_VALUE_HI has invalid width (" + bs.bitLength() + "bits)"); - } + if(bs.bitLength() > 128) { throw new IllegalArgumentException("hub.stack/PUSH_VALUE_HI has invalid width (" + bs.bitLength() + "bits)"); } // Write padding (if necessary) - for (int i = bs.size(); i < 16; i++) { - balanceNewXorCallerAddressLoXorExpData3XorPushValueHiXorStorageKeyLoXorInitialBalance.put( - (byte) 0); - } + for(int i=bs.size(); i<16; i++) { balanceNewXorCallerAddressLoXorExpData3XorPushValueHiXorStorageKeyLoXorInitialBalance.put((byte) 0); } // Write bytes - for (int j = 0; j < bs.size(); j++) { - balanceNewXorCallerAddressLoXorExpData3XorPushValueHiXorStorageKeyLoXorInitialBalance.put( - bs.get(j)); - } + for(int j=0; j 128) { - throw new IllegalArgumentException( - "hub.stack/PUSH_VALUE_LO has invalid width (" + bs.bitLength() + "bits)"); - } + if(bs.bitLength() > 128) { throw new IllegalArgumentException("hub.stack/PUSH_VALUE_LO has invalid width (" + bs.bitLength() + "bits)"); } // Write padding (if necessary) - for (int i = bs.size(); i < 16; i++) { - codeHashHiXorCallValueXorExpData4XorPushValueLoXorValueCurrHiXorToAddressLo.put((byte) 0); - } + for(int i=bs.size(); i<16; i++) { codeHashHiXorCallValueXorExpData4XorPushValueLoXorValueCurrHiXorToAddressLo.put((byte) 0); } // Write bytes - for (int j = 0; j < bs.size(); j++) { - codeHashHiXorCallValueXorExpData4XorPushValueLoXorValueCurrHiXorToAddressLo.put(bs.get(j)); - } + for(int j=0; j= 2048L) { - throw new IllegalArgumentException( - "hub.stack/STACK_ITEM_HEIGHT_1 has invalid value (" + b + ")"); - } + if(b >= 2048L) { throw new IllegalArgumentException("hub.stack/STACK_ITEM_HEIGHT_1 has invalid value (" + b + ")"); } callStackDepthXorStackItemHeight1.put((byte) (b >> 8)); callStackDepthXorStackItemHeight1.put((byte) b); + return this; } @@ -5468,13 +4496,11 @@ public Trace pStackStackItemHeight2(final long b) { filled.set(98); } - if (b >= 2048L) { - throw new IllegalArgumentException( - "hub.stack/STACK_ITEM_HEIGHT_2 has invalid value (" + b + ")"); - } + if(b >= 2048L) { throw new IllegalArgumentException("hub.stack/STACK_ITEM_HEIGHT_2 has invalid value (" + b + ")"); } stackItemHeight2.put((byte) (b >> 8)); stackItemHeight2.put((byte) b); + return this; } @@ -5485,13 +4511,11 @@ public Trace pStackStackItemHeight3(final long b) { filled.set(99); } - if (b >= 2048L) { - throw new IllegalArgumentException( - "hub.stack/STACK_ITEM_HEIGHT_3 has invalid value (" + b + ")"); - } + if(b >= 2048L) { throw new IllegalArgumentException("hub.stack/STACK_ITEM_HEIGHT_3 has invalid value (" + b + ")"); } stackItemHeight3.put((byte) (b >> 8)); stackItemHeight3.put((byte) b); + return this; } @@ -5502,13 +4526,11 @@ public Trace pStackStackItemHeight4(final long b) { filled.set(100); } - if (b >= 2048L) { - throw new IllegalArgumentException( - "hub.stack/STACK_ITEM_HEIGHT_4 has invalid value (" + b + ")"); - } + if(b >= 2048L) { throw new IllegalArgumentException("hub.stack/STACK_ITEM_HEIGHT_4 has invalid value (" + b + ")"); } stackItemHeight4.put((byte) (b >> 8)); stackItemHeight4.put((byte) b); + return this; } @@ -5567,16 +4589,14 @@ public Trace pStackStackItemStamp1(final long b) { filled.set(119); } - if (b >= 68719476736L) { - throw new IllegalArgumentException( - "hub.stack/STACK_ITEM_STAMP_1 has invalid value (" + b + ")"); - } + if(b >= 68719476736L) { throw new IllegalArgumentException("hub.stack/STACK_ITEM_STAMP_1 has invalid value (" + b + ")"); } stackItemStamp1.put((byte) (b >> 32)); stackItemStamp1.put((byte) (b >> 24)); stackItemStamp1.put((byte) (b >> 16)); stackItemStamp1.put((byte) (b >> 8)); stackItemStamp1.put((byte) b); + return this; } @@ -5587,16 +4607,14 @@ public Trace pStackStackItemStamp2(final long b) { filled.set(120); } - if (b >= 68719476736L) { - throw new IllegalArgumentException( - "hub.stack/STACK_ITEM_STAMP_2 has invalid value (" + b + ")"); - } + if(b >= 68719476736L) { throw new IllegalArgumentException("hub.stack/STACK_ITEM_STAMP_2 has invalid value (" + b + ")"); } stackItemStamp2.put((byte) (b >> 32)); stackItemStamp2.put((byte) (b >> 24)); stackItemStamp2.put((byte) (b >> 16)); stackItemStamp2.put((byte) (b >> 8)); stackItemStamp2.put((byte) b); + return this; } @@ -5607,16 +4625,14 @@ public Trace pStackStackItemStamp3(final long b) { filled.set(121); } - if (b >= 68719476736L) { - throw new IllegalArgumentException( - "hub.stack/STACK_ITEM_STAMP_3 has invalid value (" + b + ")"); - } + if(b >= 68719476736L) { throw new IllegalArgumentException("hub.stack/STACK_ITEM_STAMP_3 has invalid value (" + b + ")"); } stackItemStamp3.put((byte) (b >> 32)); stackItemStamp3.put((byte) (b >> 24)); stackItemStamp3.put((byte) (b >> 16)); stackItemStamp3.put((byte) (b >> 8)); stackItemStamp3.put((byte) b); + return this; } @@ -5627,16 +4643,14 @@ public Trace pStackStackItemStamp4(final long b) { filled.set(122); } - if (b >= 68719476736L) { - throw new IllegalArgumentException( - "hub.stack/STACK_ITEM_STAMP_4 has invalid value (" + b + ")"); - } + if(b >= 68719476736L) { throw new IllegalArgumentException("hub.stack/STACK_ITEM_STAMP_4 has invalid value (" + b + ")"); } stackItemStamp4.put((byte) (b >> 32)); stackItemStamp4.put((byte) (b >> 24)); stackItemStamp4.put((byte) (b >> 16)); stackItemStamp4.put((byte) (b >> 8)); stackItemStamp4.put((byte) b); + return this; } @@ -5650,18 +4664,11 @@ public Trace pStackStackItemValueHi1(final Bytes b) { // Trim array to size Bytes bs = b.trimLeadingZeros(); // Sanity check against expected width - if (bs.bitLength() > 128) { - throw new IllegalArgumentException( - "hub.stack/STACK_ITEM_VALUE_HI_1 has invalid width (" + bs.bitLength() + "bits)"); - } + if(bs.bitLength() > 128) { throw new IllegalArgumentException("hub.stack/STACK_ITEM_VALUE_HI_1 has invalid width (" + bs.bitLength() + "bits)"); } // Write padding (if necessary) - for (int i = bs.size(); i < 16; i++) { - codeHashHiNewXorExpData5XorStackItemValueHi1XorValueCurrLoXorValue.put((byte) 0); - } + for(int i=bs.size(); i<16; i++) { codeHashHiNewXorExpData5XorStackItemValueHi1XorValueCurrLoXorValue.put((byte) 0); } // Write bytes - for (int j = 0; j < bs.size(); j++) { - codeHashHiNewXorExpData5XorStackItemValueHi1XorValueCurrLoXorValue.put(bs.get(j)); - } + for(int j=0; j 128) { - throw new IllegalArgumentException( - "hub.stack/STACK_ITEM_VALUE_HI_2 has invalid width (" + bs.bitLength() + "bits)"); - } + if(bs.bitLength() > 128) { throw new IllegalArgumentException("hub.stack/STACK_ITEM_VALUE_HI_2 has invalid width (" + bs.bitLength() + "bits)"); } // Write padding (if necessary) - for (int i = bs.size(); i < 16; i++) { - codeHashLoXorMmuLimb1XorStackItemValueHi2XorValueNextHi.put((byte) 0); - } + for(int i=bs.size(); i<16; i++) { codeHashLoXorMmuLimb1XorStackItemValueHi2XorValueNextHi.put((byte) 0); } // Write bytes - for (int j = 0; j < bs.size(); j++) { - codeHashLoXorMmuLimb1XorStackItemValueHi2XorValueNextHi.put(bs.get(j)); - } + for(int j=0; j 128) { - throw new IllegalArgumentException( - "hub.stack/STACK_ITEM_VALUE_HI_3 has invalid width (" + bs.bitLength() + "bits)"); - } + if(bs.bitLength() > 128) { throw new IllegalArgumentException("hub.stack/STACK_ITEM_VALUE_HI_3 has invalid width (" + bs.bitLength() + "bits)"); } // Write padding (if necessary) - for (int i = bs.size(); i < 16; i++) { - codeHashLoNewXorMmuLimb2XorStackItemValueHi3XorValueNextLo.put((byte) 0); - } + for(int i=bs.size(); i<16; i++) { codeHashLoNewXorMmuLimb2XorStackItemValueHi3XorValueNextLo.put((byte) 0); } // Write bytes - for (int j = 0; j < bs.size(); j++) { - codeHashLoNewXorMmuLimb2XorStackItemValueHi3XorValueNextLo.put(bs.get(j)); - } + for(int j=0; j 128) { - throw new IllegalArgumentException( - "hub.stack/STACK_ITEM_VALUE_HI_4 has invalid width (" + bs.bitLength() + "bits)"); - } + if(bs.bitLength() > 128) { throw new IllegalArgumentException("hub.stack/STACK_ITEM_VALUE_HI_4 has invalid width (" + bs.bitLength() + "bits)"); } // Write padding (if necessary) - for (int i = bs.size(); i < 16; i++) { - rlpaddrDepAddrLoXorMmuSrcOffsetHiXorStackItemValueHi4XorValueOrigHi.put((byte) 0); - } + for(int i=bs.size(); i<16; i++) { rlpaddrDepAddrLoXorMmuSrcOffsetHiXorStackItemValueHi4XorValueOrigHi.put((byte) 0); } // Write bytes - for (int j = 0; j < bs.size(); j++) { - rlpaddrDepAddrLoXorMmuSrcOffsetHiXorStackItemValueHi4XorValueOrigHi.put(bs.get(j)); - } + for(int j=0; j 128) { - throw new IllegalArgumentException( - "hub.stack/STACK_ITEM_VALUE_LO_1 has invalid width (" + bs.bitLength() + "bits)"); - } + if(bs.bitLength() > 128) { throw new IllegalArgumentException("hub.stack/STACK_ITEM_VALUE_LO_1 has invalid width (" + bs.bitLength() + "bits)"); } // Write padding (if necessary) - for (int i = bs.size(); i < 16; i++) { - rlpaddrKecHiXorMmuSrcOffsetLoXorStackItemValueLo1XorValueOrigLo.put((byte) 0); - } + for(int i=bs.size(); i<16; i++) { rlpaddrKecHiXorMmuSrcOffsetLoXorStackItemValueLo1XorValueOrigLo.put((byte) 0); } // Write bytes - for (int j = 0; j < bs.size(); j++) { - rlpaddrKecHiXorMmuSrcOffsetLoXorStackItemValueLo1XorValueOrigLo.put(bs.get(j)); - } + for(int j=0; j 128) { - throw new IllegalArgumentException( - "hub.stack/STACK_ITEM_VALUE_LO_2 has invalid width (" + bs.bitLength() + "bits)"); - } + if(bs.bitLength() > 128) { throw new IllegalArgumentException("hub.stack/STACK_ITEM_VALUE_LO_2 has invalid width (" + bs.bitLength() + "bits)"); } // Write padding (if necessary) - for (int i = bs.size(); i < 16; i++) { - rlpaddrKecLoXorMmuTgtOffsetLoXorStackItemValueLo2.put((byte) 0); - } + for(int i=bs.size(); i<16; i++) { rlpaddrKecLoXorMmuTgtOffsetLoXorStackItemValueLo2.put((byte) 0); } // Write bytes - for (int j = 0; j < bs.size(); j++) { - rlpaddrKecLoXorMmuTgtOffsetLoXorStackItemValueLo2.put(bs.get(j)); - } + for(int j=0; j 128) { - throw new IllegalArgumentException( - "hub.stack/STACK_ITEM_VALUE_LO_3 has invalid width (" + bs.bitLength() + "bits)"); - } + if(bs.bitLength() > 128) { throw new IllegalArgumentException("hub.stack/STACK_ITEM_VALUE_LO_3 has invalid width (" + bs.bitLength() + "bits)"); } // Write padding (if necessary) - for (int i = bs.size(); i < 16; i++) { - rlpaddrSaltHiXorMxpGasMxpXorStackItemValueLo3.put((byte) 0); - } + for(int i=bs.size(); i<16; i++) { rlpaddrSaltHiXorMxpGasMxpXorStackItemValueLo3.put((byte) 0); } // Write bytes - for (int j = 0; j < bs.size(); j++) { - rlpaddrSaltHiXorMxpGasMxpXorStackItemValueLo3.put(bs.get(j)); - } + for(int j=0; j 128) { - throw new IllegalArgumentException( - "hub.stack/STACK_ITEM_VALUE_LO_4 has invalid width (" + bs.bitLength() + "bits)"); - } + if(bs.bitLength() > 128) { throw new IllegalArgumentException("hub.stack/STACK_ITEM_VALUE_LO_4 has invalid width (" + bs.bitLength() + "bits)"); } // Write padding (if necessary) - for (int i = bs.size(); i < 16; i++) { - rlpaddrSaltLoXorMxpOffset1HiXorStackItemValueLo4.put((byte) 0); - } + for(int i=bs.size(); i<16; i++) { rlpaddrSaltLoXorMxpOffset1HiXorStackItemValueLo4.put((byte) 0); } // Write bytes - for (int j = 0; j < bs.size(); j++) { - rlpaddrSaltLoXorMxpOffset1HiXorStackItemValueLo4.put(bs.get(j)); - } + for(int j=0; j= 4294967296L) { - throw new IllegalArgumentException("hub.stack/STATIC_GAS has invalid value (" + b + ")"); - } - addressHiXorAccountAddressHiXorCcrsStampXorPrcCalleeGasXorStaticGasXorAddressHiXorCallDataSize - .put((byte) (b >> 24)); - addressHiXorAccountAddressHiXorCcrsStampXorPrcCalleeGasXorStaticGasXorAddressHiXorCallDataSize - .put((byte) (b >> 16)); - addressHiXorAccountAddressHiXorCcrsStampXorPrcCalleeGasXorStaticGasXorAddressHiXorCallDataSize - .put((byte) (b >> 8)); - addressHiXorAccountAddressHiXorCcrsStampXorPrcCalleeGasXorStaticGasXorAddressHiXorCallDataSize - .put((byte) b); + if(b >= 4294967296L) { throw new IllegalArgumentException("hub.stack/STATIC_GAS has invalid value (" + b + ")"); } + addressHiXorAccountAddressHiXorCcrsStampXorPrcCdoXorStaticGasXorAddressHiXorCallDataSize.put((byte) (b >> 24)); + addressHiXorAccountAddressHiXorCcrsStampXorPrcCdoXorStaticGasXorAddressHiXorCallDataSize.put((byte) (b >> 16)); + addressHiXorAccountAddressHiXorCcrsStampXorPrcCdoXorStaticGasXorAddressHiXorCallDataSize.put((byte) (b >> 8)); + addressHiXorAccountAddressHiXorCcrsStampXorPrcCdoXorStaticGasXorAddressHiXorCallDataSize.put((byte) b); + return this; } @@ -5973,17 +4926,12 @@ public Trace pStorageAddressHi(final long b) { filled.set(103); } - if (b >= 4294967296L) { - throw new IllegalArgumentException("hub.storage/ADDRESS_HI has invalid value (" + b + ")"); - } - addressHiXorAccountAddressHiXorCcrsStampXorPrcCalleeGasXorStaticGasXorAddressHiXorCallDataSize - .put((byte) (b >> 24)); - addressHiXorAccountAddressHiXorCcrsStampXorPrcCalleeGasXorStaticGasXorAddressHiXorCallDataSize - .put((byte) (b >> 16)); - addressHiXorAccountAddressHiXorCcrsStampXorPrcCalleeGasXorStaticGasXorAddressHiXorCallDataSize - .put((byte) (b >> 8)); - addressHiXorAccountAddressHiXorCcrsStampXorPrcCalleeGasXorStaticGasXorAddressHiXorCallDataSize - .put((byte) b); + if(b >= 4294967296L) { throw new IllegalArgumentException("hub.storage/ADDRESS_HI has invalid value (" + b + ")"); } + addressHiXorAccountAddressHiXorCcrsStampXorPrcCdoXorStaticGasXorAddressHiXorCallDataSize.put((byte) (b >> 24)); + addressHiXorAccountAddressHiXorCcrsStampXorPrcCdoXorStaticGasXorAddressHiXorCallDataSize.put((byte) (b >> 16)); + addressHiXorAccountAddressHiXorCcrsStampXorPrcCdoXorStaticGasXorAddressHiXorCallDataSize.put((byte) (b >> 8)); + addressHiXorAccountAddressHiXorCcrsStampXorPrcCdoXorStaticGasXorAddressHiXorCallDataSize.put((byte) b); + return this; } @@ -5998,20 +4946,11 @@ public Trace pStorageAddressLo(final Bytes b) { // Trim array to size Bytes bs = b.trimLeadingZeros(); // Sanity check against expected width - if (bs.bitLength() > 128) { - throw new IllegalArgumentException( - "hub.storage/ADDRESS_LO has invalid width (" + bs.bitLength() + "bits)"); - } + if(bs.bitLength() > 128) { throw new IllegalArgumentException("hub.storage/ADDRESS_LO has invalid width (" + bs.bitLength() + "bits)"); } // Write padding (if necessary) - for (int i = bs.size(); i < 16; i++) { - addressLoXorAccountAddressLoXorExpData1XorHashInfoKeccakHiXorAddressLoXorCoinbaseAddressLo - .put((byte) 0); - } + for(int i=bs.size(); i<16; i++) { addressLoXorAccountAddressLoXorExpData1XorHashInfoKeccakHiXorAddressLoXorCoinbaseAddressLo.put((byte) 0); } // Write bytes - for (int j = 0; j < bs.size(); j++) { - addressLoXorAccountAddressLoXorExpData1XorHashInfoKeccakHiXorAddressLoXorCoinbaseAddressLo - .put(bs.get(j)); - } + for(int j=0; j= 4294967296L) { - throw new IllegalArgumentException( - "hub.storage/DEPLOYMENT_NUMBER has invalid value (" + b + ")"); - } - codeFragmentIndexXorAccountDeploymentNumberXorExpInstXorPrcCallerGasXorDeploymentNumberXorCoinbaseAddressHi - .put((byte) (b >> 24)); - codeFragmentIndexXorAccountDeploymentNumberXorExpInstXorPrcCallerGasXorDeploymentNumberXorCoinbaseAddressHi - .put((byte) (b >> 16)); - codeFragmentIndexXorAccountDeploymentNumberXorExpInstXorPrcCallerGasXorDeploymentNumberXorCoinbaseAddressHi - .put((byte) (b >> 8)); - codeFragmentIndexXorAccountDeploymentNumberXorExpInstXorPrcCallerGasXorDeploymentNumberXorCoinbaseAddressHi - .put((byte) b); + if(b >= 4294967296L) { throw new IllegalArgumentException("hub.storage/DEPLOYMENT_NUMBER has invalid value (" + b + ")"); } + codeFragmentIndexXorAccountDeploymentNumberXorExpInstXorPrcCdsXorDeploymentNumberXorCoinbaseAddressHi.put((byte) (b >> 24)); + codeFragmentIndexXorAccountDeploymentNumberXorExpInstXorPrcCdsXorDeploymentNumberXorCoinbaseAddressHi.put((byte) (b >> 16)); + codeFragmentIndexXorAccountDeploymentNumberXorExpInstXorPrcCdsXorDeploymentNumberXorCoinbaseAddressHi.put((byte) (b >> 8)); + codeFragmentIndexXorAccountDeploymentNumberXorExpInstXorPrcCdsXorDeploymentNumberXorCoinbaseAddressHi.put((byte) b); + return this; } @@ -6085,13 +5015,11 @@ public Trace pStorageDeploymentNumberFinalInBlock(final long b) { filled.set(101); } - if (b >= 65536L) { - throw new IllegalArgumentException( - "hub.storage/DEPLOYMENT_NUMBER_FINAL_IN_BLOCK has invalid value (" + b + ")"); - } + if(b >= 65536L) { throw new IllegalArgumentException("hub.storage/DEPLOYMENT_NUMBER_FINAL_IN_BLOCK has invalid value (" + b + ")"); } deploymentNumberFinalInBlockXorDeploymentNumberFinalInBlock.put((byte) (b >> 8)); deploymentNumberFinalInBlockXorDeploymentNumberFinalInBlock.put((byte) b); + return this; } @@ -6102,13 +5030,11 @@ public Trace pStorageDeploymentNumberFirstInBlock(final long b) { filled.set(102); } - if (b >= 65536L) { - throw new IllegalArgumentException( - "hub.storage/DEPLOYMENT_NUMBER_FIRST_IN_BLOCK has invalid value (" + b + ")"); - } + if(b >= 65536L) { throw new IllegalArgumentException("hub.storage/DEPLOYMENT_NUMBER_FIRST_IN_BLOCK has invalid value (" + b + ")"); } deploymentNumberFirstInBlockXorDeploymentNumberFirstInBlock.put((byte) (b >> 8)); deploymentNumberFirstInBlockXorDeploymentNumberFirstInBlock.put((byte) b); + return this; } @@ -6119,18 +5045,12 @@ public Trace pStorageDeploymentNumberInfty(final long b) { filled.set(105); } - if (b >= 4294967296L) { - throw new IllegalArgumentException( - "hub.storage/DEPLOYMENT_NUMBER_INFTY has invalid value (" + b + ")"); - } - codeSizeXorByteCodeAddressHiXorMmuAuxIdXorPrcCdoXorDeploymentNumberInftyXorFromAddressHi.put( - (byte) (b >> 24)); - codeSizeXorByteCodeAddressHiXorMmuAuxIdXorPrcCdoXorDeploymentNumberInftyXorFromAddressHi.put( - (byte) (b >> 16)); - codeSizeXorByteCodeAddressHiXorMmuAuxIdXorPrcCdoXorDeploymentNumberInftyXorFromAddressHi.put( - (byte) (b >> 8)); - codeSizeXorByteCodeAddressHiXorMmuAuxIdXorPrcCdoXorDeploymentNumberInftyXorFromAddressHi.put( - (byte) b); + if(b >= 4294967296L) { throw new IllegalArgumentException("hub.storage/DEPLOYMENT_NUMBER_INFTY has invalid value (" + b + ")"); } + codeSizeXorByteCodeAddressHiXorMmuAuxIdXorPrcRacXorDeploymentNumberInftyXorFromAddressHi.put((byte) (b >> 24)); + codeSizeXorByteCodeAddressHiXorMmuAuxIdXorPrcRacXorDeploymentNumberInftyXorFromAddressHi.put((byte) (b >> 16)); + codeSizeXorByteCodeAddressHiXorMmuAuxIdXorPrcRacXorDeploymentNumberInftyXorFromAddressHi.put((byte) (b >> 8)); + codeSizeXorByteCodeAddressHiXorMmuAuxIdXorPrcRacXorDeploymentNumberInftyXorFromAddressHi.put((byte) b); + return this; } @@ -6142,8 +5062,7 @@ public Trace pStorageFinalInBlk(final Boolean b) { filled.set(48); } - deploymentStatusXorMmuSuccessBitXorCallEoaSuccessCallerWontRevertXorBtcFlagXorFinalInBlkXorRequiresEvmExecution - .put((byte) (b ? 1 : 0)); + deploymentStatusXorMmuSuccessBitXorCallEoaSuccessCallerWontRevertXorBtcFlagXorFinalInBlkXorRequiresEvmExecution.put((byte) (b ? 1 : 0)); return this; } @@ -6155,8 +5074,7 @@ public Trace pStorageFinalInCnf(final Boolean b) { filled.set(49); } - deploymentStatusInftyXorMxpDeploysXorCallExceptionXorCallFlagXorFinalInCnfXorStatusCode.put( - (byte) (b ? 1 : 0)); + deploymentStatusInftyXorMxpDeploysXorCallExceptionXorCallFlagXorFinalInCnfXorStatusCode.put((byte) (b ? 1 : 0)); return this; } @@ -6180,8 +5098,7 @@ public Trace pStorageFirstInBlk(final Boolean b) { filled.set(51); } - existsXorMxpMtntopXorCallPrcSuccessCallerWillRevertXorCopyFlagXorFirstInBlk.put( - (byte) (b ? 1 : 0)); + existsXorMxpMtntopXorCallPrcSuccessCallerWillRevertXorCopyFlagXorFirstInBlk.put((byte) (b ? 1 : 0)); return this; } @@ -6193,8 +5110,7 @@ public Trace pStorageFirstInCnf(final Boolean b) { filled.set(52); } - existsNewXorMxpMxpxXorCallPrcSuccessCallerWontRevertXorCreateFlagXorFirstInCnf.put( - (byte) (b ? 1 : 0)); + existsNewXorMxpMxpxXorCallPrcSuccessCallerWontRevertXorCreateFlagXorFirstInCnf.put((byte) (b ? 1 : 0)); return this; } @@ -6206,8 +5122,7 @@ public Trace pStorageFirstInTxn(final Boolean b) { filled.set(53); } - finalInBlkXorMxpSize1NonzeroNoMxpxXorCallSmcFailureCallerWillRevertXorDecFlag1XorFirstInTxn.put( - (byte) (b ? 1 : 0)); + finalInBlkXorMxpSize1NonzeroNoMxpxXorCallSmcFailureCallerWillRevertXorDecFlag1XorFirstInTxn.put((byte) (b ? 1 : 0)); return this; } @@ -6222,20 +5137,11 @@ public Trace pStorageStorageKeyHi(final Bytes b) { // Trim array to size Bytes bs = b.trimLeadingZeros(); // Sanity check against expected width - if (bs.bitLength() > 128) { - throw new IllegalArgumentException( - "hub.storage/STORAGE_KEY_HI has invalid width (" + bs.bitLength() + "bits)"); - } + if(bs.bitLength() > 128) { throw new IllegalArgumentException("hub.storage/STORAGE_KEY_HI has invalid width (" + bs.bitLength() + "bits)"); } // Write padding (if necessary) - for (int i = bs.size(); i < 16; i++) { - balanceXorByteCodeAddressLoXorExpData2XorHashInfoKeccakLoXorStorageKeyHiXorFromAddressLo.put( - (byte) 0); - } + for(int i=bs.size(); i<16; i++) { balanceXorByteCodeAddressLoXorExpData2XorHashInfoKeccakLoXorStorageKeyHiXorFromAddressLo.put((byte) 0); } // Write bytes - for (int j = 0; j < bs.size(); j++) { - balanceXorByteCodeAddressLoXorExpData2XorHashInfoKeccakLoXorStorageKeyHiXorFromAddressLo.put( - bs.get(j)); - } + for(int j=0; j 128) { - throw new IllegalArgumentException( - "hub.storage/STORAGE_KEY_LO has invalid width (" + bs.bitLength() + "bits)"); - } + if(bs.bitLength() > 128) { throw new IllegalArgumentException("hub.storage/STORAGE_KEY_LO has invalid width (" + bs.bitLength() + "bits)"); } // Write padding (if necessary) - for (int i = bs.size(); i < 16; i++) { - balanceNewXorCallerAddressLoXorExpData3XorPushValueHiXorStorageKeyLoXorInitialBalance.put( - (byte) 0); - } + for(int i=bs.size(); i<16; i++) { balanceNewXorCallerAddressLoXorExpData3XorPushValueHiXorStorageKeyLoXorInitialBalance.put((byte) 0); } // Write bytes - for (int j = 0; j < bs.size(); j++) { - balanceNewXorCallerAddressLoXorExpData3XorPushValueHiXorStorageKeyLoXorInitialBalance.put( - bs.get(j)); - } + for(int j=0; j 128) { - throw new IllegalArgumentException( - "hub.storage/VALUE_CURR_HI has invalid width (" + bs.bitLength() + "bits)"); - } + if(bs.bitLength() > 128) { throw new IllegalArgumentException("hub.storage/VALUE_CURR_HI has invalid width (" + bs.bitLength() + "bits)"); } // Write padding (if necessary) - for (int i = bs.size(); i < 16; i++) { - codeHashHiXorCallValueXorExpData4XorPushValueLoXorValueCurrHiXorToAddressLo.put((byte) 0); - } + for(int i=bs.size(); i<16; i++) { codeHashHiXorCallValueXorExpData4XorPushValueLoXorValueCurrHiXorToAddressLo.put((byte) 0); } // Write bytes - for (int j = 0; j < bs.size(); j++) { - codeHashHiXorCallValueXorExpData4XorPushValueLoXorValueCurrHiXorToAddressLo.put(bs.get(j)); - } + for(int j=0; j 128) { - throw new IllegalArgumentException( - "hub.storage/VALUE_CURR_LO has invalid width (" + bs.bitLength() + "bits)"); - } + if(bs.bitLength() > 128) { throw new IllegalArgumentException("hub.storage/VALUE_CURR_LO has invalid width (" + bs.bitLength() + "bits)"); } // Write padding (if necessary) - for (int i = bs.size(); i < 16; i++) { - codeHashHiNewXorExpData5XorStackItemValueHi1XorValueCurrLoXorValue.put((byte) 0); - } + for(int i=bs.size(); i<16; i++) { codeHashHiNewXorExpData5XorStackItemValueHi1XorValueCurrLoXorValue.put((byte) 0); } // Write bytes - for (int j = 0; j < bs.size(); j++) { - codeHashHiNewXorExpData5XorStackItemValueHi1XorValueCurrLoXorValue.put(bs.get(j)); - } + for(int j=0; j 128) { - throw new IllegalArgumentException( - "hub.storage/VALUE_NEXT_HI has invalid width (" + bs.bitLength() + "bits)"); - } + if(bs.bitLength() > 128) { throw new IllegalArgumentException("hub.storage/VALUE_NEXT_HI has invalid width (" + bs.bitLength() + "bits)"); } // Write padding (if necessary) - for (int i = bs.size(); i < 16; i++) { - codeHashLoXorMmuLimb1XorStackItemValueHi2XorValueNextHi.put((byte) 0); - } + for(int i=bs.size(); i<16; i++) { codeHashLoXorMmuLimb1XorStackItemValueHi2XorValueNextHi.put((byte) 0); } // Write bytes - for (int j = 0; j < bs.size(); j++) { - codeHashLoXorMmuLimb1XorStackItemValueHi2XorValueNextHi.put(bs.get(j)); - } + for(int j=0; j 128) { - throw new IllegalArgumentException( - "hub.storage/VALUE_NEXT_LO has invalid width (" + bs.bitLength() + "bits)"); - } + if(bs.bitLength() > 128) { throw new IllegalArgumentException("hub.storage/VALUE_NEXT_LO has invalid width (" + bs.bitLength() + "bits)"); } // Write padding (if necessary) - for (int i = bs.size(); i < 16; i++) { - codeHashLoNewXorMmuLimb2XorStackItemValueHi3XorValueNextLo.put((byte) 0); - } + for(int i=bs.size(); i<16; i++) { codeHashLoNewXorMmuLimb2XorStackItemValueHi3XorValueNextLo.put((byte) 0); } // Write bytes - for (int j = 0; j < bs.size(); j++) { - codeHashLoNewXorMmuLimb2XorStackItemValueHi3XorValueNextLo.put(bs.get(j)); - } + for(int j=0; j 128) { - throw new IllegalArgumentException( - "hub.storage/VALUE_ORIG_HI has invalid width (" + bs.bitLength() + "bits)"); - } + if(bs.bitLength() > 128) { throw new IllegalArgumentException("hub.storage/VALUE_ORIG_HI has invalid width (" + bs.bitLength() + "bits)"); } // Write padding (if necessary) - for (int i = bs.size(); i < 16; i++) { - rlpaddrDepAddrLoXorMmuSrcOffsetHiXorStackItemValueHi4XorValueOrigHi.put((byte) 0); - } + for(int i=bs.size(); i<16; i++) { rlpaddrDepAddrLoXorMmuSrcOffsetHiXorStackItemValueHi4XorValueOrigHi.put((byte) 0); } // Write bytes - for (int j = 0; j < bs.size(); j++) { - rlpaddrDepAddrLoXorMmuSrcOffsetHiXorStackItemValueHi4XorValueOrigHi.put(bs.get(j)); - } + for(int j=0; j 128) { - throw new IllegalArgumentException( - "hub.storage/VALUE_ORIG_LO has invalid width (" + bs.bitLength() + "bits)"); - } + if(bs.bitLength() > 128) { throw new IllegalArgumentException("hub.storage/VALUE_ORIG_LO has invalid width (" + bs.bitLength() + "bits)"); } // Write padding (if necessary) - for (int i = bs.size(); i < 16; i++) { - rlpaddrKecHiXorMmuSrcOffsetLoXorStackItemValueLo1XorValueOrigLo.put((byte) 0); - } + for(int i=bs.size(); i<16; i++) { rlpaddrKecHiXorMmuSrcOffsetLoXorStackItemValueLo1XorValueOrigLo.put((byte) 0); } // Write bytes - for (int j = 0; j < bs.size(); j++) { - rlpaddrKecHiXorMmuSrcOffsetLoXorStackItemValueLo1XorValueOrigLo.put(bs.get(j)); - } + for(int j=0; j 64) { - throw new IllegalArgumentException( - "hub.transaction/BASEFEE has invalid width (" + bs.bitLength() + "bits)"); - } + if(bs.bitLength() > 64) { throw new IllegalArgumentException("hub.transaction/BASEFEE has invalid width (" + bs.bitLength() + "bits)"); } // Write padding (if necessary) - for (int i = bs.size(); i < 8; i++) { - nonceXorStpGasMxpXorBasefee.put((byte) 0); - } + for(int i=bs.size(); i<8; i++) { nonceXorStpGasMxpXorPrcCalleeGasXorBasefee.put((byte) 0); } // Write bytes - for (int j = 0; j < bs.size(); j++) { - nonceXorStpGasMxpXorBasefee.put(bs.get(j)); - } + for(int j=0; j= 4294967296L) { - throw new IllegalArgumentException( - "hub.transaction/CALL_DATA_SIZE has invalid value (" + b + ")"); - } - addressHiXorAccountAddressHiXorCcrsStampXorPrcCalleeGasXorStaticGasXorAddressHiXorCallDataSize - .put((byte) (b >> 24)); - addressHiXorAccountAddressHiXorCcrsStampXorPrcCalleeGasXorStaticGasXorAddressHiXorCallDataSize - .put((byte) (b >> 16)); - addressHiXorAccountAddressHiXorCcrsStampXorPrcCalleeGasXorStaticGasXorAddressHiXorCallDataSize - .put((byte) (b >> 8)); - addressHiXorAccountAddressHiXorCcrsStampXorPrcCalleeGasXorStaticGasXorAddressHiXorCallDataSize - .put((byte) b); + if(b >= 4294967296L) { throw new IllegalArgumentException("hub.transaction/CALL_DATA_SIZE has invalid value (" + b + ")"); } + addressHiXorAccountAddressHiXorCcrsStampXorPrcCdoXorStaticGasXorAddressHiXorCallDataSize.put((byte) (b >> 24)); + addressHiXorAccountAddressHiXorCcrsStampXorPrcCdoXorStaticGasXorAddressHiXorCallDataSize.put((byte) (b >> 16)); + addressHiXorAccountAddressHiXorCcrsStampXorPrcCdoXorStaticGasXorAddressHiXorCallDataSize.put((byte) (b >> 8)); + addressHiXorAccountAddressHiXorCcrsStampXorPrcCdoXorStaticGasXorAddressHiXorCallDataSize.put((byte) b); + return this; } @@ -6594,18 +5430,12 @@ public Trace pTransactionCoinbaseAddressHi(final long b) { filled.set(104); } - if (b >= 4294967296L) { - throw new IllegalArgumentException( - "hub.transaction/COINBASE_ADDRESS_HI has invalid value (" + b + ")"); - } - codeFragmentIndexXorAccountDeploymentNumberXorExpInstXorPrcCallerGasXorDeploymentNumberXorCoinbaseAddressHi - .put((byte) (b >> 24)); - codeFragmentIndexXorAccountDeploymentNumberXorExpInstXorPrcCallerGasXorDeploymentNumberXorCoinbaseAddressHi - .put((byte) (b >> 16)); - codeFragmentIndexXorAccountDeploymentNumberXorExpInstXorPrcCallerGasXorDeploymentNumberXorCoinbaseAddressHi - .put((byte) (b >> 8)); - codeFragmentIndexXorAccountDeploymentNumberXorExpInstXorPrcCallerGasXorDeploymentNumberXorCoinbaseAddressHi - .put((byte) b); + if(b >= 4294967296L) { throw new IllegalArgumentException("hub.transaction/COINBASE_ADDRESS_HI has invalid value (" + b + ")"); } + codeFragmentIndexXorAccountDeploymentNumberXorExpInstXorPrcCdsXorDeploymentNumberXorCoinbaseAddressHi.put((byte) (b >> 24)); + codeFragmentIndexXorAccountDeploymentNumberXorExpInstXorPrcCdsXorDeploymentNumberXorCoinbaseAddressHi.put((byte) (b >> 16)); + codeFragmentIndexXorAccountDeploymentNumberXorExpInstXorPrcCdsXorDeploymentNumberXorCoinbaseAddressHi.put((byte) (b >> 8)); + codeFragmentIndexXorAccountDeploymentNumberXorExpInstXorPrcCdsXorDeploymentNumberXorCoinbaseAddressHi.put((byte) b); + return this; } @@ -6620,20 +5450,11 @@ public Trace pTransactionCoinbaseAddressLo(final Bytes b) { // Trim array to size Bytes bs = b.trimLeadingZeros(); // Sanity check against expected width - if (bs.bitLength() > 128) { - throw new IllegalArgumentException( - "hub.transaction/COINBASE_ADDRESS_LO has invalid width (" + bs.bitLength() + "bits)"); - } + if(bs.bitLength() > 128) { throw new IllegalArgumentException("hub.transaction/COINBASE_ADDRESS_LO has invalid width (" + bs.bitLength() + "bits)"); } // Write padding (if necessary) - for (int i = bs.size(); i < 16; i++) { - addressLoXorAccountAddressLoXorExpData1XorHashInfoKeccakHiXorAddressLoXorCoinbaseAddressLo - .put((byte) 0); - } + for(int i=bs.size(); i<16; i++) { addressLoXorAccountAddressLoXorExpData1XorHashInfoKeccakHiXorAddressLoXorCoinbaseAddressLo.put((byte) 0); } // Write bytes - for (int j = 0; j < bs.size(); j++) { - addressLoXorAccountAddressLoXorExpData1XorHashInfoKeccakHiXorAddressLoXorCoinbaseAddressLo - .put(bs.get(j)); - } + for(int j=0; j= 4294967296L) { - throw new IllegalArgumentException( - "hub.transaction/FROM_ADDRESS_HI has invalid value (" + b + ")"); - } - codeSizeXorByteCodeAddressHiXorMmuAuxIdXorPrcCdoXorDeploymentNumberInftyXorFromAddressHi.put( - (byte) (b >> 24)); - codeSizeXorByteCodeAddressHiXorMmuAuxIdXorPrcCdoXorDeploymentNumberInftyXorFromAddressHi.put( - (byte) (b >> 16)); - codeSizeXorByteCodeAddressHiXorMmuAuxIdXorPrcCdoXorDeploymentNumberInftyXorFromAddressHi.put( - (byte) (b >> 8)); - codeSizeXorByteCodeAddressHiXorMmuAuxIdXorPrcCdoXorDeploymentNumberInftyXorFromAddressHi.put( - (byte) b); + if(b >= 4294967296L) { throw new IllegalArgumentException("hub.transaction/FROM_ADDRESS_HI has invalid value (" + b + ")"); } + codeSizeXorByteCodeAddressHiXorMmuAuxIdXorPrcRacXorDeploymentNumberInftyXorFromAddressHi.put((byte) (b >> 24)); + codeSizeXorByteCodeAddressHiXorMmuAuxIdXorPrcRacXorDeploymentNumberInftyXorFromAddressHi.put((byte) (b >> 16)); + codeSizeXorByteCodeAddressHiXorMmuAuxIdXorPrcRacXorDeploymentNumberInftyXorFromAddressHi.put((byte) (b >> 8)); + codeSizeXorByteCodeAddressHiXorMmuAuxIdXorPrcRacXorDeploymentNumberInftyXorFromAddressHi.put((byte) b); + return this; } @@ -6684,20 +5498,11 @@ public Trace pTransactionFromAddressLo(final Bytes b) { // Trim array to size Bytes bs = b.trimLeadingZeros(); // Sanity check against expected width - if (bs.bitLength() > 128) { - throw new IllegalArgumentException( - "hub.transaction/FROM_ADDRESS_LO has invalid width (" + bs.bitLength() + "bits)"); - } + if(bs.bitLength() > 128) { throw new IllegalArgumentException("hub.transaction/FROM_ADDRESS_LO has invalid width (" + bs.bitLength() + "bits)"); } // Write padding (if necessary) - for (int i = bs.size(); i < 16; i++) { - balanceXorByteCodeAddressLoXorExpData2XorHashInfoKeccakLoXorStorageKeyHiXorFromAddressLo.put( - (byte) 0); - } + for(int i=bs.size(); i<16; i++) { balanceXorByteCodeAddressLoXorExpData2XorHashInfoKeccakLoXorStorageKeyHiXorFromAddressLo.put((byte) 0); } // Write bytes - for (int j = 0; j < bs.size(); j++) { - balanceXorByteCodeAddressLoXorExpData2XorHashInfoKeccakLoXorStorageKeyHiXorFromAddressLo.put( - bs.get(j)); - } + for(int j=0; j 64) { - throw new IllegalArgumentException( - "hub.transaction/GAS_INITIALLY_AVAILABLE has invalid width (" + bs.bitLength() + "bits)"); - } + if(bs.bitLength() > 64) { throw new IllegalArgumentException("hub.transaction/GAS_INITIALLY_AVAILABLE has invalid width (" + bs.bitLength() + "bits)"); } // Write padding (if necessary) - for (int i = bs.size(); i < 8; i++) { - nonceNewXorStpGasPaidOutOfPocketXorGasInitiallyAvailable.put((byte) 0); - } + for(int i=bs.size(); i<8; i++) { nonceNewXorStpGasPaidOutOfPocketXorPrcCallerGasXorGasInitiallyAvailable.put((byte) 0); } // Write bytes - for (int j = 0; j < bs.size(); j++) { - nonceNewXorStpGasPaidOutOfPocketXorGasInitiallyAvailable.put(bs.get(j)); - } + for(int j=0; j 64) { - throw new IllegalArgumentException( - "hub.transaction/GAS_LEFTOVER has invalid width (" + bs.bitLength() + "bits)"); - } + if(bs.bitLength() > 64) { throw new IllegalArgumentException("hub.transaction/GAS_LEFTOVER has invalid width (" + bs.bitLength() + "bits)"); } // Write padding (if necessary) - for (int i = bs.size(); i < 8; i++) { - stpGasUpfrontGasCostXorGasLeftover.put((byte) 0); - } + for(int i=bs.size(); i<8; i++) { stpGasUpfrontGasCostXorPrcReturnGasXorGasLeftover.put((byte) 0); } // Write bytes - for (int j = 0; j < bs.size(); j++) { - stpGasUpfrontGasCostXorGasLeftover.put(bs.get(j)); - } + for(int j=0; j 64) { - throw new IllegalArgumentException( - "hub.transaction/GAS_LIMIT has invalid width (" + bs.bitLength() + "bits)"); - } + if(bs.bitLength() > 64) { throw new IllegalArgumentException("hub.transaction/GAS_LIMIT has invalid width (" + bs.bitLength() + "bits)"); } // Write padding (if necessary) - for (int i = bs.size(); i < 8; i++) { - gasLimit.put((byte) 0); - } + for(int i=bs.size(); i<8; i++) { gasLimit.put((byte) 0); } // Write bytes - for (int j = 0; j < bs.size(); j++) { - gasLimit.put(bs.get(j)); - } + for(int j=0; j 64) { - throw new IllegalArgumentException( - "hub.transaction/GAS_PRICE has invalid width (" + bs.bitLength() + "bits)"); - } + if(bs.bitLength() > 64) { throw new IllegalArgumentException("hub.transaction/GAS_PRICE has invalid width (" + bs.bitLength() + "bits)"); } // Write padding (if necessary) - for (int i = bs.size(); i < 8; i++) { - gasPrice.put((byte) 0); - } + for(int i=bs.size(); i<8; i++) { gasPrice.put((byte) 0); } // Write bytes - for (int j = 0; j < bs.size(); j++) { - gasPrice.put(bs.get(j)); - } + for(int j=0; j= 4294967296L) { - throw new IllegalArgumentException( - "hub.transaction/INIT_CODE_SIZE has invalid value (" + b + ")"); - } - codeSizeNewXorByteCodeCodeFragmentIndexXorMmuExoSumXorPrcCdsXorInitCodeSize.put( - (byte) (b >> 24)); - codeSizeNewXorByteCodeCodeFragmentIndexXorMmuExoSumXorPrcCdsXorInitCodeSize.put( - (byte) (b >> 16)); - codeSizeNewXorByteCodeCodeFragmentIndexXorMmuExoSumXorPrcCdsXorInitCodeSize.put( - (byte) (b >> 8)); - codeSizeNewXorByteCodeCodeFragmentIndexXorMmuExoSumXorPrcCdsXorInitCodeSize.put((byte) b); + if(b >= 4294967296L) { throw new IllegalArgumentException("hub.transaction/INIT_CODE_SIZE has invalid value (" + b + ")"); } + codeSizeNewXorByteCodeCodeFragmentIndexXorMmuExoSumXorPrcRaoXorInitCodeSize.put((byte) (b >> 24)); + codeSizeNewXorByteCodeCodeFragmentIndexXorMmuExoSumXorPrcRaoXorInitCodeSize.put((byte) (b >> 16)); + codeSizeNewXorByteCodeCodeFragmentIndexXorMmuExoSumXorPrcRaoXorInitCodeSize.put((byte) (b >> 8)); + codeSizeNewXorByteCodeCodeFragmentIndexXorMmuExoSumXorPrcRaoXorInitCodeSize.put((byte) b); + return this; } @@ -6838,20 +5610,11 @@ public Trace pTransactionInitialBalance(final Bytes b) { // Trim array to size Bytes bs = b.trimLeadingZeros(); // Sanity check against expected width - if (bs.bitLength() > 128) { - throw new IllegalArgumentException( - "hub.transaction/INITIAL_BALANCE has invalid width (" + bs.bitLength() + "bits)"); - } + if(bs.bitLength() > 128) { throw new IllegalArgumentException("hub.transaction/INITIAL_BALANCE has invalid width (" + bs.bitLength() + "bits)"); } // Write padding (if necessary) - for (int i = bs.size(); i < 16; i++) { - balanceNewXorCallerAddressLoXorExpData3XorPushValueHiXorStorageKeyLoXorInitialBalance.put( - (byte) 0); - } + for(int i=bs.size(); i<16; i++) { balanceNewXorCallerAddressLoXorExpData3XorPushValueHiXorStorageKeyLoXorInitialBalance.put((byte) 0); } // Write bytes - for (int j = 0; j < bs.size(); j++) { - balanceNewXorCallerAddressLoXorExpData3XorPushValueHiXorStorageKeyLoXorInitialBalance.put( - bs.get(j)); - } + for(int j=0; j 64) { - throw new IllegalArgumentException( - "hub.transaction/NONCE has invalid width (" + bs.bitLength() + "bits)"); - } + if(bs.bitLength() > 64) { throw new IllegalArgumentException("hub.transaction/NONCE has invalid width (" + bs.bitLength() + "bits)"); } // Write padding (if necessary) - for (int i = bs.size(); i < 8; i++) { - nonce.put((byte) 0); - } + for(int i=bs.size(); i<8; i++) { nonce.put((byte) 0); } // Write bytes - for (int j = 0; j < bs.size(); j++) { - nonce.put(bs.get(j)); - } + for(int j=0; j 64) { - throw new IllegalArgumentException( - "hub.transaction/PRIORITY_FEE_PER_GAS has invalid width (" + bs.bitLength() + "bits)"); - } + if(bs.bitLength() > 64) { throw new IllegalArgumentException("hub.transaction/PRIORITY_FEE_PER_GAS has invalid width (" + bs.bitLength() + "bits)"); } // Write padding (if necessary) - for (int i = bs.size(); i < 8; i++) { - priorityFeePerGas.put((byte) 0); - } + for(int i=bs.size(); i<8; i++) { priorityFeePerGas.put((byte) 0); } // Write bytes - for (int j = 0; j < bs.size(); j++) { - priorityFeePerGas.put(bs.get(j)); - } + for(int j=0; j 64) { - throw new IllegalArgumentException( - "hub.transaction/REFUND_COUNTER_INFINITY has invalid width (" + bs.bitLength() + "bits)"); - } + if(bs.bitLength() > 64) { throw new IllegalArgumentException("hub.transaction/REFUND_COUNTER_INFINITY has invalid width (" + bs.bitLength() + "bits)"); } // Write padding (if necessary) - for (int i = bs.size(); i < 8; i++) { - refundCounterInfinity.put((byte) 0); - } + for(int i=bs.size(); i<8; i++) { refundCounterInfinity.put((byte) 0); } // Write bytes - for (int j = 0; j < bs.size(); j++) { - refundCounterInfinity.put(bs.get(j)); - } + for(int j=0; j 64) { - throw new IllegalArgumentException( - "hub.transaction/REFUND_EFFECTIVE has invalid width (" + bs.bitLength() + "bits)"); - } + if(bs.bitLength() > 64) { throw new IllegalArgumentException("hub.transaction/REFUND_EFFECTIVE has invalid width (" + bs.bitLength() + "bits)"); } // Write padding (if necessary) - for (int i = bs.size(); i < 8; i++) { - refundEffective.put((byte) 0); - } + for(int i=bs.size(); i<8; i++) { refundEffective.put((byte) 0); } // Write bytes - for (int j = 0; j < bs.size(); j++) { - refundEffective.put(bs.get(j)); - } + for(int j=0; j= 4294967296L) { - throw new IllegalArgumentException( - "hub.transaction/TO_ADDRESS_HI has invalid value (" + b + ")"); - } - deploymentNumberXorByteCodeDeploymentNumberXorMmuInstXorPrcRacXorToAddressHi.put( - (byte) (b >> 24)); - deploymentNumberXorByteCodeDeploymentNumberXorMmuInstXorPrcRacXorToAddressHi.put( - (byte) (b >> 16)); - deploymentNumberXorByteCodeDeploymentNumberXorMmuInstXorPrcRacXorToAddressHi.put( - (byte) (b >> 8)); - deploymentNumberXorByteCodeDeploymentNumberXorMmuInstXorPrcRacXorToAddressHi.put((byte) b); + if(b >= 4294967296L) { throw new IllegalArgumentException("hub.transaction/TO_ADDRESS_HI has invalid value (" + b + ")"); } + deploymentNumberXorByteCodeDeploymentNumberXorMmuInstXorToAddressHi.put((byte) (b >> 24)); + deploymentNumberXorByteCodeDeploymentNumberXorMmuInstXorToAddressHi.put((byte) (b >> 16)); + deploymentNumberXorByteCodeDeploymentNumberXorMmuInstXorToAddressHi.put((byte) (b >> 8)); + deploymentNumberXorByteCodeDeploymentNumberXorMmuInstXorToAddressHi.put((byte) b); + return this; } @@ -7044,18 +5770,11 @@ public Trace pTransactionToAddressLo(final Bytes b) { // Trim array to size Bytes bs = b.trimLeadingZeros(); // Sanity check against expected width - if (bs.bitLength() > 128) { - throw new IllegalArgumentException( - "hub.transaction/TO_ADDRESS_LO has invalid width (" + bs.bitLength() + "bits)"); - } + if(bs.bitLength() > 128) { throw new IllegalArgumentException("hub.transaction/TO_ADDRESS_LO has invalid width (" + bs.bitLength() + "bits)"); } // Write padding (if necessary) - for (int i = bs.size(); i < 16; i++) { - codeHashHiXorCallValueXorExpData4XorPushValueLoXorValueCurrHiXorToAddressLo.put((byte) 0); - } + for(int i=bs.size(); i<16; i++) { codeHashHiXorCallValueXorExpData4XorPushValueLoXorValueCurrHiXorToAddressLo.put((byte) 0); } // Write bytes - for (int j = 0; j < bs.size(); j++) { - codeHashHiXorCallValueXorExpData4XorPushValueLoXorValueCurrHiXorToAddressLo.put(bs.get(j)); - } + for(int j=0; j 128) { - throw new IllegalArgumentException( - "hub.transaction/VALUE has invalid width (" + bs.bitLength() + "bits)"); - } + if(bs.bitLength() > 128) { throw new IllegalArgumentException("hub.transaction/VALUE has invalid width (" + bs.bitLength() + "bits)"); } // Write padding (if necessary) - for (int i = bs.size(); i < 16; i++) { - codeHashHiNewXorExpData5XorStackItemValueHi1XorValueCurrLoXorValue.put((byte) 0); - } + for(int i=bs.size(); i<16; i++) { codeHashHiNewXorExpData5XorStackItemValueHi1XorValueCurrLoXorValue.put((byte) 0); } // Write bytes - for (int j = 0; j < bs.size(); j++) { - codeHashHiNewXorExpData5XorStackItemValueHi1XorValueCurrLoXorValue.put(bs.get(j)); - } + for(int j=0; j= 4294967296L) { - throw new IllegalArgumentException("hub.PROGRAM_COUNTER has invalid value (" + b + ")"); - } + if(b >= 4294967296L) { throw new IllegalArgumentException("hub.PROGRAM_COUNTER has invalid value (" + b + ")"); } programCounter.put((byte) (b >> 24)); programCounter.put((byte) (b >> 16)); programCounter.put((byte) (b >> 8)); programCounter.put((byte) b); + return this; } @@ -7195,14 +5906,13 @@ public Trace programCounterNew(final long b) { filled.set(34); } - if (b >= 4294967296L) { - throw new IllegalArgumentException("hub.PROGRAM_COUNTER_NEW has invalid value (" + b + ")"); - } + if(b >= 4294967296L) { throw new IllegalArgumentException("hub.PROGRAM_COUNTER_NEW has invalid value (" + b + ")"); } programCounterNew.put((byte) (b >> 24)); programCounterNew.put((byte) (b >> 16)); programCounterNew.put((byte) (b >> 8)); programCounterNew.put((byte) b); + return this; } @@ -7213,14 +5923,13 @@ public Trace refundCounter(final long b) { filled.set(35); } - if (b >= 4294967296L) { - throw new IllegalArgumentException("hub.REFUND_COUNTER has invalid value (" + b + ")"); - } + if(b >= 4294967296L) { throw new IllegalArgumentException("hub.REFUND_COUNTER has invalid value (" + b + ")"); } refundCounter.put((byte) (b >> 24)); refundCounter.put((byte) (b >> 16)); refundCounter.put((byte) (b >> 8)); refundCounter.put((byte) b); + return this; } @@ -7231,14 +5940,13 @@ public Trace refundCounterNew(final long b) { filled.set(36); } - if (b >= 4294967296L) { - throw new IllegalArgumentException("hub.REFUND_COUNTER_NEW has invalid value (" + b + ")"); - } + if(b >= 4294967296L) { throw new IllegalArgumentException("hub.REFUND_COUNTER_NEW has invalid value (" + b + ")"); } refundCounterNew.put((byte) (b >> 24)); refundCounterNew.put((byte) (b >> 16)); refundCounterNew.put((byte) (b >> 8)); refundCounterNew.put((byte) b); + return this; } @@ -7249,12 +5957,11 @@ public Trace relativeBlockNumber(final long b) { filled.set(37); } - if (b >= 65536L) { - throw new IllegalArgumentException("hub.RELATIVE_BLOCK_NUMBER has invalid value (" + b + ")"); - } + if(b >= 65536L) { throw new IllegalArgumentException("hub.RELATIVE_BLOCK_NUMBER has invalid value (" + b + ")"); } relativeBlockNumber.put((byte) (b >> 8)); relativeBlockNumber.put((byte) b); + return this; } @@ -7265,14 +5972,13 @@ public Trace subStamp(final long b) { filled.set(38); } - if (b >= 4294967296L) { - throw new IllegalArgumentException("hub.SUB_STAMP has invalid value (" + b + ")"); - } + if(b >= 4294967296L) { throw new IllegalArgumentException("hub.SUB_STAMP has invalid value (" + b + ")"); } subStamp.put((byte) (b >> 24)); subStamp.put((byte) (b >> 16)); subStamp.put((byte) (b >> 8)); subStamp.put((byte) b); + return this; } @@ -7354,28 +6060,23 @@ public Trace validateRow() { } if (!filled.get(103)) { - throw new IllegalStateException( - "hub.ADDRESS_HI_xor_ACCOUNT_ADDRESS_HI_xor_CCRS_STAMP_xor_PRC_CALLEE_GAS_xor_STATIC_GAS_xor_ADDRESS_HI_xor_CALL_DATA_SIZE has not been filled"); + throw new IllegalStateException("hub.ADDRESS_HI_xor_ACCOUNT_ADDRESS_HI_xor_CCRS_STAMP_xor_PRC_CDO_xor_STATIC_GAS_xor_ADDRESS_HI_xor_CALL_DATA_SIZE has not been filled"); } if (!filled.get(132)) { - throw new IllegalStateException( - "hub.ADDRESS_LO_xor_ACCOUNT_ADDRESS_LO_xor_EXP_DATA_1_xor_HASH_INFO_KECCAK_HI_xor_ADDRESS_LO_xor_COINBASE_ADDRESS_LO has not been filled"); + throw new IllegalStateException("hub.ADDRESS_LO_xor_ACCOUNT_ADDRESS_LO_xor_EXP_DATA_1_xor_HASH_INFO_KECCAK_HI_xor_ADDRESS_LO_xor_COINBASE_ADDRESS_LO has not been filled"); } if (!filled.get(45)) { - throw new IllegalStateException( - "hub.AGAIN_IN_BLK_xor_IS_ROOT_xor_CCSR_FLAG_xor_CALL_ABORT_WILL_REVERT_xor_ACC_FLAG_xor_AGAIN_IN_BLK_xor_COPY_TXCD has not been filled"); + throw new IllegalStateException("hub.AGAIN_IN_BLK_xor_IS_ROOT_xor_CCSR_FLAG_xor_CALL_ABORT_WILL_REVERT_xor_ACC_FLAG_xor_AGAIN_IN_BLK_xor_COPY_TXCD has not been filled"); } if (!filled.get(46)) { - throw new IllegalStateException( - "hub.AGAIN_IN_CNF_xor_IS_STATIC_xor_EXP_FLAG_xor_CALL_ABORT_WONT_REVERT_xor_ADD_FLAG_xor_AGAIN_IN_CNF_xor_IS_DEPLOYMENT has not been filled"); + throw new IllegalStateException("hub.AGAIN_IN_CNF_xor_IS_STATIC_xor_EXP_FLAG_xor_CALL_ABORT_WONT_REVERT_xor_ADD_FLAG_xor_AGAIN_IN_CNF_xor_IS_DEPLOYMENT has not been filled"); } if (!filled.get(47)) { - throw new IllegalStateException( - "hub.AGAIN_IN_TXN_xor_UPDATE_xor_MMU_FLAG_xor_CALL_EOA_SUCCESS_CALLER_WILL_REVERT_xor_BIN_FLAG_xor_AGAIN_IN_TXN_xor_IS_TYPE2 has not been filled"); + throw new IllegalStateException("hub.AGAIN_IN_TXN_xor_UPDATE_xor_MMU_FLAG_xor_CALL_EOA_SUCCESS_CALLER_WILL_REVERT_xor_BIN_FLAG_xor_AGAIN_IN_TXN_xor_IS_TYPE2 has not been filled"); } if (!filled.get(94)) { @@ -7383,13 +6084,11 @@ public Trace validateRow() { } if (!filled.get(134)) { - throw new IllegalStateException( - "hub.BALANCE_NEW_xor_CALLER_ADDRESS_LO_xor_EXP_DATA_3_xor_PUSH_VALUE_HI_xor_STORAGE_KEY_LO_xor_INITIAL_BALANCE has not been filled"); + throw new IllegalStateException("hub.BALANCE_NEW_xor_CALLER_ADDRESS_LO_xor_EXP_DATA_3_xor_PUSH_VALUE_HI_xor_STORAGE_KEY_LO_xor_INITIAL_BALANCE has not been filled"); } if (!filled.get(133)) { - throw new IllegalStateException( - "hub.BALANCE_xor_BYTE_CODE_ADDRESS_LO_xor_EXP_DATA_2_xor_HASH_INFO_KECCAK_LO_xor_STORAGE_KEY_HI_xor_FROM_ADDRESS_LO has not been filled"); + throw new IllegalStateException("hub.BALANCE_xor_BYTE_CODE_ADDRESS_LO_xor_EXP_DATA_2_xor_HASH_INFO_KECCAK_LO_xor_STORAGE_KEY_HI_xor_FROM_ADDRESS_LO has not been filled"); } if (!filled.get(111)) { @@ -7401,8 +6100,7 @@ public Trace validateRow() { } if (!filled.get(97)) { - throw new IllegalStateException( - "hub.CALL_STACK_DEPTH_xor_STACK_ITEM_HEIGHT_1 has not been filled"); + throw new IllegalStateException("hub.CALL_STACK_DEPTH_xor_STACK_ITEM_HEIGHT_1 has not been filled"); } if (!filled.get(1)) { @@ -7414,38 +6112,31 @@ public Trace validateRow() { } if (!filled.get(104)) { - throw new IllegalStateException( - "hub.CODE_FRAGMENT_INDEX_xor_ACCOUNT_DEPLOYMENT_NUMBER_xor_EXP_INST_xor_PRC_CALLER_GAS_xor_DEPLOYMENT_NUMBER_xor_COINBASE_ADDRESS_HI has not been filled"); + throw new IllegalStateException("hub.CODE_FRAGMENT_INDEX_xor_ACCOUNT_DEPLOYMENT_NUMBER_xor_EXP_INST_xor_PRC_CDS_xor_DEPLOYMENT_NUMBER_xor_COINBASE_ADDRESS_HI has not been filled"); } if (!filled.get(136)) { - throw new IllegalStateException( - "hub.CODE_HASH_HI_NEW_xor_EXP_DATA_5_xor_STACK_ITEM_VALUE_HI_1_xor_VALUE_CURR_LO_xor_VALUE has not been filled"); + throw new IllegalStateException("hub.CODE_HASH_HI_NEW_xor_EXP_DATA_5_xor_STACK_ITEM_VALUE_HI_1_xor_VALUE_CURR_LO_xor_VALUE has not been filled"); } if (!filled.get(135)) { - throw new IllegalStateException( - "hub.CODE_HASH_HI_xor_CALL_VALUE_xor_EXP_DATA_4_xor_PUSH_VALUE_LO_xor_VALUE_CURR_HI_xor_TO_ADDRESS_LO has not been filled"); + throw new IllegalStateException("hub.CODE_HASH_HI_xor_CALL_VALUE_xor_EXP_DATA_4_xor_PUSH_VALUE_LO_xor_VALUE_CURR_HI_xor_TO_ADDRESS_LO has not been filled"); } if (!filled.get(138)) { - throw new IllegalStateException( - "hub.CODE_HASH_LO_NEW_xor_MMU_LIMB_2_xor_STACK_ITEM_VALUE_HI_3_xor_VALUE_NEXT_LO has not been filled"); + throw new IllegalStateException("hub.CODE_HASH_LO_NEW_xor_MMU_LIMB_2_xor_STACK_ITEM_VALUE_HI_3_xor_VALUE_NEXT_LO has not been filled"); } if (!filled.get(137)) { - throw new IllegalStateException( - "hub.CODE_HASH_LO_xor_MMU_LIMB_1_xor_STACK_ITEM_VALUE_HI_2_xor_VALUE_NEXT_HI has not been filled"); + throw new IllegalStateException("hub.CODE_HASH_LO_xor_MMU_LIMB_1_xor_STACK_ITEM_VALUE_HI_2_xor_VALUE_NEXT_HI has not been filled"); } if (!filled.get(106)) { - throw new IllegalStateException( - "hub.CODE_SIZE_NEW_xor_BYTE_CODE_CODE_FRAGMENT_INDEX_xor_MMU_EXO_SUM_xor_PRC_CDS_xor_INIT_CODE_SIZE has not been filled"); + throw new IllegalStateException("hub.CODE_SIZE_NEW_xor_BYTE_CODE_CODE_FRAGMENT_INDEX_xor_MMU_EXO_SUM_xor_PRC_RAO_xor_INIT_CODE_SIZE has not been filled"); } if (!filled.get(105)) { - throw new IllegalStateException( - "hub.CODE_SIZE_xor_BYTE_CODE_ADDRESS_HI_xor_MMU_AUX_ID_xor_PRC_CDO_xor_DEPLOYMENT_NUMBER_INFTY_xor_FROM_ADDRESS_HI has not been filled"); + throw new IllegalStateException("hub.CODE_SIZE_xor_BYTE_CODE_ADDRESS_HI_xor_MMU_AUX_ID_xor_PRC_RAC_xor_DEPLOYMENT_NUMBER_INFTY_xor_FROM_ADDRESS_HI has not been filled"); } if (!filled.get(3)) { @@ -7493,43 +6184,35 @@ public Trace validateRow() { } if (!filled.get(101)) { - throw new IllegalStateException( - "hub.DEPLOYMENT_NUMBER_FINAL_IN_BLOCK_xor_DEPLOYMENT_NUMBER_FINAL_IN_BLOCK has not been filled"); + throw new IllegalStateException("hub.DEPLOYMENT_NUMBER_FINAL_IN_BLOCK_xor_DEPLOYMENT_NUMBER_FINAL_IN_BLOCK has not been filled"); } if (!filled.get(102)) { - throw new IllegalStateException( - "hub.DEPLOYMENT_NUMBER_FIRST_IN_BLOCK_xor_DEPLOYMENT_NUMBER_FIRST_IN_BLOCK has not been filled"); + throw new IllegalStateException("hub.DEPLOYMENT_NUMBER_FIRST_IN_BLOCK_xor_DEPLOYMENT_NUMBER_FIRST_IN_BLOCK has not been filled"); } if (!filled.get(108)) { - throw new IllegalStateException( - "hub.DEPLOYMENT_NUMBER_INFTY_xor_BYTE_CODE_DEPLOYMENT_STATUS_xor_MMU_PHASE_xor_PRC_RAO has not been filled"); + throw new IllegalStateException("hub.DEPLOYMENT_NUMBER_INFTY_xor_BYTE_CODE_DEPLOYMENT_STATUS_xor_MMU_PHASE has not been filled"); } if (!filled.get(109)) { - throw new IllegalStateException( - "hub.DEPLOYMENT_NUMBER_NEW_xor_CALLER_ADDRESS_HI_xor_MMU_REF_OFFSET_xor_PRC_RETURN_GAS has not been filled"); + throw new IllegalStateException("hub.DEPLOYMENT_NUMBER_NEW_xor_CALLER_ADDRESS_HI_xor_MMU_REF_OFFSET has not been filled"); } if (!filled.get(107)) { - throw new IllegalStateException( - "hub.DEPLOYMENT_NUMBER_xor_BYTE_CODE_DEPLOYMENT_NUMBER_xor_MMU_INST_xor_PRC_RAC_xor_TO_ADDRESS_HI has not been filled"); + throw new IllegalStateException("hub.DEPLOYMENT_NUMBER_xor_BYTE_CODE_DEPLOYMENT_NUMBER_xor_MMU_INST_xor_TO_ADDRESS_HI has not been filled"); } if (!filled.get(49)) { - throw new IllegalStateException( - "hub.DEPLOYMENT_STATUS_INFTY_xor_MXP_DEPLOYS_xor_CALL_EXCEPTION_xor_CALL_FLAG_xor_FINAL_IN_CNF_xor_STATUS_CODE has not been filled"); + throw new IllegalStateException("hub.DEPLOYMENT_STATUS_INFTY_xor_MXP_DEPLOYS_xor_CALL_EXCEPTION_xor_CALL_FLAG_xor_FINAL_IN_CNF_xor_STATUS_CODE has not been filled"); } if (!filled.get(50)) { - throw new IllegalStateException( - "hub.DEPLOYMENT_STATUS_NEW_xor_MXP_FLAG_xor_CALL_PRC_FAILURE_xor_CON_FLAG_xor_FINAL_IN_TXN has not been filled"); + throw new IllegalStateException("hub.DEPLOYMENT_STATUS_NEW_xor_MXP_FLAG_xor_CALL_PRC_FAILURE_xor_CON_FLAG_xor_FINAL_IN_TXN has not been filled"); } if (!filled.get(48)) { - throw new IllegalStateException( - "hub.DEPLOYMENT_STATUS_xor_MMU_SUCCESS_BIT_xor_CALL_EOA_SUCCESS_CALLER_WONT_REVERT_xor_BTC_FLAG_xor_FINAL_IN_BLK_xor_REQUIRES_EVM_EXECUTION has not been filled"); + throw new IllegalStateException("hub.DEPLOYMENT_STATUS_xor_MMU_SUCCESS_BIT_xor_CALL_EOA_SUCCESS_CALLER_WONT_REVERT_xor_BTC_FLAG_xor_FINAL_IN_BLK_xor_REQUIRES_EVM_EXECUTION has not been filled"); } if (!filled.get(12)) { @@ -7541,43 +6224,35 @@ public Trace validateRow() { } if (!filled.get(52)) { - throw new IllegalStateException( - "hub.EXISTS_NEW_xor_MXP_MXPX_xor_CALL_PRC_SUCCESS_CALLER_WONT_REVERT_xor_CREATE_FLAG_xor_FIRST_IN_CNF has not been filled"); + throw new IllegalStateException("hub.EXISTS_NEW_xor_MXP_MXPX_xor_CALL_PRC_SUCCESS_CALLER_WONT_REVERT_xor_CREATE_FLAG_xor_FIRST_IN_CNF has not been filled"); } if (!filled.get(51)) { - throw new IllegalStateException( - "hub.EXISTS_xor_MXP_MTNTOP_xor_CALL_PRC_SUCCESS_CALLER_WILL_REVERT_xor_COPY_FLAG_xor_FIRST_IN_BLK has not been filled"); + throw new IllegalStateException("hub.EXISTS_xor_MXP_MTNTOP_xor_CALL_PRC_SUCCESS_CALLER_WILL_REVERT_xor_COPY_FLAG_xor_FIRST_IN_BLK has not been filled"); } if (!filled.get(53)) { - throw new IllegalStateException( - "hub.FINAL_IN_BLK_xor_MXP_SIZE_1_NONZERO_NO_MXPX_xor_CALL_SMC_FAILURE_CALLER_WILL_REVERT_xor_DEC_FLAG_1_xor_FIRST_IN_TXN has not been filled"); + throw new IllegalStateException("hub.FINAL_IN_BLK_xor_MXP_SIZE_1_NONZERO_NO_MXPX_xor_CALL_SMC_FAILURE_CALLER_WILL_REVERT_xor_DEC_FLAG_1_xor_FIRST_IN_TXN has not been filled"); } if (!filled.get(54)) { - throw new IllegalStateException( - "hub.FINAL_IN_CNF_xor_MXP_SIZE_2_NONZERO_NO_MXPX_xor_CALL_SMC_FAILURE_CALLER_WONT_REVERT_xor_DEC_FLAG_2_xor_VALUE_CURR_CHANGES has not been filled"); + throw new IllegalStateException("hub.FINAL_IN_CNF_xor_MXP_SIZE_2_NONZERO_NO_MXPX_xor_CALL_SMC_FAILURE_CALLER_WONT_REVERT_xor_DEC_FLAG_2_xor_VALUE_CURR_CHANGES has not been filled"); } if (!filled.get(55)) { - throw new IllegalStateException( - "hub.FINAL_IN_TXN_xor_OOB_FLAG_xor_CALL_SMC_SUCCESS_CALLER_WILL_REVERT_xor_DEC_FLAG_3_xor_VALUE_CURR_IS_ORIG has not been filled"); + throw new IllegalStateException("hub.FINAL_IN_TXN_xor_OOB_FLAG_xor_CALL_SMC_SUCCESS_CALLER_WILL_REVERT_xor_DEC_FLAG_3_xor_VALUE_CURR_IS_ORIG has not been filled"); } if (!filled.get(56)) { - throw new IllegalStateException( - "hub.FIRST_IN_BLK_xor_STP_EXISTS_xor_CALL_SMC_SUCCESS_CALLER_WONT_REVERT_xor_DEC_FLAG_4_xor_VALUE_CURR_IS_ZERO has not been filled"); + throw new IllegalStateException("hub.FIRST_IN_BLK_xor_STP_EXISTS_xor_CALL_SMC_SUCCESS_CALLER_WONT_REVERT_xor_DEC_FLAG_4_xor_VALUE_CURR_IS_ZERO has not been filled"); } if (!filled.get(57)) { - throw new IllegalStateException( - "hub.FIRST_IN_CNF_xor_STP_FLAG_xor_CREATE_ABORT_xor_DUP_FLAG_xor_VALUE_NEXT_IS_CURR has not been filled"); + throw new IllegalStateException("hub.FIRST_IN_CNF_xor_STP_FLAG_xor_CREATE_ABORT_xor_DUP_FLAG_xor_VALUE_NEXT_IS_CURR has not been filled"); } if (!filled.get(58)) { - throw new IllegalStateException( - "hub.FIRST_IN_TXN_xor_STP_OOGX_xor_CREATE_EMPTY_INIT_CODE_WILL_REVERT_xor_EXT_FLAG_xor_VALUE_NEXT_IS_ORIG has not been filled"); + throw new IllegalStateException("hub.FIRST_IN_TXN_xor_STP_OOGX_xor_CREATE_EMPTY_INIT_CODE_WILL_REVERT_xor_EXT_FLAG_xor_VALUE_NEXT_IS_ORIG has not been filled"); } if (!filled.get(14)) { @@ -7605,13 +6280,11 @@ public Trace validateRow() { } if (!filled.get(60)) { - throw new IllegalStateException( - "hub.HAS_CODE_NEW_xor_CREATE_EXCEPTION_xor_HASH_INFO_FLAG_xor_VALUE_ORIG_IS_ZERO has not been filled"); + throw new IllegalStateException("hub.HAS_CODE_NEW_xor_CREATE_EXCEPTION_xor_HASH_INFO_FLAG_xor_VALUE_ORIG_IS_ZERO has not been filled"); } if (!filled.get(59)) { - throw new IllegalStateException( - "hub.HAS_CODE_xor_STP_WARMTH_xor_CREATE_EMPTY_INIT_CODE_WONT_REVERT_xor_HALT_FLAG_xor_VALUE_NEXT_IS_ZERO has not been filled"); + throw new IllegalStateException("hub.HAS_CODE_xor_STP_WARMTH_xor_CREATE_EMPTY_INIT_CODE_WONT_REVERT_xor_HALT_FLAG_xor_VALUE_NEXT_IS_ZERO has not been filled"); } if (!filled.get(18)) { @@ -7635,8 +6308,7 @@ public Trace validateRow() { } if (!filled.get(61)) { - throw new IllegalStateException( - "hub.IS_PRECOMPILE_xor_CREATE_FAILURE_CONDITION_WILL_REVERT_xor_ICPX_xor_WARMTH has not been filled"); + throw new IllegalStateException("hub.IS_PRECOMPILE_xor_CREATE_FAILURE_CONDITION_WILL_REVERT_xor_ICPX_xor_WARMTH has not been filled"); } if (!filled.get(22)) { @@ -7644,13 +6316,11 @@ public Trace validateRow() { } if (!filled.get(63)) { - throw new IllegalStateException( - "hub.MARKED_FOR_SELFDESTRUCT_NEW_xor_CREATE_NONEMPTY_INIT_CODE_FAILURE_WILL_REVERT_xor_JUMPX has not been filled"); + throw new IllegalStateException("hub.MARKED_FOR_SELFDESTRUCT_NEW_xor_CREATE_NONEMPTY_INIT_CODE_FAILURE_WILL_REVERT_xor_JUMPX has not been filled"); } if (!filled.get(62)) { - throw new IllegalStateException( - "hub.MARKED_FOR_SELFDESTRUCT_xor_CREATE_FAILURE_CONDITION_WONT_REVERT_xor_INVALID_FLAG_xor_WARMTH_NEW has not been filled"); + throw new IllegalStateException("hub.MARKED_FOR_SELFDESTRUCT_xor_CREATE_FAILURE_CONDITION_WONT_REVERT_xor_INVALID_FLAG_xor_WARMTH_NEW has not been filled"); } if (!filled.get(23)) { @@ -7698,12 +6368,11 @@ public Trace validateRow() { } if (!filled.get(124)) { - throw new IllegalStateException( - "hub.NONCE_NEW_xor_STP_GAS_PAID_OUT_OF_POCKET_xor_GAS_INITIALLY_AVAILABLE has not been filled"); + throw new IllegalStateException("hub.NONCE_NEW_xor_STP_GAS_PAID_OUT_OF_POCKET_xor_PRC_CALLER_GAS_xor_GAS_INITIALLY_AVAILABLE has not been filled"); } if (!filled.get(123)) { - throw new IllegalStateException("hub.NONCE_xor_STP_GAS_MXP_xor_BASEFEE has not been filled"); + throw new IllegalStateException("hub.NONCE_xor_STP_GAS_MXP_xor_PRC_CALLEE_GAS_xor_BASEFEE has not been filled"); } if (!filled.get(152)) { @@ -7783,8 +6452,7 @@ public Trace validateRow() { } if (!filled.get(72)) { - throw new IllegalStateException( - "hub.PRC_FAILURE_KNOWN_TO_HUB_xor_MUL_FLAG has not been filled"); + throw new IllegalStateException("hub.PRC_FAILURE_KNOWN_TO_HUB_xor_MUL_FLAG has not been filled"); } if (!filled.get(73)) { @@ -7808,13 +6476,11 @@ public Trace validateRow() { } if (!filled.get(78)) { - throw new IllegalStateException( - "hub.PRC_SUCCESS_CALLER_WILL_REVERT_xor_RDCX has not been filled"); + throw new IllegalStateException("hub.PRC_SUCCESS_CALLER_WILL_REVERT_xor_RDCX has not been filled"); } if (!filled.get(79)) { - throw new IllegalStateException( - "hub.PRC_SUCCESS_CALLER_WONT_REVERT_xor_SHF_FLAG has not been filled"); + throw new IllegalStateException("hub.PRC_SUCCESS_CALLER_WONT_REVERT_xor_SHF_FLAG has not been filled"); } if (!filled.get(129)) { @@ -7858,13 +6524,11 @@ public Trace validateRow() { } if (!filled.get(116)) { - throw new IllegalStateException( - "hub.RETURN_DATA_CONTEXT_NUMBER_xor_STP_GAS_STIPEND has not been filled"); + throw new IllegalStateException("hub.RETURN_DATA_CONTEXT_NUMBER_xor_STP_GAS_STIPEND has not been filled"); } if (!filled.get(117)) { - throw new IllegalStateException( - "hub.RETURN_DATA_OFFSET_xor_STP_INSTRUCTION has not been filled"); + throw new IllegalStateException("hub.RETURN_DATA_OFFSET_xor_STP_INSTRUCTION has not been filled"); } if (!filled.get(118)) { @@ -7876,58 +6540,47 @@ public Trace validateRow() { } if (!filled.get(81)) { - throw new IllegalStateException( - "hub.RETURN_FROM_DEPLOYMENT_EMPTY_CODE_WILL_REVERT_xor_SSTOREX has not been filled"); + throw new IllegalStateException("hub.RETURN_FROM_DEPLOYMENT_EMPTY_CODE_WILL_REVERT_xor_SSTOREX has not been filled"); } if (!filled.get(82)) { - throw new IllegalStateException( - "hub.RETURN_FROM_DEPLOYMENT_EMPTY_CODE_WONT_REVERT_xor_STACKRAM_FLAG has not been filled"); + throw new IllegalStateException("hub.RETURN_FROM_DEPLOYMENT_EMPTY_CODE_WONT_REVERT_xor_STACKRAM_FLAG has not been filled"); } if (!filled.get(83)) { - throw new IllegalStateException( - "hub.RETURN_FROM_DEPLOYMENT_NONEMPTY_CODE_WILL_REVERT_xor_STACK_ITEM_POP_1 has not been filled"); + throw new IllegalStateException("hub.RETURN_FROM_DEPLOYMENT_NONEMPTY_CODE_WILL_REVERT_xor_STACK_ITEM_POP_1 has not been filled"); } if (!filled.get(84)) { - throw new IllegalStateException( - "hub.RETURN_FROM_DEPLOYMENT_NONEMPTY_CODE_WONT_REVERT_xor_STACK_ITEM_POP_2 has not been filled"); + throw new IllegalStateException("hub.RETURN_FROM_DEPLOYMENT_NONEMPTY_CODE_WONT_REVERT_xor_STACK_ITEM_POP_2 has not been filled"); } if (!filled.get(85)) { - throw new IllegalStateException( - "hub.RETURN_FROM_MESSAGE_CALL_WILL_TOUCH_RAM_xor_STACK_ITEM_POP_3 has not been filled"); + throw new IllegalStateException("hub.RETURN_FROM_MESSAGE_CALL_WILL_TOUCH_RAM_xor_STACK_ITEM_POP_3 has not been filled"); } if (!filled.get(86)) { - throw new IllegalStateException( - "hub.RETURN_FROM_MESSAGE_CALL_WONT_TOUCH_RAM_xor_STACK_ITEM_POP_4 has not been filled"); + throw new IllegalStateException("hub.RETURN_FROM_MESSAGE_CALL_WONT_TOUCH_RAM_xor_STACK_ITEM_POP_4 has not been filled"); } if (!filled.get(110)) { - throw new IllegalStateException( - "hub.RLPADDR_DEP_ADDR_HI_xor_CALL_DATA_CONTEXT_NUMBER_xor_MMU_REF_SIZE has not been filled"); + throw new IllegalStateException("hub.RLPADDR_DEP_ADDR_HI_xor_CALL_DATA_CONTEXT_NUMBER_xor_MMU_REF_SIZE has not been filled"); } if (!filled.get(139)) { - throw new IllegalStateException( - "hub.RLPADDR_DEP_ADDR_LO_xor_MMU_SRC_OFFSET_HI_xor_STACK_ITEM_VALUE_HI_4_xor_VALUE_ORIG_HI has not been filled"); + throw new IllegalStateException("hub.RLPADDR_DEP_ADDR_LO_xor_MMU_SRC_OFFSET_HI_xor_STACK_ITEM_VALUE_HI_4_xor_VALUE_ORIG_HI has not been filled"); } if (!filled.get(64)) { - throw new IllegalStateException( - "hub.RLPADDR_FLAG_xor_CREATE_NONEMPTY_INIT_CODE_FAILURE_WONT_REVERT_xor_JUMP_DESTINATION_VETTING_REQUIRED has not been filled"); + throw new IllegalStateException("hub.RLPADDR_FLAG_xor_CREATE_NONEMPTY_INIT_CODE_FAILURE_WONT_REVERT_xor_JUMP_DESTINATION_VETTING_REQUIRED has not been filled"); } if (!filled.get(140)) { - throw new IllegalStateException( - "hub.RLPADDR_KEC_HI_xor_MMU_SRC_OFFSET_LO_xor_STACK_ITEM_VALUE_LO_1_xor_VALUE_ORIG_LO has not been filled"); + throw new IllegalStateException("hub.RLPADDR_KEC_HI_xor_MMU_SRC_OFFSET_LO_xor_STACK_ITEM_VALUE_LO_1_xor_VALUE_ORIG_LO has not been filled"); } if (!filled.get(141)) { - throw new IllegalStateException( - "hub.RLPADDR_KEC_LO_xor_MMU_TGT_OFFSET_LO_xor_STACK_ITEM_VALUE_LO_2 has not been filled"); + throw new IllegalStateException("hub.RLPADDR_KEC_LO_xor_MMU_TGT_OFFSET_LO_xor_STACK_ITEM_VALUE_LO_2 has not been filled"); } if (!filled.get(96)) { @@ -7935,18 +6588,15 @@ public Trace validateRow() { } if (!filled.get(142)) { - throw new IllegalStateException( - "hub.RLPADDR_SALT_HI_xor_MXP_GAS_MXP_xor_STACK_ITEM_VALUE_LO_3 has not been filled"); + throw new IllegalStateException("hub.RLPADDR_SALT_HI_xor_MXP_GAS_MXP_xor_STACK_ITEM_VALUE_LO_3 has not been filled"); } if (!filled.get(143)) { - throw new IllegalStateException( - "hub.RLPADDR_SALT_LO_xor_MXP_OFFSET_1_HI_xor_STACK_ITEM_VALUE_LO_4 has not been filled"); + throw new IllegalStateException("hub.RLPADDR_SALT_LO_xor_MXP_OFFSET_1_HI_xor_STACK_ITEM_VALUE_LO_4 has not been filled"); } if (!filled.get(65)) { - throw new IllegalStateException( - "hub.ROMLEX_FLAG_xor_CREATE_NONEMPTY_INIT_CODE_SUCCESS_WILL_REVERT_xor_JUMP_FLAG has not been filled"); + throw new IllegalStateException("hub.ROMLEX_FLAG_xor_CREATE_NONEMPTY_INIT_CODE_SUCCESS_WILL_REVERT_xor_JUMP_FLAG has not been filled"); } if (!filled.get(87)) { @@ -7954,18 +6604,15 @@ public Trace validateRow() { } if (!filled.get(88)) { - throw new IllegalStateException( - "hub.SELFDESTRUCT_WILL_REVERT_xor_STATIC_FLAG has not been filled"); + throw new IllegalStateException("hub.SELFDESTRUCT_WILL_REVERT_xor_STATIC_FLAG has not been filled"); } if (!filled.get(89)) { - throw new IllegalStateException( - "hub.SELFDESTRUCT_WONT_REVERT_ALREADY_MARKED_xor_STO_FLAG has not been filled"); + throw new IllegalStateException("hub.SELFDESTRUCT_WONT_REVERT_ALREADY_MARKED_xor_STO_FLAG has not been filled"); } if (!filled.get(90)) { - throw new IllegalStateException( - "hub.SELFDESTRUCT_WONT_REVERT_NOT_YET_MARKED_xor_SUX has not been filled"); + throw new IllegalStateException("hub.SELFDESTRUCT_WONT_REVERT_NOT_YET_MARKED_xor_SUX has not been filled"); } if (!filled.get(98)) { @@ -8005,8 +6652,7 @@ public Trace validateRow() { } if (!filled.get(125)) { - throw new IllegalStateException( - "hub.STP_GAS_UPFRONT_GAS_COST_xor_GAS_LEFTOVER has not been filled"); + throw new IllegalStateException("hub.STP_GAS_UPFRONT_GAS_COST_xor_PRC_RETURN_GAS_xor_GAS_LEFTOVER has not been filled"); } if (!filled.get(163)) { @@ -8026,13 +6672,11 @@ public Trace validateRow() { } if (!filled.get(66)) { - throw new IllegalStateException( - "hub.TRM_FLAG_xor_CREATE_NONEMPTY_INIT_CODE_SUCCESS_WONT_REVERT_xor_KEC_FLAG has not been filled"); + throw new IllegalStateException("hub.TRM_FLAG_xor_CREATE_NONEMPTY_INIT_CODE_SUCCESS_WONT_REVERT_xor_KEC_FLAG has not been filled"); } if (!filled.get(144)) { - throw new IllegalStateException( - "hub.TRM_RAW_ADDRESS_HI_xor_MXP_OFFSET_1_LO has not been filled"); + throw new IllegalStateException("hub.TRM_RAW_ADDRESS_HI_xor_MXP_OFFSET_1_LO has not been filled"); } if (!filled.get(39)) { @@ -8064,13 +6708,11 @@ public Trace validateRow() { } if (!filled.get(68)) { - throw new IllegalStateException( - "hub.WARMTH_NEW_xor_PRC_ECADD_xor_LOG_INFO_FLAG has not been filled"); + throw new IllegalStateException("hub.WARMTH_NEW_xor_PRC_ECADD_xor_LOG_INFO_FLAG has not been filled"); } if (!filled.get(67)) { - throw new IllegalStateException( - "hub.WARMTH_xor_PRC_BLAKE2f_xor_LOG_FLAG has not been filled"); + throw new IllegalStateException("hub.WARMTH_xor_PRC_BLAKE2f_xor_LOG_FLAG has not been filled"); } if (!filled.get(93)) { @@ -8089,43 +6731,23 @@ public Trace fillAndValidateRow() { } if (!filled.get(103)) { - addressHiXorAccountAddressHiXorCcrsStampXorPrcCalleeGasXorStaticGasXorAddressHiXorCallDataSize - .position( - addressHiXorAccountAddressHiXorCcrsStampXorPrcCalleeGasXorStaticGasXorAddressHiXorCallDataSize - .position() - + 4); + addressHiXorAccountAddressHiXorCcrsStampXorPrcCdoXorStaticGasXorAddressHiXorCallDataSize.position(addressHiXorAccountAddressHiXorCcrsStampXorPrcCdoXorStaticGasXorAddressHiXorCallDataSize.position() + 4); } if (!filled.get(132)) { - addressLoXorAccountAddressLoXorExpData1XorHashInfoKeccakHiXorAddressLoXorCoinbaseAddressLo - .position( - addressLoXorAccountAddressLoXorExpData1XorHashInfoKeccakHiXorAddressLoXorCoinbaseAddressLo - .position() - + 16); + addressLoXorAccountAddressLoXorExpData1XorHashInfoKeccakHiXorAddressLoXorCoinbaseAddressLo.position(addressLoXorAccountAddressLoXorExpData1XorHashInfoKeccakHiXorAddressLoXorCoinbaseAddressLo.position() + 16); } if (!filled.get(45)) { - againInBlkXorIsRootXorCcsrFlagXorCallAbortWillRevertXorAccFlagXorAgainInBlkXorCopyTxcd - .position( - againInBlkXorIsRootXorCcsrFlagXorCallAbortWillRevertXorAccFlagXorAgainInBlkXorCopyTxcd - .position() - + 1); + againInBlkXorIsRootXorCcsrFlagXorCallAbortWillRevertXorAccFlagXorAgainInBlkXorCopyTxcd.position(againInBlkXorIsRootXorCcsrFlagXorCallAbortWillRevertXorAccFlagXorAgainInBlkXorCopyTxcd.position() + 1); } if (!filled.get(46)) { - againInCnfXorIsStaticXorExpFlagXorCallAbortWontRevertXorAddFlagXorAgainInCnfXorIsDeployment - .position( - againInCnfXorIsStaticXorExpFlagXorCallAbortWontRevertXorAddFlagXorAgainInCnfXorIsDeployment - .position() - + 1); + againInCnfXorIsStaticXorExpFlagXorCallAbortWontRevertXorAddFlagXorAgainInCnfXorIsDeployment.position(againInCnfXorIsStaticXorExpFlagXorCallAbortWontRevertXorAddFlagXorAgainInCnfXorIsDeployment.position() + 1); } if (!filled.get(47)) { - againInTxnXorUpdateXorMmuFlagXorCallEoaSuccessCallerWillRevertXorBinFlagXorAgainInTxnXorIsType2 - .position( - againInTxnXorUpdateXorMmuFlagXorCallEoaSuccessCallerWillRevertXorBinFlagXorAgainInTxnXorIsType2 - .position() - + 1); + againInTxnXorUpdateXorMmuFlagXorCallEoaSuccessCallerWillRevertXorBinFlagXorAgainInTxnXorIsType2.position(againInTxnXorUpdateXorMmuFlagXorCallEoaSuccessCallerWillRevertXorBinFlagXorAgainInTxnXorIsType2.position() + 1); } if (!filled.get(94)) { @@ -8133,19 +6755,11 @@ public Trace fillAndValidateRow() { } if (!filled.get(134)) { - balanceNewXorCallerAddressLoXorExpData3XorPushValueHiXorStorageKeyLoXorInitialBalance - .position( - balanceNewXorCallerAddressLoXorExpData3XorPushValueHiXorStorageKeyLoXorInitialBalance - .position() - + 16); + balanceNewXorCallerAddressLoXorExpData3XorPushValueHiXorStorageKeyLoXorInitialBalance.position(balanceNewXorCallerAddressLoXorExpData3XorPushValueHiXorStorageKeyLoXorInitialBalance.position() + 16); } if (!filled.get(133)) { - balanceXorByteCodeAddressLoXorExpData2XorHashInfoKeccakLoXorStorageKeyHiXorFromAddressLo - .position( - balanceXorByteCodeAddressLoXorExpData2XorHashInfoKeccakLoXorStorageKeyHiXorFromAddressLo - .position() - + 16); + balanceXorByteCodeAddressLoXorExpData2XorHashInfoKeccakLoXorStorageKeyHiXorFromAddressLo.position(balanceXorByteCodeAddressLoXorExpData2XorHashInfoKeccakLoXorStorageKeyHiXorFromAddressLo.position() + 16); } if (!filled.get(111)) { @@ -8169,46 +6783,31 @@ public Trace fillAndValidateRow() { } if (!filled.get(104)) { - codeFragmentIndexXorAccountDeploymentNumberXorExpInstXorPrcCallerGasXorDeploymentNumberXorCoinbaseAddressHi - .position( - codeFragmentIndexXorAccountDeploymentNumberXorExpInstXorPrcCallerGasXorDeploymentNumberXorCoinbaseAddressHi - .position() - + 4); + codeFragmentIndexXorAccountDeploymentNumberXorExpInstXorPrcCdsXorDeploymentNumberXorCoinbaseAddressHi.position(codeFragmentIndexXorAccountDeploymentNumberXorExpInstXorPrcCdsXorDeploymentNumberXorCoinbaseAddressHi.position() + 4); } if (!filled.get(136)) { - codeHashHiNewXorExpData5XorStackItemValueHi1XorValueCurrLoXorValue.position( - codeHashHiNewXorExpData5XorStackItemValueHi1XorValueCurrLoXorValue.position() + 16); + codeHashHiNewXorExpData5XorStackItemValueHi1XorValueCurrLoXorValue.position(codeHashHiNewXorExpData5XorStackItemValueHi1XorValueCurrLoXorValue.position() + 16); } if (!filled.get(135)) { - codeHashHiXorCallValueXorExpData4XorPushValueLoXorValueCurrHiXorToAddressLo.position( - codeHashHiXorCallValueXorExpData4XorPushValueLoXorValueCurrHiXorToAddressLo.position() - + 16); + codeHashHiXorCallValueXorExpData4XorPushValueLoXorValueCurrHiXorToAddressLo.position(codeHashHiXorCallValueXorExpData4XorPushValueLoXorValueCurrHiXorToAddressLo.position() + 16); } if (!filled.get(138)) { - codeHashLoNewXorMmuLimb2XorStackItemValueHi3XorValueNextLo.position( - codeHashLoNewXorMmuLimb2XorStackItemValueHi3XorValueNextLo.position() + 16); + codeHashLoNewXorMmuLimb2XorStackItemValueHi3XorValueNextLo.position(codeHashLoNewXorMmuLimb2XorStackItemValueHi3XorValueNextLo.position() + 16); } if (!filled.get(137)) { - codeHashLoXorMmuLimb1XorStackItemValueHi2XorValueNextHi.position( - codeHashLoXorMmuLimb1XorStackItemValueHi2XorValueNextHi.position() + 16); + codeHashLoXorMmuLimb1XorStackItemValueHi2XorValueNextHi.position(codeHashLoXorMmuLimb1XorStackItemValueHi2XorValueNextHi.position() + 16); } if (!filled.get(106)) { - codeSizeNewXorByteCodeCodeFragmentIndexXorMmuExoSumXorPrcCdsXorInitCodeSize.position( - codeSizeNewXorByteCodeCodeFragmentIndexXorMmuExoSumXorPrcCdsXorInitCodeSize.position() - + 4); + codeSizeNewXorByteCodeCodeFragmentIndexXorMmuExoSumXorPrcRaoXorInitCodeSize.position(codeSizeNewXorByteCodeCodeFragmentIndexXorMmuExoSumXorPrcRaoXorInitCodeSize.position() + 4); } if (!filled.get(105)) { - codeSizeXorByteCodeAddressHiXorMmuAuxIdXorPrcCdoXorDeploymentNumberInftyXorFromAddressHi - .position( - codeSizeXorByteCodeAddressHiXorMmuAuxIdXorPrcCdoXorDeploymentNumberInftyXorFromAddressHi - .position() - + 4); + codeSizeXorByteCodeAddressHiXorMmuAuxIdXorPrcRacXorDeploymentNumberInftyXorFromAddressHi.position(codeSizeXorByteCodeAddressHiXorMmuAuxIdXorPrcRacXorDeploymentNumberInftyXorFromAddressHi.position() + 4); } if (!filled.get(3)) { @@ -8256,50 +6855,35 @@ public Trace fillAndValidateRow() { } if (!filled.get(101)) { - deploymentNumberFinalInBlockXorDeploymentNumberFinalInBlock.position( - deploymentNumberFinalInBlockXorDeploymentNumberFinalInBlock.position() + 2); + deploymentNumberFinalInBlockXorDeploymentNumberFinalInBlock.position(deploymentNumberFinalInBlockXorDeploymentNumberFinalInBlock.position() + 2); } if (!filled.get(102)) { - deploymentNumberFirstInBlockXorDeploymentNumberFirstInBlock.position( - deploymentNumberFirstInBlockXorDeploymentNumberFirstInBlock.position() + 2); + deploymentNumberFirstInBlockXorDeploymentNumberFirstInBlock.position(deploymentNumberFirstInBlockXorDeploymentNumberFirstInBlock.position() + 2); } if (!filled.get(108)) { - deploymentNumberInftyXorByteCodeDeploymentStatusXorMmuPhaseXorPrcRao.position( - deploymentNumberInftyXorByteCodeDeploymentStatusXorMmuPhaseXorPrcRao.position() + 4); + deploymentNumberInftyXorByteCodeDeploymentStatusXorMmuPhase.position(deploymentNumberInftyXorByteCodeDeploymentStatusXorMmuPhase.position() + 4); } if (!filled.get(109)) { - deploymentNumberNewXorCallerAddressHiXorMmuRefOffsetXorPrcReturnGas.position( - deploymentNumberNewXorCallerAddressHiXorMmuRefOffsetXorPrcReturnGas.position() + 4); + deploymentNumberNewXorCallerAddressHiXorMmuRefOffset.position(deploymentNumberNewXorCallerAddressHiXorMmuRefOffset.position() + 4); } if (!filled.get(107)) { - deploymentNumberXorByteCodeDeploymentNumberXorMmuInstXorPrcRacXorToAddressHi.position( - deploymentNumberXorByteCodeDeploymentNumberXorMmuInstXorPrcRacXorToAddressHi.position() - + 4); + deploymentNumberXorByteCodeDeploymentNumberXorMmuInstXorToAddressHi.position(deploymentNumberXorByteCodeDeploymentNumberXorMmuInstXorToAddressHi.position() + 4); } if (!filled.get(49)) { - deploymentStatusInftyXorMxpDeploysXorCallExceptionXorCallFlagXorFinalInCnfXorStatusCode - .position( - deploymentStatusInftyXorMxpDeploysXorCallExceptionXorCallFlagXorFinalInCnfXorStatusCode - .position() - + 1); + deploymentStatusInftyXorMxpDeploysXorCallExceptionXorCallFlagXorFinalInCnfXorStatusCode.position(deploymentStatusInftyXorMxpDeploysXorCallExceptionXorCallFlagXorFinalInCnfXorStatusCode.position() + 1); } if (!filled.get(50)) { - deploymentStatusNewXorMxpFlagXorCallPrcFailureXorConFlagXorFinalInTxn.position( - deploymentStatusNewXorMxpFlagXorCallPrcFailureXorConFlagXorFinalInTxn.position() + 1); + deploymentStatusNewXorMxpFlagXorCallPrcFailureXorConFlagXorFinalInTxn.position(deploymentStatusNewXorMxpFlagXorCallPrcFailureXorConFlagXorFinalInTxn.position() + 1); } if (!filled.get(48)) { - deploymentStatusXorMmuSuccessBitXorCallEoaSuccessCallerWontRevertXorBtcFlagXorFinalInBlkXorRequiresEvmExecution - .position( - deploymentStatusXorMmuSuccessBitXorCallEoaSuccessCallerWontRevertXorBtcFlagXorFinalInBlkXorRequiresEvmExecution - .position() - + 1); + deploymentStatusXorMmuSuccessBitXorCallEoaSuccessCallerWontRevertXorBtcFlagXorFinalInBlkXorRequiresEvmExecution.position(deploymentStatusXorMmuSuccessBitXorCallEoaSuccessCallerWontRevertXorBtcFlagXorFinalInBlkXorRequiresEvmExecution.position() + 1); } if (!filled.get(12)) { @@ -8311,57 +6895,35 @@ public Trace fillAndValidateRow() { } if (!filled.get(52)) { - existsNewXorMxpMxpxXorCallPrcSuccessCallerWontRevertXorCreateFlagXorFirstInCnf.position( - existsNewXorMxpMxpxXorCallPrcSuccessCallerWontRevertXorCreateFlagXorFirstInCnf.position() - + 1); + existsNewXorMxpMxpxXorCallPrcSuccessCallerWontRevertXorCreateFlagXorFirstInCnf.position(existsNewXorMxpMxpxXorCallPrcSuccessCallerWontRevertXorCreateFlagXorFirstInCnf.position() + 1); } if (!filled.get(51)) { - existsXorMxpMtntopXorCallPrcSuccessCallerWillRevertXorCopyFlagXorFirstInBlk.position( - existsXorMxpMtntopXorCallPrcSuccessCallerWillRevertXorCopyFlagXorFirstInBlk.position() - + 1); + existsXorMxpMtntopXorCallPrcSuccessCallerWillRevertXorCopyFlagXorFirstInBlk.position(existsXorMxpMtntopXorCallPrcSuccessCallerWillRevertXorCopyFlagXorFirstInBlk.position() + 1); } if (!filled.get(53)) { - finalInBlkXorMxpSize1NonzeroNoMxpxXorCallSmcFailureCallerWillRevertXorDecFlag1XorFirstInTxn - .position( - finalInBlkXorMxpSize1NonzeroNoMxpxXorCallSmcFailureCallerWillRevertXorDecFlag1XorFirstInTxn - .position() - + 1); + finalInBlkXorMxpSize1NonzeroNoMxpxXorCallSmcFailureCallerWillRevertXorDecFlag1XorFirstInTxn.position(finalInBlkXorMxpSize1NonzeroNoMxpxXorCallSmcFailureCallerWillRevertXorDecFlag1XorFirstInTxn.position() + 1); } if (!filled.get(54)) { - finalInCnfXorMxpSize2NonzeroNoMxpxXorCallSmcFailureCallerWontRevertXorDecFlag2XorValueCurrChanges - .position( - finalInCnfXorMxpSize2NonzeroNoMxpxXorCallSmcFailureCallerWontRevertXorDecFlag2XorValueCurrChanges - .position() - + 1); + finalInCnfXorMxpSize2NonzeroNoMxpxXorCallSmcFailureCallerWontRevertXorDecFlag2XorValueCurrChanges.position(finalInCnfXorMxpSize2NonzeroNoMxpxXorCallSmcFailureCallerWontRevertXorDecFlag2XorValueCurrChanges.position() + 1); } if (!filled.get(55)) { - finalInTxnXorOobFlagXorCallSmcSuccessCallerWillRevertXorDecFlag3XorValueCurrIsOrig.position( - finalInTxnXorOobFlagXorCallSmcSuccessCallerWillRevertXorDecFlag3XorValueCurrIsOrig - .position() - + 1); + finalInTxnXorOobFlagXorCallSmcSuccessCallerWillRevertXorDecFlag3XorValueCurrIsOrig.position(finalInTxnXorOobFlagXorCallSmcSuccessCallerWillRevertXorDecFlag3XorValueCurrIsOrig.position() + 1); } if (!filled.get(56)) { - firstInBlkXorStpExistsXorCallSmcSuccessCallerWontRevertXorDecFlag4XorValueCurrIsZero.position( - firstInBlkXorStpExistsXorCallSmcSuccessCallerWontRevertXorDecFlag4XorValueCurrIsZero - .position() - + 1); + firstInBlkXorStpExistsXorCallSmcSuccessCallerWontRevertXorDecFlag4XorValueCurrIsZero.position(firstInBlkXorStpExistsXorCallSmcSuccessCallerWontRevertXorDecFlag4XorValueCurrIsZero.position() + 1); } if (!filled.get(57)) { - firstInCnfXorStpFlagXorCreateAbortXorDupFlagXorValueNextIsCurr.position( - firstInCnfXorStpFlagXorCreateAbortXorDupFlagXorValueNextIsCurr.position() + 1); + firstInCnfXorStpFlagXorCreateAbortXorDupFlagXorValueNextIsCurr.position(firstInCnfXorStpFlagXorCreateAbortXorDupFlagXorValueNextIsCurr.position() + 1); } if (!filled.get(58)) { - firstInTxnXorStpOogxXorCreateEmptyInitCodeWillRevertXorExtFlagXorValueNextIsOrig.position( - firstInTxnXorStpOogxXorCreateEmptyInitCodeWillRevertXorExtFlagXorValueNextIsOrig - .position() - + 1); + firstInTxnXorStpOogxXorCreateEmptyInitCodeWillRevertXorExtFlagXorValueNextIsOrig.position(firstInTxnXorStpOogxXorCreateEmptyInitCodeWillRevertXorExtFlagXorValueNextIsOrig.position() + 1); } if (!filled.get(14)) { @@ -8389,15 +6951,11 @@ public Trace fillAndValidateRow() { } if (!filled.get(60)) { - hasCodeNewXorCreateExceptionXorHashInfoFlagXorValueOrigIsZero.position( - hasCodeNewXorCreateExceptionXorHashInfoFlagXorValueOrigIsZero.position() + 1); + hasCodeNewXorCreateExceptionXorHashInfoFlagXorValueOrigIsZero.position(hasCodeNewXorCreateExceptionXorHashInfoFlagXorValueOrigIsZero.position() + 1); } if (!filled.get(59)) { - hasCodeXorStpWarmthXorCreateEmptyInitCodeWontRevertXorHaltFlagXorValueNextIsZero.position( - hasCodeXorStpWarmthXorCreateEmptyInitCodeWontRevertXorHaltFlagXorValueNextIsZero - .position() - + 1); + hasCodeXorStpWarmthXorCreateEmptyInitCodeWontRevertXorHaltFlagXorValueNextIsZero.position(hasCodeXorStpWarmthXorCreateEmptyInitCodeWontRevertXorHaltFlagXorValueNextIsZero.position() + 1); } if (!filled.get(18)) { @@ -8421,8 +6979,7 @@ public Trace fillAndValidateRow() { } if (!filled.get(61)) { - isPrecompileXorCreateFailureConditionWillRevertXorIcpxXorWarmth.position( - isPrecompileXorCreateFailureConditionWillRevertXorIcpxXorWarmth.position() + 1); + isPrecompileXorCreateFailureConditionWillRevertXorIcpxXorWarmth.position(isPrecompileXorCreateFailureConditionWillRevertXorIcpxXorWarmth.position() + 1); } if (!filled.get(22)) { @@ -8430,16 +6987,11 @@ public Trace fillAndValidateRow() { } if (!filled.get(63)) { - markedForSelfdestructNewXorCreateNonemptyInitCodeFailureWillRevertXorJumpx.position( - markedForSelfdestructNewXorCreateNonemptyInitCodeFailureWillRevertXorJumpx.position() - + 1); + markedForSelfdestructNewXorCreateNonemptyInitCodeFailureWillRevertXorJumpx.position(markedForSelfdestructNewXorCreateNonemptyInitCodeFailureWillRevertXorJumpx.position() + 1); } if (!filled.get(62)) { - markedForSelfdestructXorCreateFailureConditionWontRevertXorInvalidFlagXorWarmthNew.position( - markedForSelfdestructXorCreateFailureConditionWontRevertXorInvalidFlagXorWarmthNew - .position() - + 1); + markedForSelfdestructXorCreateFailureConditionWontRevertXorInvalidFlagXorWarmthNew.position(markedForSelfdestructXorCreateFailureConditionWontRevertXorInvalidFlagXorWarmthNew.position() + 1); } if (!filled.get(23)) { @@ -8487,12 +7039,11 @@ public Trace fillAndValidateRow() { } if (!filled.get(124)) { - nonceNewXorStpGasPaidOutOfPocketXorGasInitiallyAvailable.position( - nonceNewXorStpGasPaidOutOfPocketXorGasInitiallyAvailable.position() + 8); + nonceNewXorStpGasPaidOutOfPocketXorPrcCallerGasXorGasInitiallyAvailable.position(nonceNewXorStpGasPaidOutOfPocketXorPrcCallerGasXorGasInitiallyAvailable.position() + 8); } if (!filled.get(123)) { - nonceXorStpGasMxpXorBasefee.position(nonceXorStpGasMxpXorBasefee.position() + 8); + nonceXorStpGasMxpXorPrcCalleeGasXorBasefee.position(nonceXorStpGasMxpXorPrcCalleeGasXorBasefee.position() + 8); } if (!filled.get(152)) { @@ -8600,8 +7151,7 @@ public Trace fillAndValidateRow() { } if (!filled.get(79)) { - prcSuccessCallerWontRevertXorShfFlag.position( - prcSuccessCallerWontRevertXorShfFlag.position() + 1); + prcSuccessCallerWontRevertXorShfFlag.position(prcSuccessCallerWontRevertXorShfFlag.position() + 1); } if (!filled.get(129)) { @@ -8645,8 +7195,7 @@ public Trace fillAndValidateRow() { } if (!filled.get(116)) { - returnDataContextNumberXorStpGasStipend.position( - returnDataContextNumberXorStpGasStipend.position() + 4); + returnDataContextNumberXorStpGasStipend.position(returnDataContextNumberXorStpGasStipend.position() + 4); } if (!filled.get(117)) { @@ -8662,61 +7211,47 @@ public Trace fillAndValidateRow() { } if (!filled.get(81)) { - returnFromDeploymentEmptyCodeWillRevertXorSstorex.position( - returnFromDeploymentEmptyCodeWillRevertXorSstorex.position() + 1); + returnFromDeploymentEmptyCodeWillRevertXorSstorex.position(returnFromDeploymentEmptyCodeWillRevertXorSstorex.position() + 1); } if (!filled.get(82)) { - returnFromDeploymentEmptyCodeWontRevertXorStackramFlag.position( - returnFromDeploymentEmptyCodeWontRevertXorStackramFlag.position() + 1); + returnFromDeploymentEmptyCodeWontRevertXorStackramFlag.position(returnFromDeploymentEmptyCodeWontRevertXorStackramFlag.position() + 1); } if (!filled.get(83)) { - returnFromDeploymentNonemptyCodeWillRevertXorStackItemPop1.position( - returnFromDeploymentNonemptyCodeWillRevertXorStackItemPop1.position() + 1); + returnFromDeploymentNonemptyCodeWillRevertXorStackItemPop1.position(returnFromDeploymentNonemptyCodeWillRevertXorStackItemPop1.position() + 1); } if (!filled.get(84)) { - returnFromDeploymentNonemptyCodeWontRevertXorStackItemPop2.position( - returnFromDeploymentNonemptyCodeWontRevertXorStackItemPop2.position() + 1); + returnFromDeploymentNonemptyCodeWontRevertXorStackItemPop2.position(returnFromDeploymentNonemptyCodeWontRevertXorStackItemPop2.position() + 1); } if (!filled.get(85)) { - returnFromMessageCallWillTouchRamXorStackItemPop3.position( - returnFromMessageCallWillTouchRamXorStackItemPop3.position() + 1); + returnFromMessageCallWillTouchRamXorStackItemPop3.position(returnFromMessageCallWillTouchRamXorStackItemPop3.position() + 1); } if (!filled.get(86)) { - returnFromMessageCallWontTouchRamXorStackItemPop4.position( - returnFromMessageCallWontTouchRamXorStackItemPop4.position() + 1); + returnFromMessageCallWontTouchRamXorStackItemPop4.position(returnFromMessageCallWontTouchRamXorStackItemPop4.position() + 1); } if (!filled.get(110)) { - rlpaddrDepAddrHiXorCallDataContextNumberXorMmuRefSize.position( - rlpaddrDepAddrHiXorCallDataContextNumberXorMmuRefSize.position() + 4); + rlpaddrDepAddrHiXorCallDataContextNumberXorMmuRefSize.position(rlpaddrDepAddrHiXorCallDataContextNumberXorMmuRefSize.position() + 4); } if (!filled.get(139)) { - rlpaddrDepAddrLoXorMmuSrcOffsetHiXorStackItemValueHi4XorValueOrigHi.position( - rlpaddrDepAddrLoXorMmuSrcOffsetHiXorStackItemValueHi4XorValueOrigHi.position() + 16); + rlpaddrDepAddrLoXorMmuSrcOffsetHiXorStackItemValueHi4XorValueOrigHi.position(rlpaddrDepAddrLoXorMmuSrcOffsetHiXorStackItemValueHi4XorValueOrigHi.position() + 16); } if (!filled.get(64)) { - rlpaddrFlagXorCreateNonemptyInitCodeFailureWontRevertXorJumpDestinationVettingRequired - .position( - rlpaddrFlagXorCreateNonemptyInitCodeFailureWontRevertXorJumpDestinationVettingRequired - .position() - + 1); + rlpaddrFlagXorCreateNonemptyInitCodeFailureWontRevertXorJumpDestinationVettingRequired.position(rlpaddrFlagXorCreateNonemptyInitCodeFailureWontRevertXorJumpDestinationVettingRequired.position() + 1); } if (!filled.get(140)) { - rlpaddrKecHiXorMmuSrcOffsetLoXorStackItemValueLo1XorValueOrigLo.position( - rlpaddrKecHiXorMmuSrcOffsetLoXorStackItemValueLo1XorValueOrigLo.position() + 16); + rlpaddrKecHiXorMmuSrcOffsetLoXorStackItemValueLo1XorValueOrigLo.position(rlpaddrKecHiXorMmuSrcOffsetLoXorStackItemValueLo1XorValueOrigLo.position() + 16); } if (!filled.get(141)) { - rlpaddrKecLoXorMmuTgtOffsetLoXorStackItemValueLo2.position( - rlpaddrKecLoXorMmuTgtOffsetLoXorStackItemValueLo2.position() + 16); + rlpaddrKecLoXorMmuTgtOffsetLoXorStackItemValueLo2.position(rlpaddrKecLoXorMmuTgtOffsetLoXorStackItemValueLo2.position() + 16); } if (!filled.get(96)) { @@ -8724,18 +7259,15 @@ public Trace fillAndValidateRow() { } if (!filled.get(142)) { - rlpaddrSaltHiXorMxpGasMxpXorStackItemValueLo3.position( - rlpaddrSaltHiXorMxpGasMxpXorStackItemValueLo3.position() + 16); + rlpaddrSaltHiXorMxpGasMxpXorStackItemValueLo3.position(rlpaddrSaltHiXorMxpGasMxpXorStackItemValueLo3.position() + 16); } if (!filled.get(143)) { - rlpaddrSaltLoXorMxpOffset1HiXorStackItemValueLo4.position( - rlpaddrSaltLoXorMxpOffset1HiXorStackItemValueLo4.position() + 16); + rlpaddrSaltLoXorMxpOffset1HiXorStackItemValueLo4.position(rlpaddrSaltLoXorMxpOffset1HiXorStackItemValueLo4.position() + 16); } if (!filled.get(65)) { - romlexFlagXorCreateNonemptyInitCodeSuccessWillRevertXorJumpFlag.position( - romlexFlagXorCreateNonemptyInitCodeSuccessWillRevertXorJumpFlag.position() + 1); + romlexFlagXorCreateNonemptyInitCodeSuccessWillRevertXorJumpFlag.position(romlexFlagXorCreateNonemptyInitCodeSuccessWillRevertXorJumpFlag.position() + 1); } if (!filled.get(87)) { @@ -8743,18 +7275,15 @@ public Trace fillAndValidateRow() { } if (!filled.get(88)) { - selfdestructWillRevertXorStaticFlag.position( - selfdestructWillRevertXorStaticFlag.position() + 1); + selfdestructWillRevertXorStaticFlag.position(selfdestructWillRevertXorStaticFlag.position() + 1); } if (!filled.get(89)) { - selfdestructWontRevertAlreadyMarkedXorStoFlag.position( - selfdestructWontRevertAlreadyMarkedXorStoFlag.position() + 1); + selfdestructWontRevertAlreadyMarkedXorStoFlag.position(selfdestructWontRevertAlreadyMarkedXorStoFlag.position() + 1); } if (!filled.get(90)) { - selfdestructWontRevertNotYetMarkedXorSux.position( - selfdestructWontRevertNotYetMarkedXorSux.position() + 1); + selfdestructWontRevertNotYetMarkedXorSux.position(selfdestructWontRevertNotYetMarkedXorSux.position() + 1); } if (!filled.get(98)) { @@ -8794,8 +7323,7 @@ public Trace fillAndValidateRow() { } if (!filled.get(125)) { - stpGasUpfrontGasCostXorGasLeftover.position( - stpGasUpfrontGasCostXorGasLeftover.position() + 8); + stpGasUpfrontGasCostXorPrcReturnGasXorGasLeftover.position(stpGasUpfrontGasCostXorPrcReturnGasXorGasLeftover.position() + 8); } if (!filled.get(163)) { @@ -8815,8 +7343,7 @@ public Trace fillAndValidateRow() { } if (!filled.get(66)) { - trmFlagXorCreateNonemptyInitCodeSuccessWontRevertXorKecFlag.position( - trmFlagXorCreateNonemptyInitCodeSuccessWontRevertXorKecFlag.position() + 1); + trmFlagXorCreateNonemptyInitCodeSuccessWontRevertXorKecFlag.position(trmFlagXorCreateNonemptyInitCodeSuccessWontRevertXorKecFlag.position() + 1); } if (!filled.get(144)) { @@ -8852,8 +7379,7 @@ public Trace fillAndValidateRow() { } if (!filled.get(68)) { - warmthNewXorPrcEcaddXorLogInfoFlag.position( - warmthNewXorPrcEcaddXorLogInfoFlag.position() + 1); + warmthNewXorPrcEcaddXorLogInfoFlag.position(warmthNewXorPrcEcaddXorLogInfoFlag.position() + 1); } if (!filled.get(67)) { diff --git a/arithmetization/src/main/java/net/consensys/linea/zktracer/module/hub/fragment/scenario/PrecompileScenarioFragment.java b/arithmetization/src/main/java/net/consensys/linea/zktracer/module/hub/fragment/scenario/PrecompileScenarioFragment.java index b9af65d2c8..546069e4dd 100644 --- a/arithmetization/src/main/java/net/consensys/linea/zktracer/module/hub/fragment/scenario/PrecompileScenarioFragment.java +++ b/arithmetization/src/main/java/net/consensys/linea/zktracer/module/hub/fragment/scenario/PrecompileScenarioFragment.java @@ -28,6 +28,7 @@ import net.consensys.linea.zktracer.module.hub.Trace; import net.consensys.linea.zktracer.module.hub.fragment.TraceFragment; import net.consensys.linea.zktracer.module.hub.section.call.precompileSubsection.PrecompileSubsection; +import org.apache.tuweni.bytes.Bytes; import org.hyperledger.besu.datatypes.Address; @Getter @@ -169,9 +170,9 @@ public Trace trace(Trace trace) { .pScenarioPrcSuccessCallerWontRevert(scenario == PRC_SUCCESS_WONT_REVERT) .pScenarioPrcFailureKnownToHub(scenario == PRC_FAILURE_KNOWN_TO_HUB) .pScenarioPrcFailureKnownToRam(scenario == PRC_FAILURE_KNOWN_TO_RAM) - .pScenarioPrcCallerGas(precompileSubSection.callerGas()) - .pScenarioPrcCalleeGas(precompileSubSection.calleeGas()) - .pScenarioPrcReturnGas(precompileSubSection.returnGas()) + .pScenarioPrcCallerGas(Bytes.ofUnsignedLong(precompileSubSection.callerGas())) + .pScenarioPrcCalleeGas(Bytes.ofUnsignedLong(precompileSubSection.calleeGas())) + .pScenarioPrcReturnGas(Bytes.ofUnsignedLong(precompileSubSection.returnGas())) .pScenarioPrcCdo(precompileSubSection.callDataOffset()) .pScenarioPrcCds(precompileSubSection.callDataSize()) .pScenarioPrcRao(precompileSubSection.returnAtOffset()) From d4ed209f45bfa0a28655304934abe3e05d063f76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Olivier=20B=C3=A9gassat?= Date: Fri, 6 Dec 2024 22:04:09 +0700 Subject: [PATCH 43/44] feat: new simplified tests triggers scenario/CALL_FAILURE_WILL_REVERT using a self call and only 2 or 3 iterations (and blows up for STATICCALL) with an exception. --- .../complexTargets/FailureWillRevertTest.java | 161 ++++++++++++++++++ 1 file changed, 161 insertions(+) create mode 100644 arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/callTests/smc/complexTargets/FailureWillRevertTest.java diff --git a/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/callTests/smc/complexTargets/FailureWillRevertTest.java b/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/callTests/smc/complexTargets/FailureWillRevertTest.java new file mode 100644 index 0000000000..b689e696e8 --- /dev/null +++ b/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/callTests/smc/complexTargets/FailureWillRevertTest.java @@ -0,0 +1,161 @@ +/* + * Copyright Consensys Software Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 + */ +package net.consensys.linea.zktracer.instructionprocessing.callTests.smc.complexTargets; + +import net.consensys.linea.testing.BytecodeCompiler; +import net.consensys.linea.testing.BytecodeRunner; +import net.consensys.linea.zktracer.opcode.OpCode; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.EnumSource; + +import static net.consensys.linea.zktracer.instructionprocessing.utilities.Calls.appendRevert; +import static net.consensys.linea.zktracer.opcode.OpCode.*; + +/** + * The following uses a smart contract that calls itself but stops after one iteration. + * At which point it reverts and its caller reverts, too. + */ +public class FailureWillRevertTest { + + @ParameterizedTest + @EnumSource( + value = OpCode.class, + names = {"CALL", "CALLCODE", "DELEGATECALL", "STATICCALL"}) + public void singleSelfCallFailureWillRevertTest(OpCode callOpCode) { + + BytecodeCompiler program = BytecodeCompiler.newProgram(); + sloadFrom(program, 0x00); + addX(program, 0x01); + duplicateTop(program); + sstoreAt(program, 0x00); + reduceMod2(program); + negateBit(program); + + int currentSize = program.compile().size(); + + jumpToXIfTopIsZero(program, currentSize + 4 + 5); // + 4 + // top is nonzero execution path + appendRevert(program, 13, 9); // + 5 + // top is zero execution path + prepareLanding(program); + selfCall(program, callOpCode, 0xffff, 0x01); + appendRevert(program, 31, 7); + + BytecodeRunner.of(program).run(); + } + + @ParameterizedTest + @EnumSource( + value = OpCode.class, + names = {"CALL", "CALLCODE", "DELEGATECALL", "STATICCALL"}) + public void thirdSelfCallBreaksTriggeringFailureWillRevertTest(OpCode callOpCode) { + + BytecodeCompiler program = BytecodeCompiler.newProgram(); + sloadFrom(program, 0x00); + addX(program, 0x01); + duplicateTop(program); + sstoreAt(program, 0x00); + compareToX(program, 3); + + int currentSize = program.compile().size(); + + jumpToXIfTopIsZero(program, currentSize + 4 + 5); // + 4 + // top is nonzero execution path + appendRevert(program, 13, 9); // + 5 + // top is zero execution path + prepareLanding(program); + selfCall(program, callOpCode, 0xffff, 0x01); + appendRevert(program, 31, 7); + + BytecodeRunner.of(program).run(); + } + + public void sloadFrom(BytecodeCompiler program, int storageKey) { + program + .push(storageKey) + .op(SLOAD); + } + + public void addX(BytecodeCompiler program, int x) { + program + .push(x) + .op(ADD); + } + + public void duplicateTop(BytecodeCompiler program) { + program.op(DUP1); + } + + public void sstoreAt(BytecodeCompiler program, int storageKey) { + program + .push(storageKey) + .op(SSTORE); + } + + public void reduceModX(BytecodeCompiler program, int x) { + program + .push(x) + .op(SWAP1) + .op(MOD); + } + + public void reduceMod2(BytecodeCompiler program) { + reduceModX(program, 0x02); + } + + public void jumpToXIfTopIsZero(BytecodeCompiler program, int x) { + program + .op(ISZERO) + .push(x) + .op(JUMPI); + } + + public void prepareLanding(BytecodeCompiler program) { + program.op(JUMPDEST); + } + + public void selfCall(BytecodeCompiler program, OpCode callOpCode, int gas, int value) { + program + .push(0x20) + .push(0x33) + .push(0x46) + .push(0x59); // just some random bullshit + if (callOpCode.callHasValueArgument()) { + program.push(value); + } + program + .op(ADDRESS) + .push(gas) + .op(callOpCode); + + } + + /** + * This method assumes that the top of the stack is a boolean value and negates it. + * + * @param program + */ + public void negateBit(BytecodeCompiler program) { + program + .push(1) + .op(XOR); + } + + public void compareToX(BytecodeCompiler program, int x) { + program + .push(x) + .op(EQ); + } +} From f9e21d5cd4df3c0fc2b38b668b8a6e2c2c6d3902 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Olivier=20B=C3=A9gassat?= Date: Sat, 7 Dec 2024 01:08:33 +0700 Subject: [PATCH 44/44] spotless --- .../linea/zktracer/module/hub/Trace.java | 3513 ++++++++++++----- .../complexTargets/FailureWillRevertTest.java | 242 +- 2 files changed, 2606 insertions(+), 1149 deletions(-) diff --git a/arithmetization/src/main/java/net/consensys/linea/zktracer/module/hub/Trace.java b/arithmetization/src/main/java/net/consensys/linea/zktracer/module/hub/Trace.java index 83e1f404d8..d10c580332 100644 --- a/arithmetization/src/main/java/net/consensys/linea/zktracer/module/hub/Trace.java +++ b/arithmetization/src/main/java/net/consensys/linea/zktracer/module/hub/Trace.java @@ -15,7 +15,6 @@ package net.consensys.linea.zktracer.module.hub; -import java.math.BigInteger; import java.nio.MappedByteBuffer; import java.util.ArrayList; import java.util.BitSet; @@ -41,26 +40,37 @@ public class Trace { private int currentLine = 0; private final MappedByteBuffer absoluteTransactionNumber; - private final MappedByteBuffer addressHiXorAccountAddressHiXorCcrsStampXorPrcCdoXorStaticGasXorAddressHiXorCallDataSize; - private final MappedByteBuffer addressLoXorAccountAddressLoXorExpData1XorHashInfoKeccakHiXorAddressLoXorCoinbaseAddressLo; - private final MappedByteBuffer againInBlkXorIsRootXorCcsrFlagXorCallAbortWillRevertXorAccFlagXorAgainInBlkXorCopyTxcd; - private final MappedByteBuffer againInCnfXorIsStaticXorExpFlagXorCallAbortWontRevertXorAddFlagXorAgainInCnfXorIsDeployment; - private final MappedByteBuffer againInTxnXorUpdateXorMmuFlagXorCallEoaSuccessCallerWillRevertXorBinFlagXorAgainInTxnXorIsType2; + private final MappedByteBuffer + addressHiXorAccountAddressHiXorCcrsStampXorPrcCdoXorStaticGasXorAddressHiXorCallDataSize; + private final MappedByteBuffer + addressLoXorAccountAddressLoXorExpData1XorHashInfoKeccakHiXorAddressLoXorCoinbaseAddressLo; + private final MappedByteBuffer + againInBlkXorIsRootXorCcsrFlagXorCallAbortWillRevertXorAccFlagXorAgainInBlkXorCopyTxcd; + private final MappedByteBuffer + againInCnfXorIsStaticXorExpFlagXorCallAbortWontRevertXorAddFlagXorAgainInCnfXorIsDeployment; + private final MappedByteBuffer + againInTxnXorUpdateXorMmuFlagXorCallEoaSuccessCallerWillRevertXorBinFlagXorAgainInTxnXorIsType2; private final MappedByteBuffer alpha; - private final MappedByteBuffer balanceNewXorCallerAddressLoXorExpData3XorPushValueHiXorStorageKeyLoXorInitialBalance; - private final MappedByteBuffer balanceXorByteCodeAddressLoXorExpData2XorHashInfoKeccakLoXorStorageKeyHiXorFromAddressLo; + private final MappedByteBuffer + balanceNewXorCallerAddressLoXorExpData3XorPushValueHiXorStorageKeyLoXorInitialBalance; + private final MappedByteBuffer + balanceXorByteCodeAddressLoXorExpData2XorHashInfoKeccakLoXorStorageKeyHiXorFromAddressLo; private final MappedByteBuffer callDataOffsetXorMmuSize; private final MappedByteBuffer callDataSizeXorMmuSrcId; private final MappedByteBuffer callStackDepthXorStackItemHeight1; private final MappedByteBuffer callerContextNumber; private final MappedByteBuffer codeFragmentIndex; - private final MappedByteBuffer codeFragmentIndexXorAccountDeploymentNumberXorExpInstXorPrcCdsXorDeploymentNumberXorCoinbaseAddressHi; + private final MappedByteBuffer + codeFragmentIndexXorAccountDeploymentNumberXorExpInstXorPrcCdsXorDeploymentNumberXorCoinbaseAddressHi; private final MappedByteBuffer codeHashHiNewXorExpData5XorStackItemValueHi1XorValueCurrLoXorValue; - private final MappedByteBuffer codeHashHiXorCallValueXorExpData4XorPushValueLoXorValueCurrHiXorToAddressLo; + private final MappedByteBuffer + codeHashHiXorCallValueXorExpData4XorPushValueLoXorValueCurrHiXorToAddressLo; private final MappedByteBuffer codeHashLoNewXorMmuLimb2XorStackItemValueHi3XorValueNextLo; private final MappedByteBuffer codeHashLoXorMmuLimb1XorStackItemValueHi2XorValueNextHi; - private final MappedByteBuffer codeSizeNewXorByteCodeCodeFragmentIndexXorMmuExoSumXorPrcRaoXorInitCodeSize; - private final MappedByteBuffer codeSizeXorByteCodeAddressHiXorMmuAuxIdXorPrcRacXorDeploymentNumberInftyXorFromAddressHi; + private final MappedByteBuffer + codeSizeNewXorByteCodeCodeFragmentIndexXorMmuExoSumXorPrcRaoXorInitCodeSize; + private final MappedByteBuffer + codeSizeXorByteCodeAddressHiXorMmuAuxIdXorPrcRacXorDeploymentNumberInftyXorFromAddressHi; private final MappedByteBuffer contextGetsReverted; private final MappedByteBuffer contextMayChange; private final MappedByteBuffer contextNumber; @@ -76,20 +86,31 @@ public class Trace { private final MappedByteBuffer deploymentNumberFirstInBlockXorDeploymentNumberFirstInBlock; private final MappedByteBuffer deploymentNumberInftyXorByteCodeDeploymentStatusXorMmuPhase; private final MappedByteBuffer deploymentNumberNewXorCallerAddressHiXorMmuRefOffset; - private final MappedByteBuffer deploymentNumberXorByteCodeDeploymentNumberXorMmuInstXorToAddressHi; - private final MappedByteBuffer deploymentStatusInftyXorMxpDeploysXorCallExceptionXorCallFlagXorFinalInCnfXorStatusCode; - private final MappedByteBuffer deploymentStatusNewXorMxpFlagXorCallPrcFailureXorConFlagXorFinalInTxn; - private final MappedByteBuffer deploymentStatusXorMmuSuccessBitXorCallEoaSuccessCallerWontRevertXorBtcFlagXorFinalInBlkXorRequiresEvmExecution; + private final MappedByteBuffer + deploymentNumberXorByteCodeDeploymentNumberXorMmuInstXorToAddressHi; + private final MappedByteBuffer + deploymentStatusInftyXorMxpDeploysXorCallExceptionXorCallFlagXorFinalInCnfXorStatusCode; + private final MappedByteBuffer + deploymentStatusNewXorMxpFlagXorCallPrcFailureXorConFlagXorFinalInTxn; + private final MappedByteBuffer + deploymentStatusXorMmuSuccessBitXorCallEoaSuccessCallerWontRevertXorBtcFlagXorFinalInBlkXorRequiresEvmExecution; private final MappedByteBuffer domStamp; private final MappedByteBuffer exceptionAhoy; - private final MappedByteBuffer existsNewXorMxpMxpxXorCallPrcSuccessCallerWontRevertXorCreateFlagXorFirstInCnf; - private final MappedByteBuffer existsXorMxpMtntopXorCallPrcSuccessCallerWillRevertXorCopyFlagXorFirstInBlk; - private final MappedByteBuffer finalInBlkXorMxpSize1NonzeroNoMxpxXorCallSmcFailureCallerWillRevertXorDecFlag1XorFirstInTxn; - private final MappedByteBuffer finalInCnfXorMxpSize2NonzeroNoMxpxXorCallSmcFailureCallerWontRevertXorDecFlag2XorValueCurrChanges; - private final MappedByteBuffer finalInTxnXorOobFlagXorCallSmcSuccessCallerWillRevertXorDecFlag3XorValueCurrIsOrig; - private final MappedByteBuffer firstInBlkXorStpExistsXorCallSmcSuccessCallerWontRevertXorDecFlag4XorValueCurrIsZero; + private final MappedByteBuffer + existsNewXorMxpMxpxXorCallPrcSuccessCallerWontRevertXorCreateFlagXorFirstInCnf; + private final MappedByteBuffer + existsXorMxpMtntopXorCallPrcSuccessCallerWillRevertXorCopyFlagXorFirstInBlk; + private final MappedByteBuffer + finalInBlkXorMxpSize1NonzeroNoMxpxXorCallSmcFailureCallerWillRevertXorDecFlag1XorFirstInTxn; + private final MappedByteBuffer + finalInCnfXorMxpSize2NonzeroNoMxpxXorCallSmcFailureCallerWontRevertXorDecFlag2XorValueCurrChanges; + private final MappedByteBuffer + finalInTxnXorOobFlagXorCallSmcSuccessCallerWillRevertXorDecFlag3XorValueCurrIsOrig; + private final MappedByteBuffer + firstInBlkXorStpExistsXorCallSmcSuccessCallerWontRevertXorDecFlag4XorValueCurrIsZero; private final MappedByteBuffer firstInCnfXorStpFlagXorCreateAbortXorDupFlagXorValueNextIsCurr; - private final MappedByteBuffer firstInTxnXorStpOogxXorCreateEmptyInitCodeWillRevertXorExtFlagXorValueNextIsOrig; + private final MappedByteBuffer + firstInTxnXorStpOogxXorCreateEmptyInitCodeWillRevertXorExtFlagXorValueNextIsOrig; private final MappedByteBuffer gasActual; private final MappedByteBuffer gasCost; private final MappedByteBuffer gasExpected; @@ -97,7 +118,8 @@ public class Trace { private final MappedByteBuffer gasNext; private final MappedByteBuffer gasPrice; private final MappedByteBuffer hasCodeNewXorCreateExceptionXorHashInfoFlagXorValueOrigIsZero; - private final MappedByteBuffer hasCodeXorStpWarmthXorCreateEmptyInitCodeWontRevertXorHaltFlagXorValueNextIsZero; + private final MappedByteBuffer + hasCodeXorStpWarmthXorCreateEmptyInitCodeWontRevertXorHaltFlagXorValueNextIsZero; private final MappedByteBuffer height; private final MappedByteBuffer heightNew; private final MappedByteBuffer hubStamp; @@ -105,8 +127,10 @@ public class Trace { private final MappedByteBuffer instruction; private final MappedByteBuffer isPrecompileXorCreateFailureConditionWillRevertXorIcpxXorWarmth; private final MappedByteBuffer logInfoStamp; - private final MappedByteBuffer markedForSelfdestructNewXorCreateNonemptyInitCodeFailureWillRevertXorJumpx; - private final MappedByteBuffer markedForSelfdestructXorCreateFailureConditionWontRevertXorInvalidFlagXorWarmthNew; + private final MappedByteBuffer + markedForSelfdestructNewXorCreateNonemptyInitCodeFailureWillRevertXorJumpx; + private final MappedByteBuffer + markedForSelfdestructXorCreateFailureConditionWontRevertXorInvalidFlagXorWarmthNew; private final MappedByteBuffer mmuStamp; private final MappedByteBuffer mxpOffset2Hi; private final MappedByteBuffer mxpOffset2Lo; @@ -118,7 +142,8 @@ public class Trace { private final MappedByteBuffer mxpWords; private final MappedByteBuffer nonStackRows; private final MappedByteBuffer nonce; - private final MappedByteBuffer nonceNewXorStpGasPaidOutOfPocketXorPrcCallerGasXorGasInitiallyAvailable; + private final MappedByteBuffer + nonceNewXorStpGasPaidOutOfPocketXorPrcCallerGasXorGasInitiallyAvailable; private final MappedByteBuffer nonceXorStpGasMxpXorPrcCalleeGasXorBasefee; private final MappedByteBuffer oobData1; private final MappedByteBuffer oobData2; @@ -168,8 +193,10 @@ public class Trace { private final MappedByteBuffer returnFromMessageCallWillTouchRamXorStackItemPop3; private final MappedByteBuffer returnFromMessageCallWontTouchRamXorStackItemPop4; private final MappedByteBuffer rlpaddrDepAddrHiXorCallDataContextNumberXorMmuRefSize; - private final MappedByteBuffer rlpaddrDepAddrLoXorMmuSrcOffsetHiXorStackItemValueHi4XorValueOrigHi; - private final MappedByteBuffer rlpaddrFlagXorCreateNonemptyInitCodeFailureWontRevertXorJumpDestinationVettingRequired; + private final MappedByteBuffer + rlpaddrDepAddrLoXorMmuSrcOffsetHiXorStackItemValueHi4XorValueOrigHi; + private final MappedByteBuffer + rlpaddrFlagXorCreateNonemptyInitCodeFailureWontRevertXorJumpDestinationVettingRequired; private final MappedByteBuffer rlpaddrKecHiXorMmuSrcOffsetLoXorStackItemValueLo1XorValueOrigLo; private final MappedByteBuffer rlpaddrKecLoXorMmuTgtOffsetLoXorStackItemValueLo2; private final MappedByteBuffer rlpaddrRecipe; @@ -208,198 +235,403 @@ public class Trace { private final MappedByteBuffer wcpFlag; static List headers(int length) { - List headers = new ArrayList<>(); - headers.add(new ColumnHeader("hub.ABSOLUTE_TRANSACTION_NUMBER", 2, length)); - headers.add(new ColumnHeader("hub.ADDRESS_HI_xor_ACCOUNT_ADDRESS_HI_xor_CCRS_STAMP_xor_PRC_CDO_xor_STATIC_GAS_xor_ADDRESS_HI_xor_CALL_DATA_SIZE", 4, length)); - headers.add(new ColumnHeader("hub.ADDRESS_LO_xor_ACCOUNT_ADDRESS_LO_xor_EXP_DATA_1_xor_HASH_INFO_KECCAK_HI_xor_ADDRESS_LO_xor_COINBASE_ADDRESS_LO", 16, length)); - headers.add(new ColumnHeader("hub.AGAIN_IN_BLK_xor_IS_ROOT_xor_CCSR_FLAG_xor_CALL_ABORT_WILL_REVERT_xor_ACC_FLAG_xor_AGAIN_IN_BLK_xor_COPY_TXCD", 1, length)); - headers.add(new ColumnHeader("hub.AGAIN_IN_CNF_xor_IS_STATIC_xor_EXP_FLAG_xor_CALL_ABORT_WONT_REVERT_xor_ADD_FLAG_xor_AGAIN_IN_CNF_xor_IS_DEPLOYMENT", 1, length)); - headers.add(new ColumnHeader("hub.AGAIN_IN_TXN_xor_UPDATE_xor_MMU_FLAG_xor_CALL_EOA_SUCCESS_CALLER_WILL_REVERT_xor_BIN_FLAG_xor_AGAIN_IN_TXN_xor_IS_TYPE2", 1, length)); - headers.add(new ColumnHeader("hub.ALPHA", 1, length)); - headers.add(new ColumnHeader("hub.BALANCE_NEW_xor_CALLER_ADDRESS_LO_xor_EXP_DATA_3_xor_PUSH_VALUE_HI_xor_STORAGE_KEY_LO_xor_INITIAL_BALANCE", 16, length)); - headers.add(new ColumnHeader("hub.BALANCE_xor_BYTE_CODE_ADDRESS_LO_xor_EXP_DATA_2_xor_HASH_INFO_KECCAK_LO_xor_STORAGE_KEY_HI_xor_FROM_ADDRESS_LO", 16, length)); - headers.add(new ColumnHeader("hub.CALL_DATA_OFFSET_xor_MMU_SIZE", 4, length)); - headers.add(new ColumnHeader("hub.CALL_DATA_SIZE_xor_MMU_SRC_ID", 4, length)); - headers.add(new ColumnHeader("hub.CALL_STACK_DEPTH_xor_STACK_ITEM_HEIGHT_1", 2, length)); - headers.add(new ColumnHeader("hub.CALLER_CONTEXT_NUMBER", 4, length)); - headers.add(new ColumnHeader("hub.CODE_FRAGMENT_INDEX", 4, length)); - headers.add(new ColumnHeader("hub.CODE_FRAGMENT_INDEX_xor_ACCOUNT_DEPLOYMENT_NUMBER_xor_EXP_INST_xor_PRC_CDS_xor_DEPLOYMENT_NUMBER_xor_COINBASE_ADDRESS_HI", 4, length)); - headers.add(new ColumnHeader("hub.CODE_HASH_HI_NEW_xor_EXP_DATA_5_xor_STACK_ITEM_VALUE_HI_1_xor_VALUE_CURR_LO_xor_VALUE", 16, length)); - headers.add(new ColumnHeader("hub.CODE_HASH_HI_xor_CALL_VALUE_xor_EXP_DATA_4_xor_PUSH_VALUE_LO_xor_VALUE_CURR_HI_xor_TO_ADDRESS_LO", 16, length)); - headers.add(new ColumnHeader("hub.CODE_HASH_LO_NEW_xor_MMU_LIMB_2_xor_STACK_ITEM_VALUE_HI_3_xor_VALUE_NEXT_LO", 16, length)); - headers.add(new ColumnHeader("hub.CODE_HASH_LO_xor_MMU_LIMB_1_xor_STACK_ITEM_VALUE_HI_2_xor_VALUE_NEXT_HI", 16, length)); - headers.add(new ColumnHeader("hub.CODE_SIZE_NEW_xor_BYTE_CODE_CODE_FRAGMENT_INDEX_xor_MMU_EXO_SUM_xor_PRC_RAO_xor_INIT_CODE_SIZE", 4, length)); - headers.add(new ColumnHeader("hub.CODE_SIZE_xor_BYTE_CODE_ADDRESS_HI_xor_MMU_AUX_ID_xor_PRC_RAC_xor_DEPLOYMENT_NUMBER_INFTY_xor_FROM_ADDRESS_HI", 4, length)); - headers.add(new ColumnHeader("hub.CONTEXT_GETS_REVERTED", 1, length)); - headers.add(new ColumnHeader("hub.CONTEXT_MAY_CHANGE", 1, length)); - headers.add(new ColumnHeader("hub.CONTEXT_NUMBER", 4, length)); - headers.add(new ColumnHeader("hub.CONTEXT_NUMBER_NEW", 4, length)); - headers.add(new ColumnHeader("hub.CONTEXT_NUMBER_xor_MMU_TGT_ID", 4, length)); - headers.add(new ColumnHeader("hub.CONTEXT_REVERT_STAMP", 4, length)); - headers.add(new ColumnHeader("hub.CONTEXT_SELF_REVERTS", 1, length)); - headers.add(new ColumnHeader("hub.CONTEXT_WILL_REVERT", 1, length)); - headers.add(new ColumnHeader("hub.COUNTER_NSR", 1, length)); - headers.add(new ColumnHeader("hub.COUNTER_TLI", 1, length)); - headers.add(new ColumnHeader("hub.DELTA", 1, length)); - headers.add(new ColumnHeader("hub.DEPLOYMENT_NUMBER_FINAL_IN_BLOCK_xor_DEPLOYMENT_NUMBER_FINAL_IN_BLOCK", 2, length)); - headers.add(new ColumnHeader("hub.DEPLOYMENT_NUMBER_FIRST_IN_BLOCK_xor_DEPLOYMENT_NUMBER_FIRST_IN_BLOCK", 2, length)); - headers.add(new ColumnHeader("hub.DEPLOYMENT_NUMBER_INFTY_xor_BYTE_CODE_DEPLOYMENT_STATUS_xor_MMU_PHASE", 4, length)); - headers.add(new ColumnHeader("hub.DEPLOYMENT_NUMBER_NEW_xor_CALLER_ADDRESS_HI_xor_MMU_REF_OFFSET", 4, length)); - headers.add(new ColumnHeader("hub.DEPLOYMENT_NUMBER_xor_BYTE_CODE_DEPLOYMENT_NUMBER_xor_MMU_INST_xor_TO_ADDRESS_HI", 4, length)); - headers.add(new ColumnHeader("hub.DEPLOYMENT_STATUS_INFTY_xor_MXP_DEPLOYS_xor_CALL_EXCEPTION_xor_CALL_FLAG_xor_FINAL_IN_CNF_xor_STATUS_CODE", 1, length)); - headers.add(new ColumnHeader("hub.DEPLOYMENT_STATUS_NEW_xor_MXP_FLAG_xor_CALL_PRC_FAILURE_xor_CON_FLAG_xor_FINAL_IN_TXN", 1, length)); - headers.add(new ColumnHeader("hub.DEPLOYMENT_STATUS_xor_MMU_SUCCESS_BIT_xor_CALL_EOA_SUCCESS_CALLER_WONT_REVERT_xor_BTC_FLAG_xor_FINAL_IN_BLK_xor_REQUIRES_EVM_EXECUTION", 1, length)); - headers.add(new ColumnHeader("hub.DOM_STAMP", 4, length)); - headers.add(new ColumnHeader("hub.EXCEPTION_AHOY", 1, length)); - headers.add(new ColumnHeader("hub.EXISTS_NEW_xor_MXP_MXPX_xor_CALL_PRC_SUCCESS_CALLER_WONT_REVERT_xor_CREATE_FLAG_xor_FIRST_IN_CNF", 1, length)); - headers.add(new ColumnHeader("hub.EXISTS_xor_MXP_MTNTOP_xor_CALL_PRC_SUCCESS_CALLER_WILL_REVERT_xor_COPY_FLAG_xor_FIRST_IN_BLK", 1, length)); - headers.add(new ColumnHeader("hub.FINAL_IN_BLK_xor_MXP_SIZE_1_NONZERO_NO_MXPX_xor_CALL_SMC_FAILURE_CALLER_WILL_REVERT_xor_DEC_FLAG_1_xor_FIRST_IN_TXN", 1, length)); - headers.add(new ColumnHeader("hub.FINAL_IN_CNF_xor_MXP_SIZE_2_NONZERO_NO_MXPX_xor_CALL_SMC_FAILURE_CALLER_WONT_REVERT_xor_DEC_FLAG_2_xor_VALUE_CURR_CHANGES", 1, length)); - headers.add(new ColumnHeader("hub.FINAL_IN_TXN_xor_OOB_FLAG_xor_CALL_SMC_SUCCESS_CALLER_WILL_REVERT_xor_DEC_FLAG_3_xor_VALUE_CURR_IS_ORIG", 1, length)); - headers.add(new ColumnHeader("hub.FIRST_IN_BLK_xor_STP_EXISTS_xor_CALL_SMC_SUCCESS_CALLER_WONT_REVERT_xor_DEC_FLAG_4_xor_VALUE_CURR_IS_ZERO", 1, length)); - headers.add(new ColumnHeader("hub.FIRST_IN_CNF_xor_STP_FLAG_xor_CREATE_ABORT_xor_DUP_FLAG_xor_VALUE_NEXT_IS_CURR", 1, length)); - headers.add(new ColumnHeader("hub.FIRST_IN_TXN_xor_STP_OOGX_xor_CREATE_EMPTY_INIT_CODE_WILL_REVERT_xor_EXT_FLAG_xor_VALUE_NEXT_IS_ORIG", 1, length)); - headers.add(new ColumnHeader("hub.GAS_ACTUAL", 8, length)); - headers.add(new ColumnHeader("hub.GAS_COST", 8, length)); - headers.add(new ColumnHeader("hub.GAS_EXPECTED", 8, length)); - headers.add(new ColumnHeader("hub.GAS_LIMIT", 8, length)); - headers.add(new ColumnHeader("hub.GAS_NEXT", 8, length)); - headers.add(new ColumnHeader("hub.GAS_PRICE", 8, length)); - headers.add(new ColumnHeader("hub.HAS_CODE_NEW_xor_CREATE_EXCEPTION_xor_HASH_INFO_FLAG_xor_VALUE_ORIG_IS_ZERO", 1, length)); - headers.add(new ColumnHeader("hub.HAS_CODE_xor_STP_WARMTH_xor_CREATE_EMPTY_INIT_CODE_WONT_REVERT_xor_HALT_FLAG_xor_VALUE_NEXT_IS_ZERO", 1, length)); - headers.add(new ColumnHeader("hub.HEIGHT", 2, length)); - headers.add(new ColumnHeader("hub.HEIGHT_NEW", 2, length)); - headers.add(new ColumnHeader("hub.HUB_STAMP", 4, length)); - headers.add(new ColumnHeader("hub.HUB_STAMP_TRANSACTION_END", 4, length)); - headers.add(new ColumnHeader("hub.INSTRUCTION", 32, length)); - headers.add(new ColumnHeader("hub.IS_PRECOMPILE_xor_CREATE_FAILURE_CONDITION_WILL_REVERT_xor_ICPX_xor_WARMTH", 1, length)); - headers.add(new ColumnHeader("hub.LOG_INFO_STAMP", 4, length)); - headers.add(new ColumnHeader("hub.MARKED_FOR_SELFDESTRUCT_NEW_xor_CREATE_NONEMPTY_INIT_CODE_FAILURE_WILL_REVERT_xor_JUMPX", 1, length)); - headers.add(new ColumnHeader("hub.MARKED_FOR_SELFDESTRUCT_xor_CREATE_FAILURE_CONDITION_WONT_REVERT_xor_INVALID_FLAG_xor_WARMTH_NEW", 1, length)); - headers.add(new ColumnHeader("hub.MMU_STAMP", 4, length)); - headers.add(new ColumnHeader("hub.MXP_OFFSET_2_HI", 16, length)); - headers.add(new ColumnHeader("hub.MXP_OFFSET_2_LO", 16, length)); - headers.add(new ColumnHeader("hub.MXP_SIZE_1_HI", 16, length)); - headers.add(new ColumnHeader("hub.MXP_SIZE_1_LO", 16, length)); - headers.add(new ColumnHeader("hub.MXP_SIZE_2_HI", 16, length)); - headers.add(new ColumnHeader("hub.MXP_SIZE_2_LO", 16, length)); - headers.add(new ColumnHeader("hub.MXP_STAMP", 4, length)); - headers.add(new ColumnHeader("hub.MXP_WORDS", 16, length)); - headers.add(new ColumnHeader("hub.NON_STACK_ROWS", 1, length)); - headers.add(new ColumnHeader("hub.NONCE", 8, length)); - headers.add(new ColumnHeader("hub.NONCE_NEW_xor_STP_GAS_PAID_OUT_OF_POCKET_xor_PRC_CALLER_GAS_xor_GAS_INITIALLY_AVAILABLE", 8, length)); - headers.add(new ColumnHeader("hub.NONCE_xor_STP_GAS_MXP_xor_PRC_CALLEE_GAS_xor_BASEFEE", 8, length)); - headers.add(new ColumnHeader("hub.OOB_DATA_1", 16, length)); - headers.add(new ColumnHeader("hub.OOB_DATA_2", 16, length)); - headers.add(new ColumnHeader("hub.OOB_DATA_3", 16, length)); - headers.add(new ColumnHeader("hub.OOB_DATA_4", 16, length)); - headers.add(new ColumnHeader("hub.OOB_DATA_5", 16, length)); - headers.add(new ColumnHeader("hub.OOB_DATA_6", 16, length)); - headers.add(new ColumnHeader("hub.OOB_DATA_7", 16, length)); - headers.add(new ColumnHeader("hub.OOB_DATA_8", 16, length)); - headers.add(new ColumnHeader("hub.OOB_DATA_9", 16, length)); - headers.add(new ColumnHeader("hub.PEEK_AT_ACCOUNT", 1, length)); - headers.add(new ColumnHeader("hub.PEEK_AT_CONTEXT", 1, length)); - headers.add(new ColumnHeader("hub.PEEK_AT_MISCELLANEOUS", 1, length)); - headers.add(new ColumnHeader("hub.PEEK_AT_SCENARIO", 1, length)); - headers.add(new ColumnHeader("hub.PEEK_AT_STACK", 1, length)); - headers.add(new ColumnHeader("hub.PEEK_AT_STORAGE", 1, length)); - headers.add(new ColumnHeader("hub.PEEK_AT_TRANSACTION", 1, length)); - headers.add(new ColumnHeader("hub.PRC_ECMUL_xor_MACHINE_STATE_FLAG", 1, length)); - headers.add(new ColumnHeader("hub.PRC_ECPAIRING_xor_MAXCSX", 1, length)); - headers.add(new ColumnHeader("hub.PRC_ECRECOVER_xor_MOD_FLAG", 1, length)); - headers.add(new ColumnHeader("hub.PRC_FAILURE_KNOWN_TO_HUB_xor_MUL_FLAG", 1, length)); - headers.add(new ColumnHeader("hub.PRC_FAILURE_KNOWN_TO_RAM_xor_MXPX", 1, length)); - headers.add(new ColumnHeader("hub.PRC_IDENTITY_xor_MXP_FLAG", 1, length)); - headers.add(new ColumnHeader("hub.PRC_MODEXP_xor_OOGX", 1, length)); - headers.add(new ColumnHeader("hub.PRC_RIPEMD-160_xor_OPCX", 1, length)); - headers.add(new ColumnHeader("hub.PRC_SHA2-256_xor_PUSHPOP_FLAG", 1, length)); - headers.add(new ColumnHeader("hub.PRC_SUCCESS_CALLER_WILL_REVERT_xor_RDCX", 1, length)); - headers.add(new ColumnHeader("hub.PRC_SUCCESS_CALLER_WONT_REVERT_xor_SHF_FLAG", 1, length)); - headers.add(new ColumnHeader("hub.PRIORITY_FEE_PER_GAS", 8, length)); - headers.add(new ColumnHeader("hub.PROGRAM_COUNTER", 4, length)); - headers.add(new ColumnHeader("hub.PROGRAM_COUNTER_NEW", 4, length)); - headers.add(new ColumnHeader("hub.REFUND_COUNTER", 4, length)); - headers.add(new ColumnHeader("hub.REFUND_COUNTER_INFINITY", 8, length)); - headers.add(new ColumnHeader("hub.REFUND_COUNTER_NEW", 4, length)); - headers.add(new ColumnHeader("hub.REFUND_EFFECTIVE", 8, length)); - headers.add(new ColumnHeader("hub.RELATIVE_BLOCK_NUMBER", 2, length)); - headers.add(new ColumnHeader("hub.RETURN_AT_CAPACITY_xor_MXP_INST", 4, length)); - headers.add(new ColumnHeader("hub.RETURN_AT_OFFSET_xor_OOB_INST", 4, length)); - headers.add(new ColumnHeader("hub.RETURN_DATA_CONTEXT_NUMBER_xor_STP_GAS_STIPEND", 4, length)); - headers.add(new ColumnHeader("hub.RETURN_DATA_OFFSET_xor_STP_INSTRUCTION", 4, length)); - headers.add(new ColumnHeader("hub.RETURN_DATA_SIZE", 4, length)); - headers.add(new ColumnHeader("hub.RETURN_EXCEPTION_xor_SOX", 1, length)); - headers.add(new ColumnHeader("hub.RETURN_FROM_DEPLOYMENT_EMPTY_CODE_WILL_REVERT_xor_SSTOREX", 1, length)); - headers.add(new ColumnHeader("hub.RETURN_FROM_DEPLOYMENT_EMPTY_CODE_WONT_REVERT_xor_STACKRAM_FLAG", 1, length)); - headers.add(new ColumnHeader("hub.RETURN_FROM_DEPLOYMENT_NONEMPTY_CODE_WILL_REVERT_xor_STACK_ITEM_POP_1", 1, length)); - headers.add(new ColumnHeader("hub.RETURN_FROM_DEPLOYMENT_NONEMPTY_CODE_WONT_REVERT_xor_STACK_ITEM_POP_2", 1, length)); - headers.add(new ColumnHeader("hub.RETURN_FROM_MESSAGE_CALL_WILL_TOUCH_RAM_xor_STACK_ITEM_POP_3", 1, length)); - headers.add(new ColumnHeader("hub.RETURN_FROM_MESSAGE_CALL_WONT_TOUCH_RAM_xor_STACK_ITEM_POP_4", 1, length)); - headers.add(new ColumnHeader("hub.RLPADDR_DEP_ADDR_HI_xor_CALL_DATA_CONTEXT_NUMBER_xor_MMU_REF_SIZE", 4, length)); - headers.add(new ColumnHeader("hub.RLPADDR_DEP_ADDR_LO_xor_MMU_SRC_OFFSET_HI_xor_STACK_ITEM_VALUE_HI_4_xor_VALUE_ORIG_HI", 16, length)); - headers.add(new ColumnHeader("hub.RLPADDR_FLAG_xor_CREATE_NONEMPTY_INIT_CODE_FAILURE_WONT_REVERT_xor_JUMP_DESTINATION_VETTING_REQUIRED", 1, length)); - headers.add(new ColumnHeader("hub.RLPADDR_KEC_HI_xor_MMU_SRC_OFFSET_LO_xor_STACK_ITEM_VALUE_LO_1_xor_VALUE_ORIG_LO", 16, length)); - headers.add(new ColumnHeader("hub.RLPADDR_KEC_LO_xor_MMU_TGT_OFFSET_LO_xor_STACK_ITEM_VALUE_LO_2", 16, length)); - headers.add(new ColumnHeader("hub.RLPADDR_RECIPE", 1, length)); - headers.add(new ColumnHeader("hub.RLPADDR_SALT_HI_xor_MXP_GAS_MXP_xor_STACK_ITEM_VALUE_LO_3", 16, length)); - headers.add(new ColumnHeader("hub.RLPADDR_SALT_LO_xor_MXP_OFFSET_1_HI_xor_STACK_ITEM_VALUE_LO_4", 16, length)); - headers.add(new ColumnHeader("hub.ROMLEX_FLAG_xor_CREATE_NONEMPTY_INIT_CODE_SUCCESS_WILL_REVERT_xor_JUMP_FLAG", 1, length)); - headers.add(new ColumnHeader("hub.SELFDESTRUCT_EXCEPTION_xor_STATICX", 1, length)); - headers.add(new ColumnHeader("hub.SELFDESTRUCT_WILL_REVERT_xor_STATIC_FLAG", 1, length)); - headers.add(new ColumnHeader("hub.SELFDESTRUCT_WONT_REVERT_ALREADY_MARKED_xor_STO_FLAG", 1, length)); - headers.add(new ColumnHeader("hub.SELFDESTRUCT_WONT_REVERT_NOT_YET_MARKED_xor_SUX", 1, length)); - headers.add(new ColumnHeader("hub.STACK_ITEM_HEIGHT_2", 2, length)); - headers.add(new ColumnHeader("hub.STACK_ITEM_HEIGHT_3", 2, length)); - headers.add(new ColumnHeader("hub.STACK_ITEM_HEIGHT_4", 2, length)); - headers.add(new ColumnHeader("hub.STACK_ITEM_STAMP_1", 5, length)); - headers.add(new ColumnHeader("hub.STACK_ITEM_STAMP_2", 5, length)); - headers.add(new ColumnHeader("hub.STACK_ITEM_STAMP_3", 5, length)); - headers.add(new ColumnHeader("hub.STACK_ITEM_STAMP_4", 5, length)); - headers.add(new ColumnHeader("hub.STP_GAS_HI", 16, length)); - headers.add(new ColumnHeader("hub.STP_GAS_LO", 16, length)); - headers.add(new ColumnHeader("hub.STP_GAS_UPFRONT_GAS_COST_xor_PRC_RETURN_GAS_xor_GAS_LEFTOVER", 8, length)); - headers.add(new ColumnHeader("hub.STP_VALUE_HI", 16, length)); - headers.add(new ColumnHeader("hub.STP_VALUE_LO", 16, length)); - headers.add(new ColumnHeader("hub.SUB_STAMP", 4, length)); - headers.add(new ColumnHeader("hub.SWAP_FLAG", 1, length)); - headers.add(new ColumnHeader("hub.TRM_FLAG_xor_CREATE_NONEMPTY_INIT_CODE_SUCCESS_WONT_REVERT_xor_KEC_FLAG", 1, length)); - headers.add(new ColumnHeader("hub.TRM_RAW_ADDRESS_HI_xor_MXP_OFFSET_1_LO", 16, length)); - headers.add(new ColumnHeader("hub.TWO_LINE_INSTRUCTION", 1, length)); - headers.add(new ColumnHeader("hub.TX_EXEC", 1, length)); - headers.add(new ColumnHeader("hub.TX_FINL", 1, length)); - headers.add(new ColumnHeader("hub.TX_INIT", 1, length)); - headers.add(new ColumnHeader("hub.TX_SKIP", 1, length)); - headers.add(new ColumnHeader("hub.TX_WARM", 1, length)); - headers.add(new ColumnHeader("hub.TXN_FLAG", 1, length)); - headers.add(new ColumnHeader("hub.WARMTH_NEW_xor_PRC_ECADD_xor_LOG_INFO_FLAG", 1, length)); - headers.add(new ColumnHeader("hub.WARMTH_xor_PRC_BLAKE2f_xor_LOG_FLAG", 1, length)); - headers.add(new ColumnHeader("hub.WCP_FLAG", 1, length)); - return headers; - } - - public Trace (List buffers) { + List headers = new ArrayList<>(); + headers.add(new ColumnHeader("hub.ABSOLUTE_TRANSACTION_NUMBER", 2, length)); + headers.add( + new ColumnHeader( + "hub.ADDRESS_HI_xor_ACCOUNT_ADDRESS_HI_xor_CCRS_STAMP_xor_PRC_CDO_xor_STATIC_GAS_xor_ADDRESS_HI_xor_CALL_DATA_SIZE", + 4, + length)); + headers.add( + new ColumnHeader( + "hub.ADDRESS_LO_xor_ACCOUNT_ADDRESS_LO_xor_EXP_DATA_1_xor_HASH_INFO_KECCAK_HI_xor_ADDRESS_LO_xor_COINBASE_ADDRESS_LO", + 16, + length)); + headers.add( + new ColumnHeader( + "hub.AGAIN_IN_BLK_xor_IS_ROOT_xor_CCSR_FLAG_xor_CALL_ABORT_WILL_REVERT_xor_ACC_FLAG_xor_AGAIN_IN_BLK_xor_COPY_TXCD", + 1, + length)); + headers.add( + new ColumnHeader( + "hub.AGAIN_IN_CNF_xor_IS_STATIC_xor_EXP_FLAG_xor_CALL_ABORT_WONT_REVERT_xor_ADD_FLAG_xor_AGAIN_IN_CNF_xor_IS_DEPLOYMENT", + 1, + length)); + headers.add( + new ColumnHeader( + "hub.AGAIN_IN_TXN_xor_UPDATE_xor_MMU_FLAG_xor_CALL_EOA_SUCCESS_CALLER_WILL_REVERT_xor_BIN_FLAG_xor_AGAIN_IN_TXN_xor_IS_TYPE2", + 1, + length)); + headers.add(new ColumnHeader("hub.ALPHA", 1, length)); + headers.add( + new ColumnHeader( + "hub.BALANCE_NEW_xor_CALLER_ADDRESS_LO_xor_EXP_DATA_3_xor_PUSH_VALUE_HI_xor_STORAGE_KEY_LO_xor_INITIAL_BALANCE", + 16, + length)); + headers.add( + new ColumnHeader( + "hub.BALANCE_xor_BYTE_CODE_ADDRESS_LO_xor_EXP_DATA_2_xor_HASH_INFO_KECCAK_LO_xor_STORAGE_KEY_HI_xor_FROM_ADDRESS_LO", + 16, + length)); + headers.add(new ColumnHeader("hub.CALL_DATA_OFFSET_xor_MMU_SIZE", 4, length)); + headers.add(new ColumnHeader("hub.CALL_DATA_SIZE_xor_MMU_SRC_ID", 4, length)); + headers.add(new ColumnHeader("hub.CALL_STACK_DEPTH_xor_STACK_ITEM_HEIGHT_1", 2, length)); + headers.add(new ColumnHeader("hub.CALLER_CONTEXT_NUMBER", 4, length)); + headers.add(new ColumnHeader("hub.CODE_FRAGMENT_INDEX", 4, length)); + headers.add( + new ColumnHeader( + "hub.CODE_FRAGMENT_INDEX_xor_ACCOUNT_DEPLOYMENT_NUMBER_xor_EXP_INST_xor_PRC_CDS_xor_DEPLOYMENT_NUMBER_xor_COINBASE_ADDRESS_HI", + 4, + length)); + headers.add( + new ColumnHeader( + "hub.CODE_HASH_HI_NEW_xor_EXP_DATA_5_xor_STACK_ITEM_VALUE_HI_1_xor_VALUE_CURR_LO_xor_VALUE", + 16, + length)); + headers.add( + new ColumnHeader( + "hub.CODE_HASH_HI_xor_CALL_VALUE_xor_EXP_DATA_4_xor_PUSH_VALUE_LO_xor_VALUE_CURR_HI_xor_TO_ADDRESS_LO", + 16, + length)); + headers.add( + new ColumnHeader( + "hub.CODE_HASH_LO_NEW_xor_MMU_LIMB_2_xor_STACK_ITEM_VALUE_HI_3_xor_VALUE_NEXT_LO", + 16, + length)); + headers.add( + new ColumnHeader( + "hub.CODE_HASH_LO_xor_MMU_LIMB_1_xor_STACK_ITEM_VALUE_HI_2_xor_VALUE_NEXT_HI", + 16, + length)); + headers.add( + new ColumnHeader( + "hub.CODE_SIZE_NEW_xor_BYTE_CODE_CODE_FRAGMENT_INDEX_xor_MMU_EXO_SUM_xor_PRC_RAO_xor_INIT_CODE_SIZE", + 4, + length)); + headers.add( + new ColumnHeader( + "hub.CODE_SIZE_xor_BYTE_CODE_ADDRESS_HI_xor_MMU_AUX_ID_xor_PRC_RAC_xor_DEPLOYMENT_NUMBER_INFTY_xor_FROM_ADDRESS_HI", + 4, + length)); + headers.add(new ColumnHeader("hub.CONTEXT_GETS_REVERTED", 1, length)); + headers.add(new ColumnHeader("hub.CONTEXT_MAY_CHANGE", 1, length)); + headers.add(new ColumnHeader("hub.CONTEXT_NUMBER", 4, length)); + headers.add(new ColumnHeader("hub.CONTEXT_NUMBER_NEW", 4, length)); + headers.add(new ColumnHeader("hub.CONTEXT_NUMBER_xor_MMU_TGT_ID", 4, length)); + headers.add(new ColumnHeader("hub.CONTEXT_REVERT_STAMP", 4, length)); + headers.add(new ColumnHeader("hub.CONTEXT_SELF_REVERTS", 1, length)); + headers.add(new ColumnHeader("hub.CONTEXT_WILL_REVERT", 1, length)); + headers.add(new ColumnHeader("hub.COUNTER_NSR", 1, length)); + headers.add(new ColumnHeader("hub.COUNTER_TLI", 1, length)); + headers.add(new ColumnHeader("hub.DELTA", 1, length)); + headers.add( + new ColumnHeader( + "hub.DEPLOYMENT_NUMBER_FINAL_IN_BLOCK_xor_DEPLOYMENT_NUMBER_FINAL_IN_BLOCK", + 2, + length)); + headers.add( + new ColumnHeader( + "hub.DEPLOYMENT_NUMBER_FIRST_IN_BLOCK_xor_DEPLOYMENT_NUMBER_FIRST_IN_BLOCK", + 2, + length)); + headers.add( + new ColumnHeader( + "hub.DEPLOYMENT_NUMBER_INFTY_xor_BYTE_CODE_DEPLOYMENT_STATUS_xor_MMU_PHASE", + 4, + length)); + headers.add( + new ColumnHeader( + "hub.DEPLOYMENT_NUMBER_NEW_xor_CALLER_ADDRESS_HI_xor_MMU_REF_OFFSET", 4, length)); + headers.add( + new ColumnHeader( + "hub.DEPLOYMENT_NUMBER_xor_BYTE_CODE_DEPLOYMENT_NUMBER_xor_MMU_INST_xor_TO_ADDRESS_HI", + 4, + length)); + headers.add( + new ColumnHeader( + "hub.DEPLOYMENT_STATUS_INFTY_xor_MXP_DEPLOYS_xor_CALL_EXCEPTION_xor_CALL_FLAG_xor_FINAL_IN_CNF_xor_STATUS_CODE", + 1, + length)); + headers.add( + new ColumnHeader( + "hub.DEPLOYMENT_STATUS_NEW_xor_MXP_FLAG_xor_CALL_PRC_FAILURE_xor_CON_FLAG_xor_FINAL_IN_TXN", + 1, + length)); + headers.add( + new ColumnHeader( + "hub.DEPLOYMENT_STATUS_xor_MMU_SUCCESS_BIT_xor_CALL_EOA_SUCCESS_CALLER_WONT_REVERT_xor_BTC_FLAG_xor_FINAL_IN_BLK_xor_REQUIRES_EVM_EXECUTION", + 1, + length)); + headers.add(new ColumnHeader("hub.DOM_STAMP", 4, length)); + headers.add(new ColumnHeader("hub.EXCEPTION_AHOY", 1, length)); + headers.add( + new ColumnHeader( + "hub.EXISTS_NEW_xor_MXP_MXPX_xor_CALL_PRC_SUCCESS_CALLER_WONT_REVERT_xor_CREATE_FLAG_xor_FIRST_IN_CNF", + 1, + length)); + headers.add( + new ColumnHeader( + "hub.EXISTS_xor_MXP_MTNTOP_xor_CALL_PRC_SUCCESS_CALLER_WILL_REVERT_xor_COPY_FLAG_xor_FIRST_IN_BLK", + 1, + length)); + headers.add( + new ColumnHeader( + "hub.FINAL_IN_BLK_xor_MXP_SIZE_1_NONZERO_NO_MXPX_xor_CALL_SMC_FAILURE_CALLER_WILL_REVERT_xor_DEC_FLAG_1_xor_FIRST_IN_TXN", + 1, + length)); + headers.add( + new ColumnHeader( + "hub.FINAL_IN_CNF_xor_MXP_SIZE_2_NONZERO_NO_MXPX_xor_CALL_SMC_FAILURE_CALLER_WONT_REVERT_xor_DEC_FLAG_2_xor_VALUE_CURR_CHANGES", + 1, + length)); + headers.add( + new ColumnHeader( + "hub.FINAL_IN_TXN_xor_OOB_FLAG_xor_CALL_SMC_SUCCESS_CALLER_WILL_REVERT_xor_DEC_FLAG_3_xor_VALUE_CURR_IS_ORIG", + 1, + length)); + headers.add( + new ColumnHeader( + "hub.FIRST_IN_BLK_xor_STP_EXISTS_xor_CALL_SMC_SUCCESS_CALLER_WONT_REVERT_xor_DEC_FLAG_4_xor_VALUE_CURR_IS_ZERO", + 1, + length)); + headers.add( + new ColumnHeader( + "hub.FIRST_IN_CNF_xor_STP_FLAG_xor_CREATE_ABORT_xor_DUP_FLAG_xor_VALUE_NEXT_IS_CURR", + 1, + length)); + headers.add( + new ColumnHeader( + "hub.FIRST_IN_TXN_xor_STP_OOGX_xor_CREATE_EMPTY_INIT_CODE_WILL_REVERT_xor_EXT_FLAG_xor_VALUE_NEXT_IS_ORIG", + 1, + length)); + headers.add(new ColumnHeader("hub.GAS_ACTUAL", 8, length)); + headers.add(new ColumnHeader("hub.GAS_COST", 8, length)); + headers.add(new ColumnHeader("hub.GAS_EXPECTED", 8, length)); + headers.add(new ColumnHeader("hub.GAS_LIMIT", 8, length)); + headers.add(new ColumnHeader("hub.GAS_NEXT", 8, length)); + headers.add(new ColumnHeader("hub.GAS_PRICE", 8, length)); + headers.add( + new ColumnHeader( + "hub.HAS_CODE_NEW_xor_CREATE_EXCEPTION_xor_HASH_INFO_FLAG_xor_VALUE_ORIG_IS_ZERO", + 1, + length)); + headers.add( + new ColumnHeader( + "hub.HAS_CODE_xor_STP_WARMTH_xor_CREATE_EMPTY_INIT_CODE_WONT_REVERT_xor_HALT_FLAG_xor_VALUE_NEXT_IS_ZERO", + 1, + length)); + headers.add(new ColumnHeader("hub.HEIGHT", 2, length)); + headers.add(new ColumnHeader("hub.HEIGHT_NEW", 2, length)); + headers.add(new ColumnHeader("hub.HUB_STAMP", 4, length)); + headers.add(new ColumnHeader("hub.HUB_STAMP_TRANSACTION_END", 4, length)); + headers.add(new ColumnHeader("hub.INSTRUCTION", 32, length)); + headers.add( + new ColumnHeader( + "hub.IS_PRECOMPILE_xor_CREATE_FAILURE_CONDITION_WILL_REVERT_xor_ICPX_xor_WARMTH", + 1, + length)); + headers.add(new ColumnHeader("hub.LOG_INFO_STAMP", 4, length)); + headers.add( + new ColumnHeader( + "hub.MARKED_FOR_SELFDESTRUCT_NEW_xor_CREATE_NONEMPTY_INIT_CODE_FAILURE_WILL_REVERT_xor_JUMPX", + 1, + length)); + headers.add( + new ColumnHeader( + "hub.MARKED_FOR_SELFDESTRUCT_xor_CREATE_FAILURE_CONDITION_WONT_REVERT_xor_INVALID_FLAG_xor_WARMTH_NEW", + 1, + length)); + headers.add(new ColumnHeader("hub.MMU_STAMP", 4, length)); + headers.add(new ColumnHeader("hub.MXP_OFFSET_2_HI", 16, length)); + headers.add(new ColumnHeader("hub.MXP_OFFSET_2_LO", 16, length)); + headers.add(new ColumnHeader("hub.MXP_SIZE_1_HI", 16, length)); + headers.add(new ColumnHeader("hub.MXP_SIZE_1_LO", 16, length)); + headers.add(new ColumnHeader("hub.MXP_SIZE_2_HI", 16, length)); + headers.add(new ColumnHeader("hub.MXP_SIZE_2_LO", 16, length)); + headers.add(new ColumnHeader("hub.MXP_STAMP", 4, length)); + headers.add(new ColumnHeader("hub.MXP_WORDS", 16, length)); + headers.add(new ColumnHeader("hub.NON_STACK_ROWS", 1, length)); + headers.add(new ColumnHeader("hub.NONCE", 8, length)); + headers.add( + new ColumnHeader( + "hub.NONCE_NEW_xor_STP_GAS_PAID_OUT_OF_POCKET_xor_PRC_CALLER_GAS_xor_GAS_INITIALLY_AVAILABLE", + 8, + length)); + headers.add( + new ColumnHeader("hub.NONCE_xor_STP_GAS_MXP_xor_PRC_CALLEE_GAS_xor_BASEFEE", 8, length)); + headers.add(new ColumnHeader("hub.OOB_DATA_1", 16, length)); + headers.add(new ColumnHeader("hub.OOB_DATA_2", 16, length)); + headers.add(new ColumnHeader("hub.OOB_DATA_3", 16, length)); + headers.add(new ColumnHeader("hub.OOB_DATA_4", 16, length)); + headers.add(new ColumnHeader("hub.OOB_DATA_5", 16, length)); + headers.add(new ColumnHeader("hub.OOB_DATA_6", 16, length)); + headers.add(new ColumnHeader("hub.OOB_DATA_7", 16, length)); + headers.add(new ColumnHeader("hub.OOB_DATA_8", 16, length)); + headers.add(new ColumnHeader("hub.OOB_DATA_9", 16, length)); + headers.add(new ColumnHeader("hub.PEEK_AT_ACCOUNT", 1, length)); + headers.add(new ColumnHeader("hub.PEEK_AT_CONTEXT", 1, length)); + headers.add(new ColumnHeader("hub.PEEK_AT_MISCELLANEOUS", 1, length)); + headers.add(new ColumnHeader("hub.PEEK_AT_SCENARIO", 1, length)); + headers.add(new ColumnHeader("hub.PEEK_AT_STACK", 1, length)); + headers.add(new ColumnHeader("hub.PEEK_AT_STORAGE", 1, length)); + headers.add(new ColumnHeader("hub.PEEK_AT_TRANSACTION", 1, length)); + headers.add(new ColumnHeader("hub.PRC_ECMUL_xor_MACHINE_STATE_FLAG", 1, length)); + headers.add(new ColumnHeader("hub.PRC_ECPAIRING_xor_MAXCSX", 1, length)); + headers.add(new ColumnHeader("hub.PRC_ECRECOVER_xor_MOD_FLAG", 1, length)); + headers.add(new ColumnHeader("hub.PRC_FAILURE_KNOWN_TO_HUB_xor_MUL_FLAG", 1, length)); + headers.add(new ColumnHeader("hub.PRC_FAILURE_KNOWN_TO_RAM_xor_MXPX", 1, length)); + headers.add(new ColumnHeader("hub.PRC_IDENTITY_xor_MXP_FLAG", 1, length)); + headers.add(new ColumnHeader("hub.PRC_MODEXP_xor_OOGX", 1, length)); + headers.add(new ColumnHeader("hub.PRC_RIPEMD-160_xor_OPCX", 1, length)); + headers.add(new ColumnHeader("hub.PRC_SHA2-256_xor_PUSHPOP_FLAG", 1, length)); + headers.add(new ColumnHeader("hub.PRC_SUCCESS_CALLER_WILL_REVERT_xor_RDCX", 1, length)); + headers.add(new ColumnHeader("hub.PRC_SUCCESS_CALLER_WONT_REVERT_xor_SHF_FLAG", 1, length)); + headers.add(new ColumnHeader("hub.PRIORITY_FEE_PER_GAS", 8, length)); + headers.add(new ColumnHeader("hub.PROGRAM_COUNTER", 4, length)); + headers.add(new ColumnHeader("hub.PROGRAM_COUNTER_NEW", 4, length)); + headers.add(new ColumnHeader("hub.REFUND_COUNTER", 4, length)); + headers.add(new ColumnHeader("hub.REFUND_COUNTER_INFINITY", 8, length)); + headers.add(new ColumnHeader("hub.REFUND_COUNTER_NEW", 4, length)); + headers.add(new ColumnHeader("hub.REFUND_EFFECTIVE", 8, length)); + headers.add(new ColumnHeader("hub.RELATIVE_BLOCK_NUMBER", 2, length)); + headers.add(new ColumnHeader("hub.RETURN_AT_CAPACITY_xor_MXP_INST", 4, length)); + headers.add(new ColumnHeader("hub.RETURN_AT_OFFSET_xor_OOB_INST", 4, length)); + headers.add(new ColumnHeader("hub.RETURN_DATA_CONTEXT_NUMBER_xor_STP_GAS_STIPEND", 4, length)); + headers.add(new ColumnHeader("hub.RETURN_DATA_OFFSET_xor_STP_INSTRUCTION", 4, length)); + headers.add(new ColumnHeader("hub.RETURN_DATA_SIZE", 4, length)); + headers.add(new ColumnHeader("hub.RETURN_EXCEPTION_xor_SOX", 1, length)); + headers.add( + new ColumnHeader( + "hub.RETURN_FROM_DEPLOYMENT_EMPTY_CODE_WILL_REVERT_xor_SSTOREX", 1, length)); + headers.add( + new ColumnHeader( + "hub.RETURN_FROM_DEPLOYMENT_EMPTY_CODE_WONT_REVERT_xor_STACKRAM_FLAG", 1, length)); + headers.add( + new ColumnHeader( + "hub.RETURN_FROM_DEPLOYMENT_NONEMPTY_CODE_WILL_REVERT_xor_STACK_ITEM_POP_1", + 1, + length)); + headers.add( + new ColumnHeader( + "hub.RETURN_FROM_DEPLOYMENT_NONEMPTY_CODE_WONT_REVERT_xor_STACK_ITEM_POP_2", + 1, + length)); + headers.add( + new ColumnHeader( + "hub.RETURN_FROM_MESSAGE_CALL_WILL_TOUCH_RAM_xor_STACK_ITEM_POP_3", 1, length)); + headers.add( + new ColumnHeader( + "hub.RETURN_FROM_MESSAGE_CALL_WONT_TOUCH_RAM_xor_STACK_ITEM_POP_4", 1, length)); + headers.add( + new ColumnHeader( + "hub.RLPADDR_DEP_ADDR_HI_xor_CALL_DATA_CONTEXT_NUMBER_xor_MMU_REF_SIZE", 4, length)); + headers.add( + new ColumnHeader( + "hub.RLPADDR_DEP_ADDR_LO_xor_MMU_SRC_OFFSET_HI_xor_STACK_ITEM_VALUE_HI_4_xor_VALUE_ORIG_HI", + 16, + length)); + headers.add( + new ColumnHeader( + "hub.RLPADDR_FLAG_xor_CREATE_NONEMPTY_INIT_CODE_FAILURE_WONT_REVERT_xor_JUMP_DESTINATION_VETTING_REQUIRED", + 1, + length)); + headers.add( + new ColumnHeader( + "hub.RLPADDR_KEC_HI_xor_MMU_SRC_OFFSET_LO_xor_STACK_ITEM_VALUE_LO_1_xor_VALUE_ORIG_LO", + 16, + length)); + headers.add( + new ColumnHeader( + "hub.RLPADDR_KEC_LO_xor_MMU_TGT_OFFSET_LO_xor_STACK_ITEM_VALUE_LO_2", 16, length)); + headers.add(new ColumnHeader("hub.RLPADDR_RECIPE", 1, length)); + headers.add( + new ColumnHeader( + "hub.RLPADDR_SALT_HI_xor_MXP_GAS_MXP_xor_STACK_ITEM_VALUE_LO_3", 16, length)); + headers.add( + new ColumnHeader( + "hub.RLPADDR_SALT_LO_xor_MXP_OFFSET_1_HI_xor_STACK_ITEM_VALUE_LO_4", 16, length)); + headers.add( + new ColumnHeader( + "hub.ROMLEX_FLAG_xor_CREATE_NONEMPTY_INIT_CODE_SUCCESS_WILL_REVERT_xor_JUMP_FLAG", + 1, + length)); + headers.add(new ColumnHeader("hub.SELFDESTRUCT_EXCEPTION_xor_STATICX", 1, length)); + headers.add(new ColumnHeader("hub.SELFDESTRUCT_WILL_REVERT_xor_STATIC_FLAG", 1, length)); + headers.add( + new ColumnHeader("hub.SELFDESTRUCT_WONT_REVERT_ALREADY_MARKED_xor_STO_FLAG", 1, length)); + headers.add(new ColumnHeader("hub.SELFDESTRUCT_WONT_REVERT_NOT_YET_MARKED_xor_SUX", 1, length)); + headers.add(new ColumnHeader("hub.STACK_ITEM_HEIGHT_2", 2, length)); + headers.add(new ColumnHeader("hub.STACK_ITEM_HEIGHT_3", 2, length)); + headers.add(new ColumnHeader("hub.STACK_ITEM_HEIGHT_4", 2, length)); + headers.add(new ColumnHeader("hub.STACK_ITEM_STAMP_1", 5, length)); + headers.add(new ColumnHeader("hub.STACK_ITEM_STAMP_2", 5, length)); + headers.add(new ColumnHeader("hub.STACK_ITEM_STAMP_3", 5, length)); + headers.add(new ColumnHeader("hub.STACK_ITEM_STAMP_4", 5, length)); + headers.add(new ColumnHeader("hub.STP_GAS_HI", 16, length)); + headers.add(new ColumnHeader("hub.STP_GAS_LO", 16, length)); + headers.add( + new ColumnHeader( + "hub.STP_GAS_UPFRONT_GAS_COST_xor_PRC_RETURN_GAS_xor_GAS_LEFTOVER", 8, length)); + headers.add(new ColumnHeader("hub.STP_VALUE_HI", 16, length)); + headers.add(new ColumnHeader("hub.STP_VALUE_LO", 16, length)); + headers.add(new ColumnHeader("hub.SUB_STAMP", 4, length)); + headers.add(new ColumnHeader("hub.SWAP_FLAG", 1, length)); + headers.add( + new ColumnHeader( + "hub.TRM_FLAG_xor_CREATE_NONEMPTY_INIT_CODE_SUCCESS_WONT_REVERT_xor_KEC_FLAG", + 1, + length)); + headers.add(new ColumnHeader("hub.TRM_RAW_ADDRESS_HI_xor_MXP_OFFSET_1_LO", 16, length)); + headers.add(new ColumnHeader("hub.TWO_LINE_INSTRUCTION", 1, length)); + headers.add(new ColumnHeader("hub.TX_EXEC", 1, length)); + headers.add(new ColumnHeader("hub.TX_FINL", 1, length)); + headers.add(new ColumnHeader("hub.TX_INIT", 1, length)); + headers.add(new ColumnHeader("hub.TX_SKIP", 1, length)); + headers.add(new ColumnHeader("hub.TX_WARM", 1, length)); + headers.add(new ColumnHeader("hub.TXN_FLAG", 1, length)); + headers.add(new ColumnHeader("hub.WARMTH_NEW_xor_PRC_ECADD_xor_LOG_INFO_FLAG", 1, length)); + headers.add(new ColumnHeader("hub.WARMTH_xor_PRC_BLAKE2f_xor_LOG_FLAG", 1, length)); + headers.add(new ColumnHeader("hub.WCP_FLAG", 1, length)); + return headers; + } + + public Trace(List buffers) { this.absoluteTransactionNumber = buffers.get(0); - this.addressHiXorAccountAddressHiXorCcrsStampXorPrcCdoXorStaticGasXorAddressHiXorCallDataSize = buffers.get(1); - this.addressLoXorAccountAddressLoXorExpData1XorHashInfoKeccakHiXorAddressLoXorCoinbaseAddressLo = buffers.get(2); - this.againInBlkXorIsRootXorCcsrFlagXorCallAbortWillRevertXorAccFlagXorAgainInBlkXorCopyTxcd = buffers.get(3); - this.againInCnfXorIsStaticXorExpFlagXorCallAbortWontRevertXorAddFlagXorAgainInCnfXorIsDeployment = buffers.get(4); - this.againInTxnXorUpdateXorMmuFlagXorCallEoaSuccessCallerWillRevertXorBinFlagXorAgainInTxnXorIsType2 = buffers.get(5); + this.addressHiXorAccountAddressHiXorCcrsStampXorPrcCdoXorStaticGasXorAddressHiXorCallDataSize = + buffers.get(1); + this + .addressLoXorAccountAddressLoXorExpData1XorHashInfoKeccakHiXorAddressLoXorCoinbaseAddressLo = + buffers.get(2); + this.againInBlkXorIsRootXorCcsrFlagXorCallAbortWillRevertXorAccFlagXorAgainInBlkXorCopyTxcd = + buffers.get(3); + this + .againInCnfXorIsStaticXorExpFlagXorCallAbortWontRevertXorAddFlagXorAgainInCnfXorIsDeployment = + buffers.get(4); + this + .againInTxnXorUpdateXorMmuFlagXorCallEoaSuccessCallerWillRevertXorBinFlagXorAgainInTxnXorIsType2 = + buffers.get(5); this.alpha = buffers.get(6); - this.balanceNewXorCallerAddressLoXorExpData3XorPushValueHiXorStorageKeyLoXorInitialBalance = buffers.get(7); - this.balanceXorByteCodeAddressLoXorExpData2XorHashInfoKeccakLoXorStorageKeyHiXorFromAddressLo = buffers.get(8); + this.balanceNewXorCallerAddressLoXorExpData3XorPushValueHiXorStorageKeyLoXorInitialBalance = + buffers.get(7); + this.balanceXorByteCodeAddressLoXorExpData2XorHashInfoKeccakLoXorStorageKeyHiXorFromAddressLo = + buffers.get(8); this.callDataOffsetXorMmuSize = buffers.get(9); this.callDataSizeXorMmuSrcId = buffers.get(10); this.callStackDepthXorStackItemHeight1 = buffers.get(11); this.callerContextNumber = buffers.get(12); this.codeFragmentIndex = buffers.get(13); - this.codeFragmentIndexXorAccountDeploymentNumberXorExpInstXorPrcCdsXorDeploymentNumberXorCoinbaseAddressHi = buffers.get(14); + this + .codeFragmentIndexXorAccountDeploymentNumberXorExpInstXorPrcCdsXorDeploymentNumberXorCoinbaseAddressHi = + buffers.get(14); this.codeHashHiNewXorExpData5XorStackItemValueHi1XorValueCurrLoXorValue = buffers.get(15); - this.codeHashHiXorCallValueXorExpData4XorPushValueLoXorValueCurrHiXorToAddressLo = buffers.get(16); + this.codeHashHiXorCallValueXorExpData4XorPushValueLoXorValueCurrHiXorToAddressLo = + buffers.get(16); this.codeHashLoNewXorMmuLimb2XorStackItemValueHi3XorValueNextLo = buffers.get(17); this.codeHashLoXorMmuLimb1XorStackItemValueHi2XorValueNextHi = buffers.get(18); - this.codeSizeNewXorByteCodeCodeFragmentIndexXorMmuExoSumXorPrcRaoXorInitCodeSize = buffers.get(19); - this.codeSizeXorByteCodeAddressHiXorMmuAuxIdXorPrcRacXorDeploymentNumberInftyXorFromAddressHi = buffers.get(20); + this.codeSizeNewXorByteCodeCodeFragmentIndexXorMmuExoSumXorPrcRaoXorInitCodeSize = + buffers.get(19); + this.codeSizeXorByteCodeAddressHiXorMmuAuxIdXorPrcRacXorDeploymentNumberInftyXorFromAddressHi = + buffers.get(20); this.contextGetsReverted = buffers.get(21); this.contextMayChange = buffers.get(22); this.contextNumber = buffers.get(23); @@ -416,19 +648,31 @@ public Trace (List buffers) { this.deploymentNumberInftyXorByteCodeDeploymentStatusXorMmuPhase = buffers.get(34); this.deploymentNumberNewXorCallerAddressHiXorMmuRefOffset = buffers.get(35); this.deploymentNumberXorByteCodeDeploymentNumberXorMmuInstXorToAddressHi = buffers.get(36); - this.deploymentStatusInftyXorMxpDeploysXorCallExceptionXorCallFlagXorFinalInCnfXorStatusCode = buffers.get(37); + this.deploymentStatusInftyXorMxpDeploysXorCallExceptionXorCallFlagXorFinalInCnfXorStatusCode = + buffers.get(37); this.deploymentStatusNewXorMxpFlagXorCallPrcFailureXorConFlagXorFinalInTxn = buffers.get(38); - this.deploymentStatusXorMmuSuccessBitXorCallEoaSuccessCallerWontRevertXorBtcFlagXorFinalInBlkXorRequiresEvmExecution = buffers.get(39); + this + .deploymentStatusXorMmuSuccessBitXorCallEoaSuccessCallerWontRevertXorBtcFlagXorFinalInBlkXorRequiresEvmExecution = + buffers.get(39); this.domStamp = buffers.get(40); this.exceptionAhoy = buffers.get(41); - this.existsNewXorMxpMxpxXorCallPrcSuccessCallerWontRevertXorCreateFlagXorFirstInCnf = buffers.get(42); - this.existsXorMxpMtntopXorCallPrcSuccessCallerWillRevertXorCopyFlagXorFirstInBlk = buffers.get(43); - this.finalInBlkXorMxpSize1NonzeroNoMxpxXorCallSmcFailureCallerWillRevertXorDecFlag1XorFirstInTxn = buffers.get(44); - this.finalInCnfXorMxpSize2NonzeroNoMxpxXorCallSmcFailureCallerWontRevertXorDecFlag2XorValueCurrChanges = buffers.get(45); - this.finalInTxnXorOobFlagXorCallSmcSuccessCallerWillRevertXorDecFlag3XorValueCurrIsOrig = buffers.get(46); - this.firstInBlkXorStpExistsXorCallSmcSuccessCallerWontRevertXorDecFlag4XorValueCurrIsZero = buffers.get(47); + this.existsNewXorMxpMxpxXorCallPrcSuccessCallerWontRevertXorCreateFlagXorFirstInCnf = + buffers.get(42); + this.existsXorMxpMtntopXorCallPrcSuccessCallerWillRevertXorCopyFlagXorFirstInBlk = + buffers.get(43); + this + .finalInBlkXorMxpSize1NonzeroNoMxpxXorCallSmcFailureCallerWillRevertXorDecFlag1XorFirstInTxn = + buffers.get(44); + this + .finalInCnfXorMxpSize2NonzeroNoMxpxXorCallSmcFailureCallerWontRevertXorDecFlag2XorValueCurrChanges = + buffers.get(45); + this.finalInTxnXorOobFlagXorCallSmcSuccessCallerWillRevertXorDecFlag3XorValueCurrIsOrig = + buffers.get(46); + this.firstInBlkXorStpExistsXorCallSmcSuccessCallerWontRevertXorDecFlag4XorValueCurrIsZero = + buffers.get(47); this.firstInCnfXorStpFlagXorCreateAbortXorDupFlagXorValueNextIsCurr = buffers.get(48); - this.firstInTxnXorStpOogxXorCreateEmptyInitCodeWillRevertXorExtFlagXorValueNextIsOrig = buffers.get(49); + this.firstInTxnXorStpOogxXorCreateEmptyInitCodeWillRevertXorExtFlagXorValueNextIsOrig = + buffers.get(49); this.gasActual = buffers.get(50); this.gasCost = buffers.get(51); this.gasExpected = buffers.get(52); @@ -436,7 +680,8 @@ public Trace (List buffers) { this.gasNext = buffers.get(54); this.gasPrice = buffers.get(55); this.hasCodeNewXorCreateExceptionXorHashInfoFlagXorValueOrigIsZero = buffers.get(56); - this.hasCodeXorStpWarmthXorCreateEmptyInitCodeWontRevertXorHaltFlagXorValueNextIsZero = buffers.get(57); + this.hasCodeXorStpWarmthXorCreateEmptyInitCodeWontRevertXorHaltFlagXorValueNextIsZero = + buffers.get(57); this.height = buffers.get(58); this.heightNew = buffers.get(59); this.hubStamp = buffers.get(60); @@ -444,8 +689,10 @@ public Trace (List buffers) { this.instruction = buffers.get(62); this.isPrecompileXorCreateFailureConditionWillRevertXorIcpxXorWarmth = buffers.get(63); this.logInfoStamp = buffers.get(64); - this.markedForSelfdestructNewXorCreateNonemptyInitCodeFailureWillRevertXorJumpx = buffers.get(65); - this.markedForSelfdestructXorCreateFailureConditionWontRevertXorInvalidFlagXorWarmthNew = buffers.get(66); + this.markedForSelfdestructNewXorCreateNonemptyInitCodeFailureWillRevertXorJumpx = + buffers.get(65); + this.markedForSelfdestructXorCreateFailureConditionWontRevertXorInvalidFlagXorWarmthNew = + buffers.get(66); this.mmuStamp = buffers.get(67); this.mxpOffset2Hi = buffers.get(68); this.mxpOffset2Lo = buffers.get(69); @@ -508,7 +755,8 @@ public Trace (List buffers) { this.returnFromMessageCallWontTouchRamXorStackItemPop4 = buffers.get(126); this.rlpaddrDepAddrHiXorCallDataContextNumberXorMmuRefSize = buffers.get(127); this.rlpaddrDepAddrLoXorMmuSrcOffsetHiXorStackItemValueHi4XorValueOrigHi = buffers.get(128); - this.rlpaddrFlagXorCreateNonemptyInitCodeFailureWontRevertXorJumpDestinationVettingRequired = buffers.get(129); + this.rlpaddrFlagXorCreateNonemptyInitCodeFailureWontRevertXorJumpDestinationVettingRequired = + buffers.get(129); this.rlpaddrKecHiXorMmuSrcOffsetLoXorStackItemValueLo1XorValueOrigLo = buffers.get(130); this.rlpaddrKecLoXorMmuTgtOffsetLoXorStackItemValueLo2 = buffers.get(131); this.rlpaddrRecipe = buffers.get(132); @@ -562,11 +810,13 @@ public Trace absoluteTransactionNumber(final long b) { filled.set(0); } - if(b >= 65536L) { throw new IllegalArgumentException("hub.ABSOLUTE_TRANSACTION_NUMBER has invalid value (" + b + ")"); } + if (b >= 65536L) { + throw new IllegalArgumentException( + "hub.ABSOLUTE_TRANSACTION_NUMBER has invalid value (" + b + ")"); + } absoluteTransactionNumber.put((byte) (b >> 8)); absoluteTransactionNumber.put((byte) b); - return this; } @@ -577,13 +827,14 @@ public Trace callerContextNumber(final long b) { filled.set(1); } - if(b >= 4294967296L) { throw new IllegalArgumentException("hub.CALLER_CONTEXT_NUMBER has invalid value (" + b + ")"); } + if (b >= 4294967296L) { + throw new IllegalArgumentException("hub.CALLER_CONTEXT_NUMBER has invalid value (" + b + ")"); + } callerContextNumber.put((byte) (b >> 24)); callerContextNumber.put((byte) (b >> 16)); callerContextNumber.put((byte) (b >> 8)); callerContextNumber.put((byte) b); - return this; } @@ -594,13 +845,14 @@ public Trace codeFragmentIndex(final long b) { filled.set(2); } - if(b >= 4294967296L) { throw new IllegalArgumentException("hub.CODE_FRAGMENT_INDEX has invalid value (" + b + ")"); } + if (b >= 4294967296L) { + throw new IllegalArgumentException("hub.CODE_FRAGMENT_INDEX has invalid value (" + b + ")"); + } codeFragmentIndex.put((byte) (b >> 24)); codeFragmentIndex.put((byte) (b >> 16)); codeFragmentIndex.put((byte) (b >> 8)); codeFragmentIndex.put((byte) b); - return this; } @@ -635,13 +887,14 @@ public Trace contextNumber(final long b) { filled.set(5); } - if(b >= 4294967296L) { throw new IllegalArgumentException("hub.CONTEXT_NUMBER has invalid value (" + b + ")"); } + if (b >= 4294967296L) { + throw new IllegalArgumentException("hub.CONTEXT_NUMBER has invalid value (" + b + ")"); + } contextNumber.put((byte) (b >> 24)); contextNumber.put((byte) (b >> 16)); contextNumber.put((byte) (b >> 8)); contextNumber.put((byte) b); - return this; } @@ -652,13 +905,14 @@ public Trace contextNumberNew(final long b) { filled.set(6); } - if(b >= 4294967296L) { throw new IllegalArgumentException("hub.CONTEXT_NUMBER_NEW has invalid value (" + b + ")"); } + if (b >= 4294967296L) { + throw new IllegalArgumentException("hub.CONTEXT_NUMBER_NEW has invalid value (" + b + ")"); + } contextNumberNew.put((byte) (b >> 24)); contextNumberNew.put((byte) (b >> 16)); contextNumberNew.put((byte) (b >> 8)); contextNumberNew.put((byte) b); - return this; } @@ -669,13 +923,14 @@ public Trace contextRevertStamp(final long b) { filled.set(7); } - if(b >= 4294967296L) { throw new IllegalArgumentException("hub.CONTEXT_REVERT_STAMP has invalid value (" + b + ")"); } + if (b >= 4294967296L) { + throw new IllegalArgumentException("hub.CONTEXT_REVERT_STAMP has invalid value (" + b + ")"); + } contextRevertStamp.put((byte) (b >> 24)); contextRevertStamp.put((byte) (b >> 16)); contextRevertStamp.put((byte) (b >> 8)); contextRevertStamp.put((byte) b); - return this; } @@ -710,10 +965,11 @@ public Trace counterNsr(final long b) { filled.set(10); } - if(b >= 256L) { throw new IllegalArgumentException("hub.COUNTER_NSR has invalid value (" + b + ")"); } + if (b >= 256L) { + throw new IllegalArgumentException("hub.COUNTER_NSR has invalid value (" + b + ")"); + } counterNsr.put((byte) b); - return this; } @@ -736,13 +992,14 @@ public Trace domStamp(final long b) { filled.set(12); } - if(b >= 4294967296L) { throw new IllegalArgumentException("hub.DOM_STAMP has invalid value (" + b + ")"); } + if (b >= 4294967296L) { + throw new IllegalArgumentException("hub.DOM_STAMP has invalid value (" + b + ")"); + } domStamp.put((byte) (b >> 24)); domStamp.put((byte) (b >> 16)); domStamp.put((byte) (b >> 8)); domStamp.put((byte) b); - return this; } @@ -768,11 +1025,18 @@ public Trace gasActual(final Bytes b) { // Trim array to size Bytes bs = b.trimLeadingZeros(); // Sanity check against expected width - if(bs.bitLength() > 64) { throw new IllegalArgumentException("hub.GAS_ACTUAL has invalid width (" + bs.bitLength() + "bits)"); } + if (bs.bitLength() > 64) { + throw new IllegalArgumentException( + "hub.GAS_ACTUAL has invalid width (" + bs.bitLength() + "bits)"); + } // Write padding (if necessary) - for(int i=bs.size(); i<8; i++) { gasActual.put((byte) 0); } + for (int i = bs.size(); i < 8; i++) { + gasActual.put((byte) 0); + } // Write bytes - for(int j=0; j 64) { throw new IllegalArgumentException("hub.GAS_COST has invalid width (" + bs.bitLength() + "bits)"); } + if (bs.bitLength() > 64) { + throw new IllegalArgumentException( + "hub.GAS_COST has invalid width (" + bs.bitLength() + "bits)"); + } // Write padding (if necessary) - for(int i=bs.size(); i<8; i++) { gasCost.put((byte) 0); } + for (int i = bs.size(); i < 8; i++) { + gasCost.put((byte) 0); + } // Write bytes - for(int j=0; j 64) { throw new IllegalArgumentException("hub.GAS_EXPECTED has invalid width (" + bs.bitLength() + "bits)"); } + if (bs.bitLength() > 64) { + throw new IllegalArgumentException( + "hub.GAS_EXPECTED has invalid width (" + bs.bitLength() + "bits)"); + } // Write padding (if necessary) - for(int i=bs.size(); i<8; i++) { gasExpected.put((byte) 0); } + for (int i = bs.size(); i < 8; i++) { + gasExpected.put((byte) 0); + } // Write bytes - for(int j=0; j 64) { throw new IllegalArgumentException("hub.GAS_NEXT has invalid width (" + bs.bitLength() + "bits)"); } + if (bs.bitLength() > 64) { + throw new IllegalArgumentException( + "hub.GAS_NEXT has invalid width (" + bs.bitLength() + "bits)"); + } // Write padding (if necessary) - for(int i=bs.size(); i<8; i++) { gasNext.put((byte) 0); } + for (int i = bs.size(); i < 8; i++) { + gasNext.put((byte) 0); + } // Write bytes - for(int j=0; j= 2048L) { throw new IllegalArgumentException("hub.HEIGHT has invalid value (" + b + ")"); } + if (b >= 2048L) { + throw new IllegalArgumentException("hub.HEIGHT has invalid value (" + b + ")"); + } height.put((byte) (b >> 8)); height.put((byte) b); - return this; } @@ -856,11 +1142,12 @@ public Trace heightNew(final long b) { filled.set(19); } - if(b >= 2048L) { throw new IllegalArgumentException("hub.HEIGHT_NEW has invalid value (" + b + ")"); } + if (b >= 2048L) { + throw new IllegalArgumentException("hub.HEIGHT_NEW has invalid value (" + b + ")"); + } heightNew.put((byte) (b >> 8)); heightNew.put((byte) b); - return this; } @@ -871,13 +1158,14 @@ public Trace hubStamp(final long b) { filled.set(20); } - if(b >= 4294967296L) { throw new IllegalArgumentException("hub.HUB_STAMP has invalid value (" + b + ")"); } + if (b >= 4294967296L) { + throw new IllegalArgumentException("hub.HUB_STAMP has invalid value (" + b + ")"); + } hubStamp.put((byte) (b >> 24)); hubStamp.put((byte) (b >> 16)); hubStamp.put((byte) (b >> 8)); hubStamp.put((byte) b); - return this; } @@ -888,13 +1176,15 @@ public Trace hubStampTransactionEnd(final long b) { filled.set(21); } - if(b >= 4294967296L) { throw new IllegalArgumentException("hub.HUB_STAMP_TRANSACTION_END has invalid value (" + b + ")"); } + if (b >= 4294967296L) { + throw new IllegalArgumentException( + "hub.HUB_STAMP_TRANSACTION_END has invalid value (" + b + ")"); + } hubStampTransactionEnd.put((byte) (b >> 24)); hubStampTransactionEnd.put((byte) (b >> 16)); hubStampTransactionEnd.put((byte) (b >> 8)); hubStampTransactionEnd.put((byte) b); - return this; } @@ -905,13 +1195,14 @@ public Trace logInfoStamp(final long b) { filled.set(22); } - if(b >= 4294967296L) { throw new IllegalArgumentException("hub.LOG_INFO_STAMP has invalid value (" + b + ")"); } + if (b >= 4294967296L) { + throw new IllegalArgumentException("hub.LOG_INFO_STAMP has invalid value (" + b + ")"); + } logInfoStamp.put((byte) (b >> 24)); logInfoStamp.put((byte) (b >> 16)); logInfoStamp.put((byte) (b >> 8)); logInfoStamp.put((byte) b); - return this; } @@ -922,13 +1213,14 @@ public Trace mmuStamp(final long b) { filled.set(23); } - if(b >= 4294967296L) { throw new IllegalArgumentException("hub.MMU_STAMP has invalid value (" + b + ")"); } + if (b >= 4294967296L) { + throw new IllegalArgumentException("hub.MMU_STAMP has invalid value (" + b + ")"); + } mmuStamp.put((byte) (b >> 24)); mmuStamp.put((byte) (b >> 16)); mmuStamp.put((byte) (b >> 8)); mmuStamp.put((byte) b); - return this; } @@ -939,13 +1231,14 @@ public Trace mxpStamp(final long b) { filled.set(24); } - if(b >= 4294967296L) { throw new IllegalArgumentException("hub.MXP_STAMP has invalid value (" + b + ")"); } + if (b >= 4294967296L) { + throw new IllegalArgumentException("hub.MXP_STAMP has invalid value (" + b + ")"); + } mxpStamp.put((byte) (b >> 24)); mxpStamp.put((byte) (b >> 16)); mxpStamp.put((byte) (b >> 8)); mxpStamp.put((byte) b); - return this; } @@ -956,10 +1249,11 @@ public Trace nonStackRows(final long b) { filled.set(25); } - if(b >= 256L) { throw new IllegalArgumentException("hub.NON_STACK_ROWS has invalid value (" + b + ")"); } + if (b >= 256L) { + throw new IllegalArgumentException("hub.NON_STACK_ROWS has invalid value (" + b + ")"); + } nonStackRows.put((byte) b); - return this; } @@ -970,12 +1264,17 @@ public Trace pAccountAddressHi(final long b) { filled.set(103); } - if(b >= 4294967296L) { throw new IllegalArgumentException("hub.account/ADDRESS_HI has invalid value (" + b + ")"); } - addressHiXorAccountAddressHiXorCcrsStampXorPrcCdoXorStaticGasXorAddressHiXorCallDataSize.put((byte) (b >> 24)); - addressHiXorAccountAddressHiXorCcrsStampXorPrcCdoXorStaticGasXorAddressHiXorCallDataSize.put((byte) (b >> 16)); - addressHiXorAccountAddressHiXorCcrsStampXorPrcCdoXorStaticGasXorAddressHiXorCallDataSize.put((byte) (b >> 8)); - addressHiXorAccountAddressHiXorCcrsStampXorPrcCdoXorStaticGasXorAddressHiXorCallDataSize.put((byte) b); - + if (b >= 4294967296L) { + throw new IllegalArgumentException("hub.account/ADDRESS_HI has invalid value (" + b + ")"); + } + addressHiXorAccountAddressHiXorCcrsStampXorPrcCdoXorStaticGasXorAddressHiXorCallDataSize.put( + (byte) (b >> 24)); + addressHiXorAccountAddressHiXorCcrsStampXorPrcCdoXorStaticGasXorAddressHiXorCallDataSize.put( + (byte) (b >> 16)); + addressHiXorAccountAddressHiXorCcrsStampXorPrcCdoXorStaticGasXorAddressHiXorCallDataSize.put( + (byte) (b >> 8)); + addressHiXorAccountAddressHiXorCcrsStampXorPrcCdoXorStaticGasXorAddressHiXorCallDataSize.put( + (byte) b); return this; } @@ -990,11 +1289,20 @@ public Trace pAccountAddressLo(final Bytes b) { // Trim array to size Bytes bs = b.trimLeadingZeros(); // Sanity check against expected width - if(bs.bitLength() > 128) { throw new IllegalArgumentException("hub.account/ADDRESS_LO has invalid width (" + bs.bitLength() + "bits)"); } + if (bs.bitLength() > 128) { + throw new IllegalArgumentException( + "hub.account/ADDRESS_LO has invalid width (" + bs.bitLength() + "bits)"); + } // Write padding (if necessary) - for(int i=bs.size(); i<16; i++) { addressLoXorAccountAddressLoXorExpData1XorHashInfoKeccakHiXorAddressLoXorCoinbaseAddressLo.put((byte) 0); } + for (int i = bs.size(); i < 16; i++) { + addressLoXorAccountAddressLoXorExpData1XorHashInfoKeccakHiXorAddressLoXorCoinbaseAddressLo + .put((byte) 0); + } // Write bytes - for(int j=0; j 128) { throw new IllegalArgumentException("hub.account/BALANCE has invalid width (" + bs.bitLength() + "bits)"); } + if (bs.bitLength() > 128) { + throw new IllegalArgumentException( + "hub.account/BALANCE has invalid width (" + bs.bitLength() + "bits)"); + } // Write padding (if necessary) - for(int i=bs.size(); i<16; i++) { balanceXorByteCodeAddressLoXorExpData2XorHashInfoKeccakLoXorStorageKeyHiXorFromAddressLo.put((byte) 0); } + for (int i = bs.size(); i < 16; i++) { + balanceXorByteCodeAddressLoXorExpData2XorHashInfoKeccakLoXorStorageKeyHiXorFromAddressLo.put( + (byte) 0); + } // Write bytes - for(int j=0; j 128) { throw new IllegalArgumentException("hub.account/BALANCE_NEW has invalid width (" + bs.bitLength() + "bits)"); } + if (bs.bitLength() > 128) { + throw new IllegalArgumentException( + "hub.account/BALANCE_NEW has invalid width (" + bs.bitLength() + "bits)"); + } // Write padding (if necessary) - for(int i=bs.size(); i<16; i++) { balanceNewXorCallerAddressLoXorExpData3XorPushValueHiXorStorageKeyLoXorInitialBalance.put((byte) 0); } + for (int i = bs.size(); i < 16; i++) { + balanceNewXorCallerAddressLoXorExpData3XorPushValueHiXorStorageKeyLoXorInitialBalance.put( + (byte) 0); + } // Write bytes - for(int j=0; j= 4294967296L) { throw new IllegalArgumentException("hub.account/CODE_FRAGMENT_INDEX has invalid value (" + b + ")"); } - codeFragmentIndexXorAccountDeploymentNumberXorExpInstXorPrcCdsXorDeploymentNumberXorCoinbaseAddressHi.put((byte) (b >> 24)); - codeFragmentIndexXorAccountDeploymentNumberXorExpInstXorPrcCdsXorDeploymentNumberXorCoinbaseAddressHi.put((byte) (b >> 16)); - codeFragmentIndexXorAccountDeploymentNumberXorExpInstXorPrcCdsXorDeploymentNumberXorCoinbaseAddressHi.put((byte) (b >> 8)); - codeFragmentIndexXorAccountDeploymentNumberXorExpInstXorPrcCdsXorDeploymentNumberXorCoinbaseAddressHi.put((byte) b); - + if (b >= 4294967296L) { + throw new IllegalArgumentException( + "hub.account/CODE_FRAGMENT_INDEX has invalid value (" + b + ")"); + } + codeFragmentIndexXorAccountDeploymentNumberXorExpInstXorPrcCdsXorDeploymentNumberXorCoinbaseAddressHi + .put((byte) (b >> 24)); + codeFragmentIndexXorAccountDeploymentNumberXorExpInstXorPrcCdsXorDeploymentNumberXorCoinbaseAddressHi + .put((byte) (b >> 16)); + codeFragmentIndexXorAccountDeploymentNumberXorExpInstXorPrcCdsXorDeploymentNumberXorCoinbaseAddressHi + .put((byte) (b >> 8)); + codeFragmentIndexXorAccountDeploymentNumberXorExpInstXorPrcCdsXorDeploymentNumberXorCoinbaseAddressHi + .put((byte) b); return this; } @@ -1100,11 +1435,18 @@ public Trace pAccountCodeHashHi(final Bytes b) { // Trim array to size Bytes bs = b.trimLeadingZeros(); // Sanity check against expected width - if(bs.bitLength() > 128) { throw new IllegalArgumentException("hub.account/CODE_HASH_HI has invalid width (" + bs.bitLength() + "bits)"); } + if (bs.bitLength() > 128) { + throw new IllegalArgumentException( + "hub.account/CODE_HASH_HI has invalid width (" + bs.bitLength() + "bits)"); + } // Write padding (if necessary) - for(int i=bs.size(); i<16; i++) { codeHashHiXorCallValueXorExpData4XorPushValueLoXorValueCurrHiXorToAddressLo.put((byte) 0); } + for (int i = bs.size(); i < 16; i++) { + codeHashHiXorCallValueXorExpData4XorPushValueLoXorValueCurrHiXorToAddressLo.put((byte) 0); + } // Write bytes - for(int j=0; j 128) { throw new IllegalArgumentException("hub.account/CODE_HASH_HI_NEW has invalid width (" + bs.bitLength() + "bits)"); } + if (bs.bitLength() > 128) { + throw new IllegalArgumentException( + "hub.account/CODE_HASH_HI_NEW has invalid width (" + bs.bitLength() + "bits)"); + } // Write padding (if necessary) - for(int i=bs.size(); i<16; i++) { codeHashHiNewXorExpData5XorStackItemValueHi1XorValueCurrLoXorValue.put((byte) 0); } + for (int i = bs.size(); i < 16; i++) { + codeHashHiNewXorExpData5XorStackItemValueHi1XorValueCurrLoXorValue.put((byte) 0); + } // Write bytes - for(int j=0; j 128) { throw new IllegalArgumentException("hub.account/CODE_HASH_LO has invalid width (" + bs.bitLength() + "bits)"); } + if (bs.bitLength() > 128) { + throw new IllegalArgumentException( + "hub.account/CODE_HASH_LO has invalid width (" + bs.bitLength() + "bits)"); + } // Write padding (if necessary) - for(int i=bs.size(); i<16; i++) { codeHashLoXorMmuLimb1XorStackItemValueHi2XorValueNextHi.put((byte) 0); } + for (int i = bs.size(); i < 16; i++) { + codeHashLoXorMmuLimb1XorStackItemValueHi2XorValueNextHi.put((byte) 0); + } // Write bytes - for(int j=0; j 128) { throw new IllegalArgumentException("hub.account/CODE_HASH_LO_NEW has invalid width (" + bs.bitLength() + "bits)"); } + if (bs.bitLength() > 128) { + throw new IllegalArgumentException( + "hub.account/CODE_HASH_LO_NEW has invalid width (" + bs.bitLength() + "bits)"); + } // Write padding (if necessary) - for(int i=bs.size(); i<16; i++) { codeHashLoNewXorMmuLimb2XorStackItemValueHi3XorValueNextLo.put((byte) 0); } + for (int i = bs.size(); i < 16; i++) { + codeHashLoNewXorMmuLimb2XorStackItemValueHi3XorValueNextLo.put((byte) 0); + } // Write bytes - for(int j=0; j= 4294967296L) { throw new IllegalArgumentException("hub.account/CODE_SIZE has invalid value (" + b + ")"); } - codeSizeXorByteCodeAddressHiXorMmuAuxIdXorPrcRacXorDeploymentNumberInftyXorFromAddressHi.put((byte) (b >> 24)); - codeSizeXorByteCodeAddressHiXorMmuAuxIdXorPrcRacXorDeploymentNumberInftyXorFromAddressHi.put((byte) (b >> 16)); - codeSizeXorByteCodeAddressHiXorMmuAuxIdXorPrcRacXorDeploymentNumberInftyXorFromAddressHi.put((byte) (b >> 8)); - codeSizeXorByteCodeAddressHiXorMmuAuxIdXorPrcRacXorDeploymentNumberInftyXorFromAddressHi.put((byte) b); - + if (b >= 4294967296L) { + throw new IllegalArgumentException("hub.account/CODE_SIZE has invalid value (" + b + ")"); + } + codeSizeXorByteCodeAddressHiXorMmuAuxIdXorPrcRacXorDeploymentNumberInftyXorFromAddressHi.put( + (byte) (b >> 24)); + codeSizeXorByteCodeAddressHiXorMmuAuxIdXorPrcRacXorDeploymentNumberInftyXorFromAddressHi.put( + (byte) (b >> 16)); + codeSizeXorByteCodeAddressHiXorMmuAuxIdXorPrcRacXorDeploymentNumberInftyXorFromAddressHi.put( + (byte) (b >> 8)); + codeSizeXorByteCodeAddressHiXorMmuAuxIdXorPrcRacXorDeploymentNumberInftyXorFromAddressHi.put( + (byte) b); return this; } @@ -1190,13 +1558,17 @@ public Trace pAccountCodeSizeNew(final long b) { filled.set(106); } - if(b >= 4294967296L) { throw new IllegalArgumentException("hub.account/CODE_SIZE_NEW has invalid value (" + b + ")"); } - codeSizeNewXorByteCodeCodeFragmentIndexXorMmuExoSumXorPrcRaoXorInitCodeSize.put((byte) (b >> 24)); - codeSizeNewXorByteCodeCodeFragmentIndexXorMmuExoSumXorPrcRaoXorInitCodeSize.put((byte) (b >> 16)); - codeSizeNewXorByteCodeCodeFragmentIndexXorMmuExoSumXorPrcRaoXorInitCodeSize.put((byte) (b >> 8)); + if (b >= 4294967296L) { + throw new IllegalArgumentException("hub.account/CODE_SIZE_NEW has invalid value (" + b + ")"); + } + codeSizeNewXorByteCodeCodeFragmentIndexXorMmuExoSumXorPrcRaoXorInitCodeSize.put( + (byte) (b >> 24)); + codeSizeNewXorByteCodeCodeFragmentIndexXorMmuExoSumXorPrcRaoXorInitCodeSize.put( + (byte) (b >> 16)); + codeSizeNewXorByteCodeCodeFragmentIndexXorMmuExoSumXorPrcRaoXorInitCodeSize.put( + (byte) (b >> 8)); codeSizeNewXorByteCodeCodeFragmentIndexXorMmuExoSumXorPrcRaoXorInitCodeSize.put((byte) b); - return this; } @@ -1207,13 +1579,15 @@ public Trace pAccountDeploymentNumber(final long b) { filled.set(107); } - if(b >= 4294967296L) { throw new IllegalArgumentException("hub.account/DEPLOYMENT_NUMBER has invalid value (" + b + ")"); } + if (b >= 4294967296L) { + throw new IllegalArgumentException( + "hub.account/DEPLOYMENT_NUMBER has invalid value (" + b + ")"); + } deploymentNumberXorByteCodeDeploymentNumberXorMmuInstXorToAddressHi.put((byte) (b >> 24)); deploymentNumberXorByteCodeDeploymentNumberXorMmuInstXorToAddressHi.put((byte) (b >> 16)); deploymentNumberXorByteCodeDeploymentNumberXorMmuInstXorToAddressHi.put((byte) (b >> 8)); deploymentNumberXorByteCodeDeploymentNumberXorMmuInstXorToAddressHi.put((byte) b); - return this; } @@ -1224,11 +1598,13 @@ public Trace pAccountDeploymentNumberFinalInBlock(final long b) { filled.set(101); } - if(b >= 65536L) { throw new IllegalArgumentException("hub.account/DEPLOYMENT_NUMBER_FINAL_IN_BLOCK has invalid value (" + b + ")"); } + if (b >= 65536L) { + throw new IllegalArgumentException( + "hub.account/DEPLOYMENT_NUMBER_FINAL_IN_BLOCK has invalid value (" + b + ")"); + } deploymentNumberFinalInBlockXorDeploymentNumberFinalInBlock.put((byte) (b >> 8)); deploymentNumberFinalInBlockXorDeploymentNumberFinalInBlock.put((byte) b); - return this; } @@ -1239,11 +1615,13 @@ public Trace pAccountDeploymentNumberFirstInBlock(final long b) { filled.set(102); } - if(b >= 65536L) { throw new IllegalArgumentException("hub.account/DEPLOYMENT_NUMBER_FIRST_IN_BLOCK has invalid value (" + b + ")"); } + if (b >= 65536L) { + throw new IllegalArgumentException( + "hub.account/DEPLOYMENT_NUMBER_FIRST_IN_BLOCK has invalid value (" + b + ")"); + } deploymentNumberFirstInBlockXorDeploymentNumberFirstInBlock.put((byte) (b >> 8)); deploymentNumberFirstInBlockXorDeploymentNumberFirstInBlock.put((byte) b); - return this; } @@ -1254,13 +1632,15 @@ public Trace pAccountDeploymentNumberInfty(final long b) { filled.set(108); } - if(b >= 4294967296L) { throw new IllegalArgumentException("hub.account/DEPLOYMENT_NUMBER_INFTY has invalid value (" + b + ")"); } + if (b >= 4294967296L) { + throw new IllegalArgumentException( + "hub.account/DEPLOYMENT_NUMBER_INFTY has invalid value (" + b + ")"); + } deploymentNumberInftyXorByteCodeDeploymentStatusXorMmuPhase.put((byte) (b >> 24)); deploymentNumberInftyXorByteCodeDeploymentStatusXorMmuPhase.put((byte) (b >> 16)); deploymentNumberInftyXorByteCodeDeploymentStatusXorMmuPhase.put((byte) (b >> 8)); deploymentNumberInftyXorByteCodeDeploymentStatusXorMmuPhase.put((byte) b); - return this; } @@ -1271,13 +1651,15 @@ public Trace pAccountDeploymentNumberNew(final long b) { filled.set(109); } - if(b >= 4294967296L) { throw new IllegalArgumentException("hub.account/DEPLOYMENT_NUMBER_NEW has invalid value (" + b + ")"); } + if (b >= 4294967296L) { + throw new IllegalArgumentException( + "hub.account/DEPLOYMENT_NUMBER_NEW has invalid value (" + b + ")"); + } deploymentNumberNewXorCallerAddressHiXorMmuRefOffset.put((byte) (b >> 24)); deploymentNumberNewXorCallerAddressHiXorMmuRefOffset.put((byte) (b >> 16)); deploymentNumberNewXorCallerAddressHiXorMmuRefOffset.put((byte) (b >> 8)); deploymentNumberNewXorCallerAddressHiXorMmuRefOffset.put((byte) b); - return this; } @@ -1288,7 +1670,8 @@ public Trace pAccountDeploymentStatus(final Boolean b) { filled.set(48); } - deploymentStatusXorMmuSuccessBitXorCallEoaSuccessCallerWontRevertXorBtcFlagXorFinalInBlkXorRequiresEvmExecution.put((byte) (b ? 1 : 0)); + deploymentStatusXorMmuSuccessBitXorCallEoaSuccessCallerWontRevertXorBtcFlagXorFinalInBlkXorRequiresEvmExecution + .put((byte) (b ? 1 : 0)); return this; } @@ -1300,7 +1683,8 @@ public Trace pAccountDeploymentStatusInfty(final Boolean b) { filled.set(49); } - deploymentStatusInftyXorMxpDeploysXorCallExceptionXorCallFlagXorFinalInCnfXorStatusCode.put((byte) (b ? 1 : 0)); + deploymentStatusInftyXorMxpDeploysXorCallExceptionXorCallFlagXorFinalInCnfXorStatusCode.put( + (byte) (b ? 1 : 0)); return this; } @@ -1324,7 +1708,8 @@ public Trace pAccountExists(final Boolean b) { filled.set(51); } - existsXorMxpMtntopXorCallPrcSuccessCallerWillRevertXorCopyFlagXorFirstInBlk.put((byte) (b ? 1 : 0)); + existsXorMxpMtntopXorCallPrcSuccessCallerWillRevertXorCopyFlagXorFirstInBlk.put( + (byte) (b ? 1 : 0)); return this; } @@ -1336,7 +1721,8 @@ public Trace pAccountExistsNew(final Boolean b) { filled.set(52); } - existsNewXorMxpMxpxXorCallPrcSuccessCallerWontRevertXorCreateFlagXorFirstInCnf.put((byte) (b ? 1 : 0)); + existsNewXorMxpMxpxXorCallPrcSuccessCallerWontRevertXorCreateFlagXorFirstInCnf.put( + (byte) (b ? 1 : 0)); return this; } @@ -1348,7 +1734,8 @@ public Trace pAccountFinalInBlk(final Boolean b) { filled.set(53); } - finalInBlkXorMxpSize1NonzeroNoMxpxXorCallSmcFailureCallerWillRevertXorDecFlag1XorFirstInTxn.put((byte) (b ? 1 : 0)); + finalInBlkXorMxpSize1NonzeroNoMxpxXorCallSmcFailureCallerWillRevertXorDecFlag1XorFirstInTxn.put( + (byte) (b ? 1 : 0)); return this; } @@ -1360,7 +1747,8 @@ public Trace pAccountFinalInCnf(final Boolean b) { filled.set(54); } - finalInCnfXorMxpSize2NonzeroNoMxpxXorCallSmcFailureCallerWontRevertXorDecFlag2XorValueCurrChanges.put((byte) (b ? 1 : 0)); + finalInCnfXorMxpSize2NonzeroNoMxpxXorCallSmcFailureCallerWontRevertXorDecFlag2XorValueCurrChanges + .put((byte) (b ? 1 : 0)); return this; } @@ -1372,7 +1760,8 @@ public Trace pAccountFinalInTxn(final Boolean b) { filled.set(55); } - finalInTxnXorOobFlagXorCallSmcSuccessCallerWillRevertXorDecFlag3XorValueCurrIsOrig.put((byte) (b ? 1 : 0)); + finalInTxnXorOobFlagXorCallSmcSuccessCallerWillRevertXorDecFlag3XorValueCurrIsOrig.put( + (byte) (b ? 1 : 0)); return this; } @@ -1384,7 +1773,8 @@ public Trace pAccountFirstInBlk(final Boolean b) { filled.set(56); } - firstInBlkXorStpExistsXorCallSmcSuccessCallerWontRevertXorDecFlag4XorValueCurrIsZero.put((byte) (b ? 1 : 0)); + firstInBlkXorStpExistsXorCallSmcSuccessCallerWontRevertXorDecFlag4XorValueCurrIsZero.put( + (byte) (b ? 1 : 0)); return this; } @@ -1408,7 +1798,8 @@ public Trace pAccountFirstInTxn(final Boolean b) { filled.set(58); } - firstInTxnXorStpOogxXorCreateEmptyInitCodeWillRevertXorExtFlagXorValueNextIsOrig.put((byte) (b ? 1 : 0)); + firstInTxnXorStpOogxXorCreateEmptyInitCodeWillRevertXorExtFlagXorValueNextIsOrig.put( + (byte) (b ? 1 : 0)); return this; } @@ -1420,7 +1811,8 @@ public Trace pAccountHasCode(final Boolean b) { filled.set(59); } - hasCodeXorStpWarmthXorCreateEmptyInitCodeWontRevertXorHaltFlagXorValueNextIsZero.put((byte) (b ? 1 : 0)); + hasCodeXorStpWarmthXorCreateEmptyInitCodeWontRevertXorHaltFlagXorValueNextIsZero.put( + (byte) (b ? 1 : 0)); return this; } @@ -1456,7 +1848,8 @@ public Trace pAccountMarkedForSelfdestruct(final Boolean b) { filled.set(62); } - markedForSelfdestructXorCreateFailureConditionWontRevertXorInvalidFlagXorWarmthNew.put((byte) (b ? 1 : 0)); + markedForSelfdestructXorCreateFailureConditionWontRevertXorInvalidFlagXorWarmthNew.put( + (byte) (b ? 1 : 0)); return this; } @@ -1468,7 +1861,8 @@ public Trace pAccountMarkedForSelfdestructNew(final Boolean b) { filled.set(63); } - markedForSelfdestructNewXorCreateNonemptyInitCodeFailureWillRevertXorJumpx.put((byte) (b ? 1 : 0)); + markedForSelfdestructNewXorCreateNonemptyInitCodeFailureWillRevertXorJumpx.put( + (byte) (b ? 1 : 0)); return this; } @@ -1483,11 +1877,18 @@ public Trace pAccountNonce(final Bytes b) { // Trim array to size Bytes bs = b.trimLeadingZeros(); // Sanity check against expected width - if(bs.bitLength() > 64) { throw new IllegalArgumentException("hub.account/NONCE has invalid width (" + bs.bitLength() + "bits)"); } + if (bs.bitLength() > 64) { + throw new IllegalArgumentException( + "hub.account/NONCE has invalid width (" + bs.bitLength() + "bits)"); + } // Write padding (if necessary) - for(int i=bs.size(); i<8; i++) { nonceXorStpGasMxpXorPrcCalleeGasXorBasefee.put((byte) 0); } + for (int i = bs.size(); i < 8; i++) { + nonceXorStpGasMxpXorPrcCalleeGasXorBasefee.put((byte) 0); + } // Write bytes - for(int j=0; j 64) { throw new IllegalArgumentException("hub.account/NONCE_NEW has invalid width (" + bs.bitLength() + "bits)"); } + if (bs.bitLength() > 64) { + throw new IllegalArgumentException( + "hub.account/NONCE_NEW has invalid width (" + bs.bitLength() + "bits)"); + } // Write padding (if necessary) - for(int i=bs.size(); i<8; i++) { nonceNewXorStpGasPaidOutOfPocketXorPrcCallerGasXorGasInitiallyAvailable.put((byte) 0); } + for (int i = bs.size(); i < 8; i++) { + nonceNewXorStpGasPaidOutOfPocketXorPrcCallerGasXorGasInitiallyAvailable.put((byte) 0); + } // Write bytes - for(int j=0; j= 4294967296L) { throw new IllegalArgumentException("hub.account/RLPADDR_DEP_ADDR_HI has invalid value (" + b + ")"); } + if (b >= 4294967296L) { + throw new IllegalArgumentException( + "hub.account/RLPADDR_DEP_ADDR_HI has invalid value (" + b + ")"); + } rlpaddrDepAddrHiXorCallDataContextNumberXorMmuRefSize.put((byte) (b >> 24)); rlpaddrDepAddrHiXorCallDataContextNumberXorMmuRefSize.put((byte) (b >> 16)); rlpaddrDepAddrHiXorCallDataContextNumberXorMmuRefSize.put((byte) (b >> 8)); rlpaddrDepAddrHiXorCallDataContextNumberXorMmuRefSize.put((byte) b); - return this; } @@ -1538,11 +1948,18 @@ public Trace pAccountRlpaddrDepAddrLo(final Bytes b) { // Trim array to size Bytes bs = b.trimLeadingZeros(); // Sanity check against expected width - if(bs.bitLength() > 128) { throw new IllegalArgumentException("hub.account/RLPADDR_DEP_ADDR_LO has invalid width (" + bs.bitLength() + "bits)"); } + if (bs.bitLength() > 128) { + throw new IllegalArgumentException( + "hub.account/RLPADDR_DEP_ADDR_LO has invalid width (" + bs.bitLength() + "bits)"); + } // Write padding (if necessary) - for(int i=bs.size(); i<16; i++) { rlpaddrDepAddrLoXorMmuSrcOffsetHiXorStackItemValueHi4XorValueOrigHi.put((byte) 0); } + for (int i = bs.size(); i < 16; i++) { + rlpaddrDepAddrLoXorMmuSrcOffsetHiXorStackItemValueHi4XorValueOrigHi.put((byte) 0); + } // Write bytes - for(int j=0; j 128) { throw new IllegalArgumentException("hub.account/RLPADDR_KEC_HI has invalid width (" + bs.bitLength() + "bits)"); } + if (bs.bitLength() > 128) { + throw new IllegalArgumentException( + "hub.account/RLPADDR_KEC_HI has invalid width (" + bs.bitLength() + "bits)"); + } // Write padding (if necessary) - for(int i=bs.size(); i<16; i++) { rlpaddrKecHiXorMmuSrcOffsetLoXorStackItemValueLo1XorValueOrigLo.put((byte) 0); } + for (int i = bs.size(); i < 16; i++) { + rlpaddrKecHiXorMmuSrcOffsetLoXorStackItemValueLo1XorValueOrigLo.put((byte) 0); + } // Write bytes - for(int j=0; j 128) { throw new IllegalArgumentException("hub.account/RLPADDR_KEC_LO has invalid width (" + bs.bitLength() + "bits)"); } + if (bs.bitLength() > 128) { + throw new IllegalArgumentException( + "hub.account/RLPADDR_KEC_LO has invalid width (" + bs.bitLength() + "bits)"); + } // Write padding (if necessary) - for(int i=bs.size(); i<16; i++) { rlpaddrKecLoXorMmuTgtOffsetLoXorStackItemValueLo2.put((byte) 0); } + for (int i = bs.size(); i < 16; i++) { + rlpaddrKecLoXorMmuTgtOffsetLoXorStackItemValueLo2.put((byte) 0); + } // Write bytes - for(int j=0; j= 256L) { throw new IllegalArgumentException("hub.account/RLPADDR_RECIPE has invalid value (" + b + ")"); } + if (b >= 256L) { + throw new IllegalArgumentException( + "hub.account/RLPADDR_RECIPE has invalid value (" + b + ")"); + } rlpaddrRecipe.put((byte) b); - return this; } @@ -1621,11 +2055,18 @@ public Trace pAccountRlpaddrSaltHi(final Bytes b) { // Trim array to size Bytes bs = b.trimLeadingZeros(); // Sanity check against expected width - if(bs.bitLength() > 128) { throw new IllegalArgumentException("hub.account/RLPADDR_SALT_HI has invalid width (" + bs.bitLength() + "bits)"); } + if (bs.bitLength() > 128) { + throw new IllegalArgumentException( + "hub.account/RLPADDR_SALT_HI has invalid width (" + bs.bitLength() + "bits)"); + } // Write padding (if necessary) - for(int i=bs.size(); i<16; i++) { rlpaddrSaltHiXorMxpGasMxpXorStackItemValueLo3.put((byte) 0); } + for (int i = bs.size(); i < 16; i++) { + rlpaddrSaltHiXorMxpGasMxpXorStackItemValueLo3.put((byte) 0); + } // Write bytes - for(int j=0; j 128) { throw new IllegalArgumentException("hub.account/RLPADDR_SALT_LO has invalid width (" + bs.bitLength() + "bits)"); } + if (bs.bitLength() > 128) { + throw new IllegalArgumentException( + "hub.account/RLPADDR_SALT_LO has invalid width (" + bs.bitLength() + "bits)"); + } // Write padding (if necessary) - for(int i=bs.size(); i<16; i++) { rlpaddrSaltLoXorMxpOffset1HiXorStackItemValueLo4.put((byte) 0); } + for (int i = bs.size(); i < 16; i++) { + rlpaddrSaltLoXorMxpOffset1HiXorStackItemValueLo4.put((byte) 0); + } // Write bytes - for(int j=0; j 128) { throw new IllegalArgumentException("hub.account/TRM_RAW_ADDRESS_HI has invalid width (" + bs.bitLength() + "bits)"); } + if (bs.bitLength() > 128) { + throw new IllegalArgumentException( + "hub.account/TRM_RAW_ADDRESS_HI has invalid width (" + bs.bitLength() + "bits)"); + } // Write padding (if necessary) - for(int i=bs.size(); i<16; i++) { trmRawAddressHiXorMxpOffset1Lo.put((byte) 0); } + for (int i = bs.size(); i < 16; i++) { + trmRawAddressHiXorMxpOffset1Lo.put((byte) 0); + } // Write bytes - for(int j=0; j= 4294967296L) { throw new IllegalArgumentException("hub.context/ACCOUNT_ADDRESS_HI has invalid value (" + b + ")"); } - addressHiXorAccountAddressHiXorCcrsStampXorPrcCdoXorStaticGasXorAddressHiXorCallDataSize.put((byte) (b >> 24)); - addressHiXorAccountAddressHiXorCcrsStampXorPrcCdoXorStaticGasXorAddressHiXorCallDataSize.put((byte) (b >> 16)); - addressHiXorAccountAddressHiXorCcrsStampXorPrcCdoXorStaticGasXorAddressHiXorCallDataSize.put((byte) (b >> 8)); - addressHiXorAccountAddressHiXorCcrsStampXorPrcCdoXorStaticGasXorAddressHiXorCallDataSize.put((byte) b); - + if (b >= 4294967296L) { + throw new IllegalArgumentException( + "hub.context/ACCOUNT_ADDRESS_HI has invalid value (" + b + ")"); + } + addressHiXorAccountAddressHiXorCcrsStampXorPrcCdoXorStaticGasXorAddressHiXorCallDataSize.put( + (byte) (b >> 24)); + addressHiXorAccountAddressHiXorCcrsStampXorPrcCdoXorStaticGasXorAddressHiXorCallDataSize.put( + (byte) (b >> 16)); + addressHiXorAccountAddressHiXorCcrsStampXorPrcCdoXorStaticGasXorAddressHiXorCallDataSize.put( + (byte) (b >> 8)); + addressHiXorAccountAddressHiXorCcrsStampXorPrcCdoXorStaticGasXorAddressHiXorCallDataSize.put( + (byte) b); return this; } @@ -1743,11 +2204,20 @@ public Trace pContextAccountAddressLo(final Bytes b) { // Trim array to size Bytes bs = b.trimLeadingZeros(); // Sanity check against expected width - if(bs.bitLength() > 128) { throw new IllegalArgumentException("hub.context/ACCOUNT_ADDRESS_LO has invalid width (" + bs.bitLength() + "bits)"); } + if (bs.bitLength() > 128) { + throw new IllegalArgumentException( + "hub.context/ACCOUNT_ADDRESS_LO has invalid width (" + bs.bitLength() + "bits)"); + } // Write padding (if necessary) - for(int i=bs.size(); i<16; i++) { addressLoXorAccountAddressLoXorExpData1XorHashInfoKeccakHiXorAddressLoXorCoinbaseAddressLo.put((byte) 0); } + for (int i = bs.size(); i < 16; i++) { + addressLoXorAccountAddressLoXorExpData1XorHashInfoKeccakHiXorAddressLoXorCoinbaseAddressLo + .put((byte) 0); + } // Write bytes - for(int j=0; j= 4294967296L) { throw new IllegalArgumentException("hub.context/ACCOUNT_DEPLOYMENT_NUMBER has invalid value (" + b + ")"); } - codeFragmentIndexXorAccountDeploymentNumberXorExpInstXorPrcCdsXorDeploymentNumberXorCoinbaseAddressHi.put((byte) (b >> 24)); - codeFragmentIndexXorAccountDeploymentNumberXorExpInstXorPrcCdsXorDeploymentNumberXorCoinbaseAddressHi.put((byte) (b >> 16)); - codeFragmentIndexXorAccountDeploymentNumberXorExpInstXorPrcCdsXorDeploymentNumberXorCoinbaseAddressHi.put((byte) (b >> 8)); - codeFragmentIndexXorAccountDeploymentNumberXorExpInstXorPrcCdsXorDeploymentNumberXorCoinbaseAddressHi.put((byte) b); - + if (b >= 4294967296L) { + throw new IllegalArgumentException( + "hub.context/ACCOUNT_DEPLOYMENT_NUMBER has invalid value (" + b + ")"); + } + codeFragmentIndexXorAccountDeploymentNumberXorExpInstXorPrcCdsXorDeploymentNumberXorCoinbaseAddressHi + .put((byte) (b >> 24)); + codeFragmentIndexXorAccountDeploymentNumberXorExpInstXorPrcCdsXorDeploymentNumberXorCoinbaseAddressHi + .put((byte) (b >> 16)); + codeFragmentIndexXorAccountDeploymentNumberXorExpInstXorPrcCdsXorDeploymentNumberXorCoinbaseAddressHi + .put((byte) (b >> 8)); + codeFragmentIndexXorAccountDeploymentNumberXorExpInstXorPrcCdsXorDeploymentNumberXorCoinbaseAddressHi + .put((byte) b); return this; } @@ -1776,12 +2252,18 @@ public Trace pContextByteCodeAddressHi(final long b) { filled.set(105); } - if(b >= 4294967296L) { throw new IllegalArgumentException("hub.context/BYTE_CODE_ADDRESS_HI has invalid value (" + b + ")"); } - codeSizeXorByteCodeAddressHiXorMmuAuxIdXorPrcRacXorDeploymentNumberInftyXorFromAddressHi.put((byte) (b >> 24)); - codeSizeXorByteCodeAddressHiXorMmuAuxIdXorPrcRacXorDeploymentNumberInftyXorFromAddressHi.put((byte) (b >> 16)); - codeSizeXorByteCodeAddressHiXorMmuAuxIdXorPrcRacXorDeploymentNumberInftyXorFromAddressHi.put((byte) (b >> 8)); - codeSizeXorByteCodeAddressHiXorMmuAuxIdXorPrcRacXorDeploymentNumberInftyXorFromAddressHi.put((byte) b); - + if (b >= 4294967296L) { + throw new IllegalArgumentException( + "hub.context/BYTE_CODE_ADDRESS_HI has invalid value (" + b + ")"); + } + codeSizeXorByteCodeAddressHiXorMmuAuxIdXorPrcRacXorDeploymentNumberInftyXorFromAddressHi.put( + (byte) (b >> 24)); + codeSizeXorByteCodeAddressHiXorMmuAuxIdXorPrcRacXorDeploymentNumberInftyXorFromAddressHi.put( + (byte) (b >> 16)); + codeSizeXorByteCodeAddressHiXorMmuAuxIdXorPrcRacXorDeploymentNumberInftyXorFromAddressHi.put( + (byte) (b >> 8)); + codeSizeXorByteCodeAddressHiXorMmuAuxIdXorPrcRacXorDeploymentNumberInftyXorFromAddressHi.put( + (byte) b); return this; } @@ -1796,11 +2278,20 @@ public Trace pContextByteCodeAddressLo(final Bytes b) { // Trim array to size Bytes bs = b.trimLeadingZeros(); // Sanity check against expected width - if(bs.bitLength() > 128) { throw new IllegalArgumentException("hub.context/BYTE_CODE_ADDRESS_LO has invalid width (" + bs.bitLength() + "bits)"); } + if (bs.bitLength() > 128) { + throw new IllegalArgumentException( + "hub.context/BYTE_CODE_ADDRESS_LO has invalid width (" + bs.bitLength() + "bits)"); + } // Write padding (if necessary) - for(int i=bs.size(); i<16; i++) { balanceXorByteCodeAddressLoXorExpData2XorHashInfoKeccakLoXorStorageKeyHiXorFromAddressLo.put((byte) 0); } + for (int i = bs.size(); i < 16; i++) { + balanceXorByteCodeAddressLoXorExpData2XorHashInfoKeccakLoXorStorageKeyHiXorFromAddressLo.put( + (byte) 0); + } // Write bytes - for(int j=0; j= 4294967296L) { throw new IllegalArgumentException("hub.context/BYTE_CODE_CODE_FRAGMENT_INDEX has invalid value (" + b + ")"); } - codeSizeNewXorByteCodeCodeFragmentIndexXorMmuExoSumXorPrcRaoXorInitCodeSize.put((byte) (b >> 24)); - codeSizeNewXorByteCodeCodeFragmentIndexXorMmuExoSumXorPrcRaoXorInitCodeSize.put((byte) (b >> 16)); - codeSizeNewXorByteCodeCodeFragmentIndexXorMmuExoSumXorPrcRaoXorInitCodeSize.put((byte) (b >> 8)); + if (b >= 4294967296L) { + throw new IllegalArgumentException( + "hub.context/BYTE_CODE_CODE_FRAGMENT_INDEX has invalid value (" + b + ")"); + } + codeSizeNewXorByteCodeCodeFragmentIndexXorMmuExoSumXorPrcRaoXorInitCodeSize.put( + (byte) (b >> 24)); + codeSizeNewXorByteCodeCodeFragmentIndexXorMmuExoSumXorPrcRaoXorInitCodeSize.put( + (byte) (b >> 16)); + codeSizeNewXorByteCodeCodeFragmentIndexXorMmuExoSumXorPrcRaoXorInitCodeSize.put( + (byte) (b >> 8)); codeSizeNewXorByteCodeCodeFragmentIndexXorMmuExoSumXorPrcRaoXorInitCodeSize.put((byte) b); - return this; } @@ -1829,13 +2325,15 @@ public Trace pContextByteCodeDeploymentNumber(final long b) { filled.set(107); } - if(b >= 4294967296L) { throw new IllegalArgumentException("hub.context/BYTE_CODE_DEPLOYMENT_NUMBER has invalid value (" + b + ")"); } + if (b >= 4294967296L) { + throw new IllegalArgumentException( + "hub.context/BYTE_CODE_DEPLOYMENT_NUMBER has invalid value (" + b + ")"); + } deploymentNumberXorByteCodeDeploymentNumberXorMmuInstXorToAddressHi.put((byte) (b >> 24)); deploymentNumberXorByteCodeDeploymentNumberXorMmuInstXorToAddressHi.put((byte) (b >> 16)); deploymentNumberXorByteCodeDeploymentNumberXorMmuInstXorToAddressHi.put((byte) (b >> 8)); deploymentNumberXorByteCodeDeploymentNumberXorMmuInstXorToAddressHi.put((byte) b); - return this; } @@ -1846,13 +2344,15 @@ public Trace pContextByteCodeDeploymentStatus(final long b) { filled.set(108); } - if(b >= 4294967296L) { throw new IllegalArgumentException("hub.context/BYTE_CODE_DEPLOYMENT_STATUS has invalid value (" + b + ")"); } + if (b >= 4294967296L) { + throw new IllegalArgumentException( + "hub.context/BYTE_CODE_DEPLOYMENT_STATUS has invalid value (" + b + ")"); + } deploymentNumberInftyXorByteCodeDeploymentStatusXorMmuPhase.put((byte) (b >> 24)); deploymentNumberInftyXorByteCodeDeploymentStatusXorMmuPhase.put((byte) (b >> 16)); deploymentNumberInftyXorByteCodeDeploymentStatusXorMmuPhase.put((byte) (b >> 8)); deploymentNumberInftyXorByteCodeDeploymentStatusXorMmuPhase.put((byte) b); - return this; } @@ -1863,13 +2363,15 @@ public Trace pContextCallDataContextNumber(final long b) { filled.set(110); } - if(b >= 4294967296L) { throw new IllegalArgumentException("hub.context/CALL_DATA_CONTEXT_NUMBER has invalid value (" + b + ")"); } + if (b >= 4294967296L) { + throw new IllegalArgumentException( + "hub.context/CALL_DATA_CONTEXT_NUMBER has invalid value (" + b + ")"); + } rlpaddrDepAddrHiXorCallDataContextNumberXorMmuRefSize.put((byte) (b >> 24)); rlpaddrDepAddrHiXorCallDataContextNumberXorMmuRefSize.put((byte) (b >> 16)); rlpaddrDepAddrHiXorCallDataContextNumberXorMmuRefSize.put((byte) (b >> 8)); rlpaddrDepAddrHiXorCallDataContextNumberXorMmuRefSize.put((byte) b); - return this; } @@ -1880,13 +2382,15 @@ public Trace pContextCallDataOffset(final long b) { filled.set(111); } - if(b >= 4294967296L) { throw new IllegalArgumentException("hub.context/CALL_DATA_OFFSET has invalid value (" + b + ")"); } + if (b >= 4294967296L) { + throw new IllegalArgumentException( + "hub.context/CALL_DATA_OFFSET has invalid value (" + b + ")"); + } callDataOffsetXorMmuSize.put((byte) (b >> 24)); callDataOffsetXorMmuSize.put((byte) (b >> 16)); callDataOffsetXorMmuSize.put((byte) (b >> 8)); callDataOffsetXorMmuSize.put((byte) b); - return this; } @@ -1897,13 +2401,15 @@ public Trace pContextCallDataSize(final long b) { filled.set(112); } - if(b >= 4294967296L) { throw new IllegalArgumentException("hub.context/CALL_DATA_SIZE has invalid value (" + b + ")"); } + if (b >= 4294967296L) { + throw new IllegalArgumentException( + "hub.context/CALL_DATA_SIZE has invalid value (" + b + ")"); + } callDataSizeXorMmuSrcId.put((byte) (b >> 24)); callDataSizeXorMmuSrcId.put((byte) (b >> 16)); callDataSizeXorMmuSrcId.put((byte) (b >> 8)); callDataSizeXorMmuSrcId.put((byte) b); - return this; } @@ -1914,11 +2420,13 @@ public Trace pContextCallStackDepth(final long b) { filled.set(97); } - if(b >= 2048L) { throw new IllegalArgumentException("hub.context/CALL_STACK_DEPTH has invalid value (" + b + ")"); } + if (b >= 2048L) { + throw new IllegalArgumentException( + "hub.context/CALL_STACK_DEPTH has invalid value (" + b + ")"); + } callStackDepthXorStackItemHeight1.put((byte) (b >> 8)); callStackDepthXorStackItemHeight1.put((byte) b); - return this; } @@ -1932,11 +2440,18 @@ public Trace pContextCallValue(final Bytes b) { // Trim array to size Bytes bs = b.trimLeadingZeros(); // Sanity check against expected width - if(bs.bitLength() > 128) { throw new IllegalArgumentException("hub.context/CALL_VALUE has invalid width (" + bs.bitLength() + "bits)"); } + if (bs.bitLength() > 128) { + throw new IllegalArgumentException( + "hub.context/CALL_VALUE has invalid width (" + bs.bitLength() + "bits)"); + } // Write padding (if necessary) - for(int i=bs.size(); i<16; i++) { codeHashHiXorCallValueXorExpData4XorPushValueLoXorValueCurrHiXorToAddressLo.put((byte) 0); } + for (int i = bs.size(); i < 16; i++) { + codeHashHiXorCallValueXorExpData4XorPushValueLoXorValueCurrHiXorToAddressLo.put((byte) 0); + } // Write bytes - for(int j=0; j= 4294967296L) { throw new IllegalArgumentException("hub.context/CALLER_ADDRESS_HI has invalid value (" + b + ")"); } + if (b >= 4294967296L) { + throw new IllegalArgumentException( + "hub.context/CALLER_ADDRESS_HI has invalid value (" + b + ")"); + } deploymentNumberNewXorCallerAddressHiXorMmuRefOffset.put((byte) (b >> 24)); deploymentNumberNewXorCallerAddressHiXorMmuRefOffset.put((byte) (b >> 16)); deploymentNumberNewXorCallerAddressHiXorMmuRefOffset.put((byte) (b >> 8)); deploymentNumberNewXorCallerAddressHiXorMmuRefOffset.put((byte) b); - return this; } @@ -1968,11 +2485,20 @@ public Trace pContextCallerAddressLo(final Bytes b) { // Trim array to size Bytes bs = b.trimLeadingZeros(); // Sanity check against expected width - if(bs.bitLength() > 128) { throw new IllegalArgumentException("hub.context/CALLER_ADDRESS_LO has invalid width (" + bs.bitLength() + "bits)"); } + if (bs.bitLength() > 128) { + throw new IllegalArgumentException( + "hub.context/CALLER_ADDRESS_LO has invalid width (" + bs.bitLength() + "bits)"); + } // Write padding (if necessary) - for(int i=bs.size(); i<16; i++) { balanceNewXorCallerAddressLoXorExpData3XorPushValueHiXorStorageKeyLoXorInitialBalance.put((byte) 0); } + for (int i = bs.size(); i < 16; i++) { + balanceNewXorCallerAddressLoXorExpData3XorPushValueHiXorStorageKeyLoXorInitialBalance.put( + (byte) 0); + } // Write bytes - for(int j=0; j= 4294967296L) { throw new IllegalArgumentException("hub.context/CONTEXT_NUMBER has invalid value (" + b + ")"); } + if (b >= 4294967296L) { + throw new IllegalArgumentException( + "hub.context/CONTEXT_NUMBER has invalid value (" + b + ")"); + } contextNumberXorMmuTgtId.put((byte) (b >> 24)); contextNumberXorMmuTgtId.put((byte) (b >> 16)); contextNumberXorMmuTgtId.put((byte) (b >> 8)); contextNumberXorMmuTgtId.put((byte) b); - return this; } @@ -2001,7 +2529,8 @@ public Trace pContextIsRoot(final Boolean b) { filled.set(45); } - againInBlkXorIsRootXorCcsrFlagXorCallAbortWillRevertXorAccFlagXorAgainInBlkXorCopyTxcd.put((byte) (b ? 1 : 0)); + againInBlkXorIsRootXorCcsrFlagXorCallAbortWillRevertXorAccFlagXorAgainInBlkXorCopyTxcd.put( + (byte) (b ? 1 : 0)); return this; } @@ -2013,7 +2542,8 @@ public Trace pContextIsStatic(final Boolean b) { filled.set(46); } - againInCnfXorIsStaticXorExpFlagXorCallAbortWontRevertXorAddFlagXorAgainInCnfXorIsDeployment.put((byte) (b ? 1 : 0)); + againInCnfXorIsStaticXorExpFlagXorCallAbortWontRevertXorAddFlagXorAgainInCnfXorIsDeployment.put( + (byte) (b ? 1 : 0)); return this; } @@ -2025,13 +2555,15 @@ public Trace pContextReturnAtCapacity(final long b) { filled.set(114); } - if(b >= 4294967296L) { throw new IllegalArgumentException("hub.context/RETURN_AT_CAPACITY has invalid value (" + b + ")"); } + if (b >= 4294967296L) { + throw new IllegalArgumentException( + "hub.context/RETURN_AT_CAPACITY has invalid value (" + b + ")"); + } returnAtCapacityXorMxpInst.put((byte) (b >> 24)); returnAtCapacityXorMxpInst.put((byte) (b >> 16)); returnAtCapacityXorMxpInst.put((byte) (b >> 8)); returnAtCapacityXorMxpInst.put((byte) b); - return this; } @@ -2042,13 +2574,15 @@ public Trace pContextReturnAtOffset(final long b) { filled.set(115); } - if(b >= 4294967296L) { throw new IllegalArgumentException("hub.context/RETURN_AT_OFFSET has invalid value (" + b + ")"); } + if (b >= 4294967296L) { + throw new IllegalArgumentException( + "hub.context/RETURN_AT_OFFSET has invalid value (" + b + ")"); + } returnAtOffsetXorOobInst.put((byte) (b >> 24)); returnAtOffsetXorOobInst.put((byte) (b >> 16)); returnAtOffsetXorOobInst.put((byte) (b >> 8)); returnAtOffsetXorOobInst.put((byte) b); - return this; } @@ -2059,13 +2593,15 @@ public Trace pContextReturnDataContextNumber(final long b) { filled.set(116); } - if(b >= 4294967296L) { throw new IllegalArgumentException("hub.context/RETURN_DATA_CONTEXT_NUMBER has invalid value (" + b + ")"); } + if (b >= 4294967296L) { + throw new IllegalArgumentException( + "hub.context/RETURN_DATA_CONTEXT_NUMBER has invalid value (" + b + ")"); + } returnDataContextNumberXorStpGasStipend.put((byte) (b >> 24)); returnDataContextNumberXorStpGasStipend.put((byte) (b >> 16)); returnDataContextNumberXorStpGasStipend.put((byte) (b >> 8)); returnDataContextNumberXorStpGasStipend.put((byte) b); - return this; } @@ -2076,13 +2612,15 @@ public Trace pContextReturnDataOffset(final long b) { filled.set(117); } - if(b >= 4294967296L) { throw new IllegalArgumentException("hub.context/RETURN_DATA_OFFSET has invalid value (" + b + ")"); } + if (b >= 4294967296L) { + throw new IllegalArgumentException( + "hub.context/RETURN_DATA_OFFSET has invalid value (" + b + ")"); + } returnDataOffsetXorStpInstruction.put((byte) (b >> 24)); returnDataOffsetXorStpInstruction.put((byte) (b >> 16)); returnDataOffsetXorStpInstruction.put((byte) (b >> 8)); returnDataOffsetXorStpInstruction.put((byte) b); - return this; } @@ -2093,13 +2631,15 @@ public Trace pContextReturnDataSize(final long b) { filled.set(118); } - if(b >= 4294967296L) { throw new IllegalArgumentException("hub.context/RETURN_DATA_SIZE has invalid value (" + b + ")"); } + if (b >= 4294967296L) { + throw new IllegalArgumentException( + "hub.context/RETURN_DATA_SIZE has invalid value (" + b + ")"); + } returnDataSize.put((byte) (b >> 24)); returnDataSize.put((byte) (b >> 16)); returnDataSize.put((byte) (b >> 8)); returnDataSize.put((byte) b); - return this; } @@ -2110,7 +2650,8 @@ public Trace pContextUpdate(final Boolean b) { filled.set(47); } - againInTxnXorUpdateXorMmuFlagXorCallEoaSuccessCallerWillRevertXorBinFlagXorAgainInTxnXorIsType2.put((byte) (b ? 1 : 0)); + againInTxnXorUpdateXorMmuFlagXorCallEoaSuccessCallerWillRevertXorBinFlagXorAgainInTxnXorIsType2 + .put((byte) (b ? 1 : 0)); return this; } @@ -2122,12 +2663,17 @@ public Trace pMiscCcrsStamp(final long b) { filled.set(103); } - if(b >= 4294967296L) { throw new IllegalArgumentException("hub.misc/CCRS_STAMP has invalid value (" + b + ")"); } - addressHiXorAccountAddressHiXorCcrsStampXorPrcCdoXorStaticGasXorAddressHiXorCallDataSize.put((byte) (b >> 24)); - addressHiXorAccountAddressHiXorCcrsStampXorPrcCdoXorStaticGasXorAddressHiXorCallDataSize.put((byte) (b >> 16)); - addressHiXorAccountAddressHiXorCcrsStampXorPrcCdoXorStaticGasXorAddressHiXorCallDataSize.put((byte) (b >> 8)); - addressHiXorAccountAddressHiXorCcrsStampXorPrcCdoXorStaticGasXorAddressHiXorCallDataSize.put((byte) b); - + if (b >= 4294967296L) { + throw new IllegalArgumentException("hub.misc/CCRS_STAMP has invalid value (" + b + ")"); + } + addressHiXorAccountAddressHiXorCcrsStampXorPrcCdoXorStaticGasXorAddressHiXorCallDataSize.put( + (byte) (b >> 24)); + addressHiXorAccountAddressHiXorCcrsStampXorPrcCdoXorStaticGasXorAddressHiXorCallDataSize.put( + (byte) (b >> 16)); + addressHiXorAccountAddressHiXorCcrsStampXorPrcCdoXorStaticGasXorAddressHiXorCallDataSize.put( + (byte) (b >> 8)); + addressHiXorAccountAddressHiXorCcrsStampXorPrcCdoXorStaticGasXorAddressHiXorCallDataSize.put( + (byte) b); return this; } @@ -2139,7 +2685,8 @@ public Trace pMiscCcsrFlag(final Boolean b) { filled.set(45); } - againInBlkXorIsRootXorCcsrFlagXorCallAbortWillRevertXorAccFlagXorAgainInBlkXorCopyTxcd.put((byte) (b ? 1 : 0)); + againInBlkXorIsRootXorCcsrFlagXorCallAbortWillRevertXorAccFlagXorAgainInBlkXorCopyTxcd.put( + (byte) (b ? 1 : 0)); return this; } @@ -2154,11 +2701,20 @@ public Trace pMiscExpData1(final Bytes b) { // Trim array to size Bytes bs = b.trimLeadingZeros(); // Sanity check against expected width - if(bs.bitLength() > 128) { throw new IllegalArgumentException("hub.misc/EXP_DATA_1 has invalid width (" + bs.bitLength() + "bits)"); } + if (bs.bitLength() > 128) { + throw new IllegalArgumentException( + "hub.misc/EXP_DATA_1 has invalid width (" + bs.bitLength() + "bits)"); + } // Write padding (if necessary) - for(int i=bs.size(); i<16; i++) { addressLoXorAccountAddressLoXorExpData1XorHashInfoKeccakHiXorAddressLoXorCoinbaseAddressLo.put((byte) 0); } + for (int i = bs.size(); i < 16; i++) { + addressLoXorAccountAddressLoXorExpData1XorHashInfoKeccakHiXorAddressLoXorCoinbaseAddressLo + .put((byte) 0); + } // Write bytes - for(int j=0; j 128) { throw new IllegalArgumentException("hub.misc/EXP_DATA_2 has invalid width (" + bs.bitLength() + "bits)"); } + if (bs.bitLength() > 128) { + throw new IllegalArgumentException( + "hub.misc/EXP_DATA_2 has invalid width (" + bs.bitLength() + "bits)"); + } // Write padding (if necessary) - for(int i=bs.size(); i<16; i++) { balanceXorByteCodeAddressLoXorExpData2XorHashInfoKeccakLoXorStorageKeyHiXorFromAddressLo.put((byte) 0); } + for (int i = bs.size(); i < 16; i++) { + balanceXorByteCodeAddressLoXorExpData2XorHashInfoKeccakLoXorStorageKeyHiXorFromAddressLo.put( + (byte) 0); + } // Write bytes - for(int j=0; j 128) { throw new IllegalArgumentException("hub.misc/EXP_DATA_3 has invalid width (" + bs.bitLength() + "bits)"); } + if (bs.bitLength() > 128) { + throw new IllegalArgumentException( + "hub.misc/EXP_DATA_3 has invalid width (" + bs.bitLength() + "bits)"); + } // Write padding (if necessary) - for(int i=bs.size(); i<16; i++) { balanceNewXorCallerAddressLoXorExpData3XorPushValueHiXorStorageKeyLoXorInitialBalance.put((byte) 0); } + for (int i = bs.size(); i < 16; i++) { + balanceNewXorCallerAddressLoXorExpData3XorPushValueHiXorStorageKeyLoXorInitialBalance.put( + (byte) 0); + } // Write bytes - for(int j=0; j 128) { throw new IllegalArgumentException("hub.misc/EXP_DATA_4 has invalid width (" + bs.bitLength() + "bits)"); } + if (bs.bitLength() > 128) { + throw new IllegalArgumentException( + "hub.misc/EXP_DATA_4 has invalid width (" + bs.bitLength() + "bits)"); + } // Write padding (if necessary) - for(int i=bs.size(); i<16; i++) { codeHashHiXorCallValueXorExpData4XorPushValueLoXorValueCurrHiXorToAddressLo.put((byte) 0); } + for (int i = bs.size(); i < 16; i++) { + codeHashHiXorCallValueXorExpData4XorPushValueLoXorValueCurrHiXorToAddressLo.put((byte) 0); + } // Write bytes - for(int j=0; j 128) { throw new IllegalArgumentException("hub.misc/EXP_DATA_5 has invalid width (" + bs.bitLength() + "bits)"); } + if (bs.bitLength() > 128) { + throw new IllegalArgumentException( + "hub.misc/EXP_DATA_5 has invalid width (" + bs.bitLength() + "bits)"); + } // Write padding (if necessary) - for(int i=bs.size(); i<16; i++) { codeHashHiNewXorExpData5XorStackItemValueHi1XorValueCurrLoXorValue.put((byte) 0); } + for (int i = bs.size(); i < 16; i++) { + codeHashHiNewXorExpData5XorStackItemValueHi1XorValueCurrLoXorValue.put((byte) 0); + } // Write bytes - for(int j=0; j= 4294967296L) { throw new IllegalArgumentException("hub.misc/EXP_INST has invalid value (" + b + ")"); } - codeFragmentIndexXorAccountDeploymentNumberXorExpInstXorPrcCdsXorDeploymentNumberXorCoinbaseAddressHi.put((byte) (b >> 24)); - codeFragmentIndexXorAccountDeploymentNumberXorExpInstXorPrcCdsXorDeploymentNumberXorCoinbaseAddressHi.put((byte) (b >> 16)); - codeFragmentIndexXorAccountDeploymentNumberXorExpInstXorPrcCdsXorDeploymentNumberXorCoinbaseAddressHi.put((byte) (b >> 8)); - codeFragmentIndexXorAccountDeploymentNumberXorExpInstXorPrcCdsXorDeploymentNumberXorCoinbaseAddressHi.put((byte) b); - + if (b >= 4294967296L) { + throw new IllegalArgumentException("hub.misc/EXP_INST has invalid value (" + b + ")"); + } + codeFragmentIndexXorAccountDeploymentNumberXorExpInstXorPrcCdsXorDeploymentNumberXorCoinbaseAddressHi + .put((byte) (b >> 24)); + codeFragmentIndexXorAccountDeploymentNumberXorExpInstXorPrcCdsXorDeploymentNumberXorCoinbaseAddressHi + .put((byte) (b >> 16)); + codeFragmentIndexXorAccountDeploymentNumberXorExpInstXorPrcCdsXorDeploymentNumberXorCoinbaseAddressHi + .put((byte) (b >> 8)); + codeFragmentIndexXorAccountDeploymentNumberXorExpInstXorPrcCdsXorDeploymentNumberXorCoinbaseAddressHi + .put((byte) b); return this; } @@ -2275,12 +2869,17 @@ public Trace pMiscMmuAuxId(final long b) { filled.set(105); } - if(b >= 4294967296L) { throw new IllegalArgumentException("hub.misc/MMU_AUX_ID has invalid value (" + b + ")"); } - codeSizeXorByteCodeAddressHiXorMmuAuxIdXorPrcRacXorDeploymentNumberInftyXorFromAddressHi.put((byte) (b >> 24)); - codeSizeXorByteCodeAddressHiXorMmuAuxIdXorPrcRacXorDeploymentNumberInftyXorFromAddressHi.put((byte) (b >> 16)); - codeSizeXorByteCodeAddressHiXorMmuAuxIdXorPrcRacXorDeploymentNumberInftyXorFromAddressHi.put((byte) (b >> 8)); - codeSizeXorByteCodeAddressHiXorMmuAuxIdXorPrcRacXorDeploymentNumberInftyXorFromAddressHi.put((byte) b); - + if (b >= 4294967296L) { + throw new IllegalArgumentException("hub.misc/MMU_AUX_ID has invalid value (" + b + ")"); + } + codeSizeXorByteCodeAddressHiXorMmuAuxIdXorPrcRacXorDeploymentNumberInftyXorFromAddressHi.put( + (byte) (b >> 24)); + codeSizeXorByteCodeAddressHiXorMmuAuxIdXorPrcRacXorDeploymentNumberInftyXorFromAddressHi.put( + (byte) (b >> 16)); + codeSizeXorByteCodeAddressHiXorMmuAuxIdXorPrcRacXorDeploymentNumberInftyXorFromAddressHi.put( + (byte) (b >> 8)); + codeSizeXorByteCodeAddressHiXorMmuAuxIdXorPrcRacXorDeploymentNumberInftyXorFromAddressHi.put( + (byte) b); return this; } @@ -2292,13 +2891,17 @@ public Trace pMiscMmuExoSum(final long b) { filled.set(106); } - if(b >= 4294967296L) { throw new IllegalArgumentException("hub.misc/MMU_EXO_SUM has invalid value (" + b + ")"); } - codeSizeNewXorByteCodeCodeFragmentIndexXorMmuExoSumXorPrcRaoXorInitCodeSize.put((byte) (b >> 24)); - codeSizeNewXorByteCodeCodeFragmentIndexXorMmuExoSumXorPrcRaoXorInitCodeSize.put((byte) (b >> 16)); - codeSizeNewXorByteCodeCodeFragmentIndexXorMmuExoSumXorPrcRaoXorInitCodeSize.put((byte) (b >> 8)); + if (b >= 4294967296L) { + throw new IllegalArgumentException("hub.misc/MMU_EXO_SUM has invalid value (" + b + ")"); + } + codeSizeNewXorByteCodeCodeFragmentIndexXorMmuExoSumXorPrcRaoXorInitCodeSize.put( + (byte) (b >> 24)); + codeSizeNewXorByteCodeCodeFragmentIndexXorMmuExoSumXorPrcRaoXorInitCodeSize.put( + (byte) (b >> 16)); + codeSizeNewXorByteCodeCodeFragmentIndexXorMmuExoSumXorPrcRaoXorInitCodeSize.put( + (byte) (b >> 8)); codeSizeNewXorByteCodeCodeFragmentIndexXorMmuExoSumXorPrcRaoXorInitCodeSize.put((byte) b); - return this; } @@ -2309,7 +2912,8 @@ public Trace pMiscMmuFlag(final Boolean b) { filled.set(47); } - againInTxnXorUpdateXorMmuFlagXorCallEoaSuccessCallerWillRevertXorBinFlagXorAgainInTxnXorIsType2.put((byte) (b ? 1 : 0)); + againInTxnXorUpdateXorMmuFlagXorCallEoaSuccessCallerWillRevertXorBinFlagXorAgainInTxnXorIsType2 + .put((byte) (b ? 1 : 0)); return this; } @@ -2321,13 +2925,14 @@ public Trace pMiscMmuInst(final long b) { filled.set(107); } - if(b >= 4294967296L) { throw new IllegalArgumentException("hub.misc/MMU_INST has invalid value (" + b + ")"); } + if (b >= 4294967296L) { + throw new IllegalArgumentException("hub.misc/MMU_INST has invalid value (" + b + ")"); + } deploymentNumberXorByteCodeDeploymentNumberXorMmuInstXorToAddressHi.put((byte) (b >> 24)); deploymentNumberXorByteCodeDeploymentNumberXorMmuInstXorToAddressHi.put((byte) (b >> 16)); deploymentNumberXorByteCodeDeploymentNumberXorMmuInstXorToAddressHi.put((byte) (b >> 8)); deploymentNumberXorByteCodeDeploymentNumberXorMmuInstXorToAddressHi.put((byte) b); - return this; } @@ -2341,11 +2946,18 @@ public Trace pMiscMmuLimb1(final Bytes b) { // Trim array to size Bytes bs = b.trimLeadingZeros(); // Sanity check against expected width - if(bs.bitLength() > 128) { throw new IllegalArgumentException("hub.misc/MMU_LIMB_1 has invalid width (" + bs.bitLength() + "bits)"); } + if (bs.bitLength() > 128) { + throw new IllegalArgumentException( + "hub.misc/MMU_LIMB_1 has invalid width (" + bs.bitLength() + "bits)"); + } // Write padding (if necessary) - for(int i=bs.size(); i<16; i++) { codeHashLoXorMmuLimb1XorStackItemValueHi2XorValueNextHi.put((byte) 0); } + for (int i = bs.size(); i < 16; i++) { + codeHashLoXorMmuLimb1XorStackItemValueHi2XorValueNextHi.put((byte) 0); + } // Write bytes - for(int j=0; j 128) { throw new IllegalArgumentException("hub.misc/MMU_LIMB_2 has invalid width (" + bs.bitLength() + "bits)"); } + if (bs.bitLength() > 128) { + throw new IllegalArgumentException( + "hub.misc/MMU_LIMB_2 has invalid width (" + bs.bitLength() + "bits)"); + } // Write padding (if necessary) - for(int i=bs.size(); i<16; i++) { codeHashLoNewXorMmuLimb2XorStackItemValueHi3XorValueNextLo.put((byte) 0); } + for (int i = bs.size(); i < 16; i++) { + codeHashLoNewXorMmuLimb2XorStackItemValueHi3XorValueNextLo.put((byte) 0); + } // Write bytes - for(int j=0; j= 4294967296L) { throw new IllegalArgumentException("hub.misc/MMU_PHASE has invalid value (" + b + ")"); } + if (b >= 4294967296L) { + throw new IllegalArgumentException("hub.misc/MMU_PHASE has invalid value (" + b + ")"); + } deploymentNumberInftyXorByteCodeDeploymentStatusXorMmuPhase.put((byte) (b >> 24)); deploymentNumberInftyXorByteCodeDeploymentStatusXorMmuPhase.put((byte) (b >> 16)); deploymentNumberInftyXorByteCodeDeploymentStatusXorMmuPhase.put((byte) (b >> 8)); deploymentNumberInftyXorByteCodeDeploymentStatusXorMmuPhase.put((byte) b); - return this; } @@ -2393,13 +3013,14 @@ public Trace pMiscMmuRefOffset(final long b) { filled.set(109); } - if(b >= 4294967296L) { throw new IllegalArgumentException("hub.misc/MMU_REF_OFFSET has invalid value (" + b + ")"); } + if (b >= 4294967296L) { + throw new IllegalArgumentException("hub.misc/MMU_REF_OFFSET has invalid value (" + b + ")"); + } deploymentNumberNewXorCallerAddressHiXorMmuRefOffset.put((byte) (b >> 24)); deploymentNumberNewXorCallerAddressHiXorMmuRefOffset.put((byte) (b >> 16)); deploymentNumberNewXorCallerAddressHiXorMmuRefOffset.put((byte) (b >> 8)); deploymentNumberNewXorCallerAddressHiXorMmuRefOffset.put((byte) b); - return this; } @@ -2410,13 +3031,14 @@ public Trace pMiscMmuRefSize(final long b) { filled.set(110); } - if(b >= 4294967296L) { throw new IllegalArgumentException("hub.misc/MMU_REF_SIZE has invalid value (" + b + ")"); } + if (b >= 4294967296L) { + throw new IllegalArgumentException("hub.misc/MMU_REF_SIZE has invalid value (" + b + ")"); + } rlpaddrDepAddrHiXorCallDataContextNumberXorMmuRefSize.put((byte) (b >> 24)); rlpaddrDepAddrHiXorCallDataContextNumberXorMmuRefSize.put((byte) (b >> 16)); rlpaddrDepAddrHiXorCallDataContextNumberXorMmuRefSize.put((byte) (b >> 8)); rlpaddrDepAddrHiXorCallDataContextNumberXorMmuRefSize.put((byte) b); - return this; } @@ -2427,13 +3049,14 @@ public Trace pMiscMmuSize(final long b) { filled.set(111); } - if(b >= 4294967296L) { throw new IllegalArgumentException("hub.misc/MMU_SIZE has invalid value (" + b + ")"); } + if (b >= 4294967296L) { + throw new IllegalArgumentException("hub.misc/MMU_SIZE has invalid value (" + b + ")"); + } callDataOffsetXorMmuSize.put((byte) (b >> 24)); callDataOffsetXorMmuSize.put((byte) (b >> 16)); callDataOffsetXorMmuSize.put((byte) (b >> 8)); callDataOffsetXorMmuSize.put((byte) b); - return this; } @@ -2444,13 +3067,14 @@ public Trace pMiscMmuSrcId(final long b) { filled.set(112); } - if(b >= 4294967296L) { throw new IllegalArgumentException("hub.misc/MMU_SRC_ID has invalid value (" + b + ")"); } + if (b >= 4294967296L) { + throw new IllegalArgumentException("hub.misc/MMU_SRC_ID has invalid value (" + b + ")"); + } callDataSizeXorMmuSrcId.put((byte) (b >> 24)); callDataSizeXorMmuSrcId.put((byte) (b >> 16)); callDataSizeXorMmuSrcId.put((byte) (b >> 8)); callDataSizeXorMmuSrcId.put((byte) b); - return this; } @@ -2464,11 +3088,18 @@ public Trace pMiscMmuSrcOffsetHi(final Bytes b) { // Trim array to size Bytes bs = b.trimLeadingZeros(); // Sanity check against expected width - if(bs.bitLength() > 128) { throw new IllegalArgumentException("hub.misc/MMU_SRC_OFFSET_HI has invalid width (" + bs.bitLength() + "bits)"); } + if (bs.bitLength() > 128) { + throw new IllegalArgumentException( + "hub.misc/MMU_SRC_OFFSET_HI has invalid width (" + bs.bitLength() + "bits)"); + } // Write padding (if necessary) - for(int i=bs.size(); i<16; i++) { rlpaddrDepAddrLoXorMmuSrcOffsetHiXorStackItemValueHi4XorValueOrigHi.put((byte) 0); } + for (int i = bs.size(); i < 16; i++) { + rlpaddrDepAddrLoXorMmuSrcOffsetHiXorStackItemValueHi4XorValueOrigHi.put((byte) 0); + } // Write bytes - for(int j=0; j 128) { throw new IllegalArgumentException("hub.misc/MMU_SRC_OFFSET_LO has invalid width (" + bs.bitLength() + "bits)"); } + if (bs.bitLength() > 128) { + throw new IllegalArgumentException( + "hub.misc/MMU_SRC_OFFSET_LO has invalid width (" + bs.bitLength() + "bits)"); + } // Write padding (if necessary) - for(int i=bs.size(); i<16; i++) { rlpaddrKecHiXorMmuSrcOffsetLoXorStackItemValueLo1XorValueOrigLo.put((byte) 0); } + for (int i = bs.size(); i < 16; i++) { + rlpaddrKecHiXorMmuSrcOffsetLoXorStackItemValueLo1XorValueOrigLo.put((byte) 0); + } // Write bytes - for(int j=0; j= 4294967296L) { throw new IllegalArgumentException("hub.misc/MMU_TGT_ID has invalid value (" + b + ")"); } + if (b >= 4294967296L) { + throw new IllegalArgumentException("hub.misc/MMU_TGT_ID has invalid value (" + b + ")"); + } contextNumberXorMmuTgtId.put((byte) (b >> 24)); contextNumberXorMmuTgtId.put((byte) (b >> 16)); contextNumberXorMmuTgtId.put((byte) (b >> 8)); contextNumberXorMmuTgtId.put((byte) b); - return this; } @@ -2531,11 +3171,18 @@ public Trace pMiscMmuTgtOffsetLo(final Bytes b) { // Trim array to size Bytes bs = b.trimLeadingZeros(); // Sanity check against expected width - if(bs.bitLength() > 128) { throw new IllegalArgumentException("hub.misc/MMU_TGT_OFFSET_LO has invalid width (" + bs.bitLength() + "bits)"); } + if (bs.bitLength() > 128) { + throw new IllegalArgumentException( + "hub.misc/MMU_TGT_OFFSET_LO has invalid width (" + bs.bitLength() + "bits)"); + } // Write padding (if necessary) - for(int i=bs.size(); i<16; i++) { rlpaddrKecLoXorMmuTgtOffsetLoXorStackItemValueLo2.put((byte) 0); } + for (int i = bs.size(); i < 16; i++) { + rlpaddrKecLoXorMmuTgtOffsetLoXorStackItemValueLo2.put((byte) 0); + } // Write bytes - for(int j=0; j 128) { throw new IllegalArgumentException("hub.misc/MXP_GAS_MXP has invalid width (" + bs.bitLength() + "bits)"); } + if (bs.bitLength() > 128) { + throw new IllegalArgumentException( + "hub.misc/MXP_GAS_MXP has invalid width (" + bs.bitLength() + "bits)"); + } // Write padding (if necessary) - for(int i=bs.size(); i<16; i++) { rlpaddrSaltHiXorMxpGasMxpXorStackItemValueLo3.put((byte) 0); } + for (int i = bs.size(); i < 16; i++) { + rlpaddrSaltHiXorMxpGasMxpXorStackItemValueLo3.put((byte) 0); + } // Write bytes - for(int j=0; j= 4294967296L) { throw new IllegalArgumentException("hub.misc/MXP_INST has invalid value (" + b + ")"); } + if (b >= 4294967296L) { + throw new IllegalArgumentException("hub.misc/MXP_INST has invalid value (" + b + ")"); + } returnAtCapacityXorMxpInst.put((byte) (b >> 24)); returnAtCapacityXorMxpInst.put((byte) (b >> 16)); returnAtCapacityXorMxpInst.put((byte) (b >> 8)); returnAtCapacityXorMxpInst.put((byte) b); - return this; } @@ -2607,7 +3263,8 @@ public Trace pMiscMxpMtntop(final Boolean b) { filled.set(51); } - existsXorMxpMtntopXorCallPrcSuccessCallerWillRevertXorCopyFlagXorFirstInBlk.put((byte) (b ? 1 : 0)); + existsXorMxpMtntopXorCallPrcSuccessCallerWillRevertXorCopyFlagXorFirstInBlk.put( + (byte) (b ? 1 : 0)); return this; } @@ -2619,7 +3276,8 @@ public Trace pMiscMxpMxpx(final Boolean b) { filled.set(52); } - existsNewXorMxpMxpxXorCallPrcSuccessCallerWontRevertXorCreateFlagXorFirstInCnf.put((byte) (b ? 1 : 0)); + existsNewXorMxpMxpxXorCallPrcSuccessCallerWontRevertXorCreateFlagXorFirstInCnf.put( + (byte) (b ? 1 : 0)); return this; } @@ -2634,11 +3292,18 @@ public Trace pMiscMxpOffset1Hi(final Bytes b) { // Trim array to size Bytes bs = b.trimLeadingZeros(); // Sanity check against expected width - if(bs.bitLength() > 128) { throw new IllegalArgumentException("hub.misc/MXP_OFFSET_1_HI has invalid width (" + bs.bitLength() + "bits)"); } + if (bs.bitLength() > 128) { + throw new IllegalArgumentException( + "hub.misc/MXP_OFFSET_1_HI has invalid width (" + bs.bitLength() + "bits)"); + } // Write padding (if necessary) - for(int i=bs.size(); i<16; i++) { rlpaddrSaltLoXorMxpOffset1HiXorStackItemValueLo4.put((byte) 0); } + for (int i = bs.size(); i < 16; i++) { + rlpaddrSaltLoXorMxpOffset1HiXorStackItemValueLo4.put((byte) 0); + } // Write bytes - for(int j=0; j 128) { throw new IllegalArgumentException("hub.misc/MXP_OFFSET_1_LO has invalid width (" + bs.bitLength() + "bits)"); } + if (bs.bitLength() > 128) { + throw new IllegalArgumentException( + "hub.misc/MXP_OFFSET_1_LO has invalid width (" + bs.bitLength() + "bits)"); + } // Write padding (if necessary) - for(int i=bs.size(); i<16; i++) { trmRawAddressHiXorMxpOffset1Lo.put((byte) 0); } + for (int i = bs.size(); i < 16; i++) { + trmRawAddressHiXorMxpOffset1Lo.put((byte) 0); + } // Write bytes - for(int j=0; j 128) { throw new IllegalArgumentException("hub.misc/MXP_OFFSET_2_HI has invalid width (" + bs.bitLength() + "bits)"); } + if (bs.bitLength() > 128) { + throw new IllegalArgumentException( + "hub.misc/MXP_OFFSET_2_HI has invalid width (" + bs.bitLength() + "bits)"); + } // Write padding (if necessary) - for(int i=bs.size(); i<16; i++) { mxpOffset2Hi.put((byte) 0); } + for (int i = bs.size(); i < 16; i++) { + mxpOffset2Hi.put((byte) 0); + } // Write bytes - for(int j=0; j 128) { throw new IllegalArgumentException("hub.misc/MXP_OFFSET_2_LO has invalid width (" + bs.bitLength() + "bits)"); } + if (bs.bitLength() > 128) { + throw new IllegalArgumentException( + "hub.misc/MXP_OFFSET_2_LO has invalid width (" + bs.bitLength() + "bits)"); + } // Write padding (if necessary) - for(int i=bs.size(); i<16; i++) { mxpOffset2Lo.put((byte) 0); } + for (int i = bs.size(); i < 16; i++) { + mxpOffset2Lo.put((byte) 0); + } // Write bytes - for(int j=0; j 128) { throw new IllegalArgumentException("hub.misc/MXP_SIZE_1_HI has invalid width (" + bs.bitLength() + "bits)"); } + if (bs.bitLength() > 128) { + throw new IllegalArgumentException( + "hub.misc/MXP_SIZE_1_HI has invalid width (" + bs.bitLength() + "bits)"); + } // Write padding (if necessary) - for(int i=bs.size(); i<16; i++) { mxpSize1Hi.put((byte) 0); } + for (int i = bs.size(); i < 16; i++) { + mxpSize1Hi.put((byte) 0); + } // Write bytes - for(int j=0; j 128) { throw new IllegalArgumentException("hub.misc/MXP_SIZE_1_LO has invalid width (" + bs.bitLength() + "bits)"); } + if (bs.bitLength() > 128) { + throw new IllegalArgumentException( + "hub.misc/MXP_SIZE_1_LO has invalid width (" + bs.bitLength() + "bits)"); + } // Write padding (if necessary) - for(int i=bs.size(); i<16; i++) { mxpSize1Lo.put((byte) 0); } + for (int i = bs.size(); i < 16; i++) { + mxpSize1Lo.put((byte) 0); + } // Write bytes - for(int j=0; j 128) { throw new IllegalArgumentException("hub.misc/MXP_SIZE_2_HI has invalid width (" + bs.bitLength() + "bits)"); } + if (bs.bitLength() > 128) { + throw new IllegalArgumentException( + "hub.misc/MXP_SIZE_2_HI has invalid width (" + bs.bitLength() + "bits)"); + } // Write padding (if necessary) - for(int i=bs.size(); i<16; i++) { mxpSize2Hi.put((byte) 0); } + for (int i = bs.size(); i < 16; i++) { + mxpSize2Hi.put((byte) 0); + } // Write bytes - for(int j=0; j 128) { throw new IllegalArgumentException("hub.misc/MXP_SIZE_2_LO has invalid width (" + bs.bitLength() + "bits)"); } + if (bs.bitLength() > 128) { + throw new IllegalArgumentException( + "hub.misc/MXP_SIZE_2_LO has invalid width (" + bs.bitLength() + "bits)"); + } // Write padding (if necessary) - for(int i=bs.size(); i<16; i++) { mxpSize2Lo.put((byte) 0); } + for (int i = bs.size(); i < 16; i++) { + mxpSize2Lo.put((byte) 0); + } // Write bytes - for(int j=0; j 128) { throw new IllegalArgumentException("hub.misc/MXP_WORDS has invalid width (" + bs.bitLength() + "bits)"); } + if (bs.bitLength() > 128) { + throw new IllegalArgumentException( + "hub.misc/MXP_WORDS has invalid width (" + bs.bitLength() + "bits)"); + } // Write padding (if necessary) - for(int i=bs.size(); i<16; i++) { mxpWords.put((byte) 0); } + for (int i = bs.size(); i < 16; i++) { + mxpWords.put((byte) 0); + } // Write bytes - for(int j=0; j 128) { throw new IllegalArgumentException("hub.misc/OOB_DATA_1 has invalid width (" + bs.bitLength() + "bits)"); } + if (bs.bitLength() > 128) { + throw new IllegalArgumentException( + "hub.misc/OOB_DATA_1 has invalid width (" + bs.bitLength() + "bits)"); + } // Write padding (if necessary) - for(int i=bs.size(); i<16; i++) { oobData1.put((byte) 0); } + for (int i = bs.size(); i < 16; i++) { + oobData1.put((byte) 0); + } // Write bytes - for(int j=0; j 128) { throw new IllegalArgumentException("hub.misc/OOB_DATA_2 has invalid width (" + bs.bitLength() + "bits)"); } + if (bs.bitLength() > 128) { + throw new IllegalArgumentException( + "hub.misc/OOB_DATA_2 has invalid width (" + bs.bitLength() + "bits)"); + } // Write padding (if necessary) - for(int i=bs.size(); i<16; i++) { oobData2.put((byte) 0); } + for (int i = bs.size(); i < 16; i++) { + oobData2.put((byte) 0); + } // Write bytes - for(int j=0; j 128) { throw new IllegalArgumentException("hub.misc/OOB_DATA_3 has invalid width (" + bs.bitLength() + "bits)"); } + if (bs.bitLength() > 128) { + throw new IllegalArgumentException( + "hub.misc/OOB_DATA_3 has invalid width (" + bs.bitLength() + "bits)"); + } // Write padding (if necessary) - for(int i=bs.size(); i<16; i++) { oobData3.put((byte) 0); } + for (int i = bs.size(); i < 16; i++) { + oobData3.put((byte) 0); + } // Write bytes - for(int j=0; j 128) { throw new IllegalArgumentException("hub.misc/OOB_DATA_4 has invalid width (" + bs.bitLength() + "bits)"); } + if (bs.bitLength() > 128) { + throw new IllegalArgumentException( + "hub.misc/OOB_DATA_4 has invalid width (" + bs.bitLength() + "bits)"); + } // Write padding (if necessary) - for(int i=bs.size(); i<16; i++) { oobData4.put((byte) 0); } + for (int i = bs.size(); i < 16; i++) { + oobData4.put((byte) 0); + } // Write bytes - for(int j=0; j 128) { throw new IllegalArgumentException("hub.misc/OOB_DATA_5 has invalid width (" + bs.bitLength() + "bits)"); } + if (bs.bitLength() > 128) { + throw new IllegalArgumentException( + "hub.misc/OOB_DATA_5 has invalid width (" + bs.bitLength() + "bits)"); + } // Write padding (if necessary) - for(int i=bs.size(); i<16; i++) { oobData5.put((byte) 0); } + for (int i = bs.size(); i < 16; i++) { + oobData5.put((byte) 0); + } // Write bytes - for(int j=0; j 128) { throw new IllegalArgumentException("hub.misc/OOB_DATA_6 has invalid width (" + bs.bitLength() + "bits)"); } + if (bs.bitLength() > 128) { + throw new IllegalArgumentException( + "hub.misc/OOB_DATA_6 has invalid width (" + bs.bitLength() + "bits)"); + } // Write padding (if necessary) - for(int i=bs.size(); i<16; i++) { oobData6.put((byte) 0); } + for (int i = bs.size(); i < 16; i++) { + oobData6.put((byte) 0); + } // Write bytes - for(int j=0; j 128) { throw new IllegalArgumentException("hub.misc/OOB_DATA_7 has invalid width (" + bs.bitLength() + "bits)"); } + if (bs.bitLength() > 128) { + throw new IllegalArgumentException( + "hub.misc/OOB_DATA_7 has invalid width (" + bs.bitLength() + "bits)"); + } // Write padding (if necessary) - for(int i=bs.size(); i<16; i++) { oobData7.put((byte) 0); } + for (int i = bs.size(); i < 16; i++) { + oobData7.put((byte) 0); + } // Write bytes - for(int j=0; j 128) { throw new IllegalArgumentException("hub.misc/OOB_DATA_8 has invalid width (" + bs.bitLength() + "bits)"); } + if (bs.bitLength() > 128) { + throw new IllegalArgumentException( + "hub.misc/OOB_DATA_8 has invalid width (" + bs.bitLength() + "bits)"); + } // Write padding (if necessary) - for(int i=bs.size(); i<16; i++) { oobData8.put((byte) 0); } + for (int i = bs.size(); i < 16; i++) { + oobData8.put((byte) 0); + } // Write bytes - for(int j=0; j 128) { throw new IllegalArgumentException("hub.misc/OOB_DATA_9 has invalid width (" + bs.bitLength() + "bits)"); } + if (bs.bitLength() > 128) { + throw new IllegalArgumentException( + "hub.misc/OOB_DATA_9 has invalid width (" + bs.bitLength() + "bits)"); + } // Write padding (if necessary) - for(int i=bs.size(); i<16; i++) { oobData9.put((byte) 0); } + for (int i = bs.size(); i < 16; i++) { + oobData9.put((byte) 0); + } // Write bytes - for(int j=0; j= 4294967296L) { throw new IllegalArgumentException("hub.misc/OOB_INST has invalid value (" + b + ")"); } + if (b >= 4294967296L) { + throw new IllegalArgumentException("hub.misc/OOB_INST has invalid value (" + b + ")"); + } returnAtOffsetXorOobInst.put((byte) (b >> 24)); returnAtOffsetXorOobInst.put((byte) (b >> 16)); returnAtOffsetXorOobInst.put((byte) (b >> 8)); returnAtOffsetXorOobInst.put((byte) b); - return this; } @@ -3026,7 +3814,8 @@ public Trace pMiscStpExists(final Boolean b) { filled.set(56); } - firstInBlkXorStpExistsXorCallSmcSuccessCallerWontRevertXorDecFlag4XorValueCurrIsZero.put((byte) (b ? 1 : 0)); + firstInBlkXorStpExistsXorCallSmcSuccessCallerWontRevertXorDecFlag4XorValueCurrIsZero.put( + (byte) (b ? 1 : 0)); return this; } @@ -3053,11 +3842,18 @@ public Trace pMiscStpGasHi(final Bytes b) { // Trim array to size Bytes bs = b.trimLeadingZeros(); // Sanity check against expected width - if(bs.bitLength() > 128) { throw new IllegalArgumentException("hub.misc/STP_GAS_HI has invalid width (" + bs.bitLength() + "bits)"); } + if (bs.bitLength() > 128) { + throw new IllegalArgumentException( + "hub.misc/STP_GAS_HI has invalid width (" + bs.bitLength() + "bits)"); + } // Write padding (if necessary) - for(int i=bs.size(); i<16; i++) { stpGasHi.put((byte) 0); } + for (int i = bs.size(); i < 16; i++) { + stpGasHi.put((byte) 0); + } // Write bytes - for(int j=0; j 128) { throw new IllegalArgumentException("hub.misc/STP_GAS_LO has invalid width (" + bs.bitLength() + "bits)"); } + if (bs.bitLength() > 128) { + throw new IllegalArgumentException( + "hub.misc/STP_GAS_LO has invalid width (" + bs.bitLength() + "bits)"); + } // Write padding (if necessary) - for(int i=bs.size(); i<16; i++) { stpGasLo.put((byte) 0); } + for (int i = bs.size(); i < 16; i++) { + stpGasLo.put((byte) 0); + } // Write bytes - for(int j=0; j 64) { throw new IllegalArgumentException("hub.misc/STP_GAS_MXP has invalid width (" + bs.bitLength() + "bits)"); } + if (bs.bitLength() > 64) { + throw new IllegalArgumentException( + "hub.misc/STP_GAS_MXP has invalid width (" + bs.bitLength() + "bits)"); + } // Write padding (if necessary) - for(int i=bs.size(); i<8; i++) { nonceXorStpGasMxpXorPrcCalleeGasXorBasefee.put((byte) 0); } + for (int i = bs.size(); i < 8; i++) { + nonceXorStpGasMxpXorPrcCalleeGasXorBasefee.put((byte) 0); + } // Write bytes - for(int j=0; j 64) { throw new IllegalArgumentException("hub.misc/STP_GAS_PAID_OUT_OF_POCKET has invalid width (" + bs.bitLength() + "bits)"); } + if (bs.bitLength() > 64) { + throw new IllegalArgumentException( + "hub.misc/STP_GAS_PAID_OUT_OF_POCKET has invalid width (" + bs.bitLength() + "bits)"); + } // Write padding (if necessary) - for(int i=bs.size(); i<8; i++) { nonceNewXorStpGasPaidOutOfPocketXorPrcCallerGasXorGasInitiallyAvailable.put((byte) 0); } + for (int i = bs.size(); i < 8; i++) { + nonceNewXorStpGasPaidOutOfPocketXorPrcCallerGasXorGasInitiallyAvailable.put((byte) 0); + } // Write bytes - for(int j=0; j= 4294967296L) { throw new IllegalArgumentException("hub.misc/STP_GAS_STIPEND has invalid value (" + b + ")"); } + if (b >= 4294967296L) { + throw new IllegalArgumentException("hub.misc/STP_GAS_STIPEND has invalid value (" + b + ")"); + } returnDataContextNumberXorStpGasStipend.put((byte) (b >> 24)); returnDataContextNumberXorStpGasStipend.put((byte) (b >> 16)); returnDataContextNumberXorStpGasStipend.put((byte) (b >> 8)); returnDataContextNumberXorStpGasStipend.put((byte) b); - return this; } @@ -3146,11 +3964,18 @@ public Trace pMiscStpGasUpfrontGasCost(final Bytes b) { // Trim array to size Bytes bs = b.trimLeadingZeros(); // Sanity check against expected width - if(bs.bitLength() > 64) { throw new IllegalArgumentException("hub.misc/STP_GAS_UPFRONT_GAS_COST has invalid width (" + bs.bitLength() + "bits)"); } + if (bs.bitLength() > 64) { + throw new IllegalArgumentException( + "hub.misc/STP_GAS_UPFRONT_GAS_COST has invalid width (" + bs.bitLength() + "bits)"); + } // Write padding (if necessary) - for(int i=bs.size(); i<8; i++) { stpGasUpfrontGasCostXorPrcReturnGasXorGasLeftover.put((byte) 0); } + for (int i = bs.size(); i < 8; i++) { + stpGasUpfrontGasCostXorPrcReturnGasXorGasLeftover.put((byte) 0); + } // Write bytes - for(int j=0; j= 4294967296L) { throw new IllegalArgumentException("hub.misc/STP_INSTRUCTION has invalid value (" + b + ")"); } + if (b >= 4294967296L) { + throw new IllegalArgumentException("hub.misc/STP_INSTRUCTION has invalid value (" + b + ")"); + } returnDataOffsetXorStpInstruction.put((byte) (b >> 24)); returnDataOffsetXorStpInstruction.put((byte) (b >> 16)); returnDataOffsetXorStpInstruction.put((byte) (b >> 8)); returnDataOffsetXorStpInstruction.put((byte) b); - return this; } @@ -3179,7 +4005,8 @@ public Trace pMiscStpOogx(final Boolean b) { filled.set(58); } - firstInTxnXorStpOogxXorCreateEmptyInitCodeWillRevertXorExtFlagXorValueNextIsOrig.put((byte) (b ? 1 : 0)); + firstInTxnXorStpOogxXorCreateEmptyInitCodeWillRevertXorExtFlagXorValueNextIsOrig.put( + (byte) (b ? 1 : 0)); return this; } @@ -3194,11 +4021,18 @@ public Trace pMiscStpValueHi(final Bytes b) { // Trim array to size Bytes bs = b.trimLeadingZeros(); // Sanity check against expected width - if(bs.bitLength() > 128) { throw new IllegalArgumentException("hub.misc/STP_VALUE_HI has invalid width (" + bs.bitLength() + "bits)"); } + if (bs.bitLength() > 128) { + throw new IllegalArgumentException( + "hub.misc/STP_VALUE_HI has invalid width (" + bs.bitLength() + "bits)"); + } // Write padding (if necessary) - for(int i=bs.size(); i<16; i++) { stpValueHi.put((byte) 0); } + for (int i = bs.size(); i < 16; i++) { + stpValueHi.put((byte) 0); + } // Write bytes - for(int j=0; j 128) { throw new IllegalArgumentException("hub.misc/STP_VALUE_LO has invalid width (" + bs.bitLength() + "bits)"); } + if (bs.bitLength() > 128) { + throw new IllegalArgumentException( + "hub.misc/STP_VALUE_LO has invalid width (" + bs.bitLength() + "bits)"); + } // Write padding (if necessary) - for(int i=bs.size(); i<16; i++) { stpValueLo.put((byte) 0); } + for (int i = bs.size(); i < 16; i++) { + stpValueLo.put((byte) 0); + } // Write bytes - for(int j=0; j 64) { throw new IllegalArgumentException("hub.scenario/PRC_CALLEE_GAS has invalid width (" + bs.bitLength() + "bits)"); } + if (bs.bitLength() > 64) { + throw new IllegalArgumentException( + "hub.scenario/PRC_CALLEE_GAS has invalid width (" + bs.bitLength() + "bits)"); + } // Write padding (if necessary) - for(int i=bs.size(); i<8; i++) { nonceXorStpGasMxpXorPrcCalleeGasXorBasefee.put((byte) 0); } + for (int i = bs.size(); i < 8; i++) { + nonceXorStpGasMxpXorPrcCalleeGasXorBasefee.put((byte) 0); + } // Write bytes - for(int j=0; j 64) { throw new IllegalArgumentException("hub.scenario/PRC_CALLER_GAS has invalid width (" + bs.bitLength() + "bits)"); } + if (bs.bitLength() > 64) { + throw new IllegalArgumentException( + "hub.scenario/PRC_CALLER_GAS has invalid width (" + bs.bitLength() + "bits)"); + } // Write padding (if necessary) - for(int i=bs.size(); i<8; i++) { nonceNewXorStpGasPaidOutOfPocketXorPrcCallerGasXorGasInitiallyAvailable.put((byte) 0); } + for (int i = bs.size(); i < 8; i++) { + nonceNewXorStpGasPaidOutOfPocketXorPrcCallerGasXorGasInitiallyAvailable.put((byte) 0); + } // Write bytes - for(int j=0; j= 4294967296L) { throw new IllegalArgumentException("hub.scenario/PRC_CDO has invalid value (" + b + ")"); } - addressHiXorAccountAddressHiXorCcrsStampXorPrcCdoXorStaticGasXorAddressHiXorCallDataSize.put((byte) (b >> 24)); - addressHiXorAccountAddressHiXorCcrsStampXorPrcCdoXorStaticGasXorAddressHiXorCallDataSize.put((byte) (b >> 16)); - addressHiXorAccountAddressHiXorCcrsStampXorPrcCdoXorStaticGasXorAddressHiXorCallDataSize.put((byte) (b >> 8)); - addressHiXorAccountAddressHiXorCcrsStampXorPrcCdoXorStaticGasXorAddressHiXorCallDataSize.put((byte) b); - + if (b >= 4294967296L) { + throw new IllegalArgumentException("hub.scenario/PRC_CDO has invalid value (" + b + ")"); + } + addressHiXorAccountAddressHiXorCcrsStampXorPrcCdoXorStaticGasXorAddressHiXorCallDataSize.put( + (byte) (b >> 24)); + addressHiXorAccountAddressHiXorCcrsStampXorPrcCdoXorStaticGasXorAddressHiXorCallDataSize.put( + (byte) (b >> 16)); + addressHiXorAccountAddressHiXorCcrsStampXorPrcCdoXorStaticGasXorAddressHiXorCallDataSize.put( + (byte) (b >> 8)); + addressHiXorAccountAddressHiXorCcrsStampXorPrcCdoXorStaticGasXorAddressHiXorCallDataSize.put( + (byte) b); return this; } @@ -3572,12 +4465,17 @@ public Trace pScenarioPrcCds(final long b) { filled.set(104); } - if(b >= 4294967296L) { throw new IllegalArgumentException("hub.scenario/PRC_CDS has invalid value (" + b + ")"); } - codeFragmentIndexXorAccountDeploymentNumberXorExpInstXorPrcCdsXorDeploymentNumberXorCoinbaseAddressHi.put((byte) (b >> 24)); - codeFragmentIndexXorAccountDeploymentNumberXorExpInstXorPrcCdsXorDeploymentNumberXorCoinbaseAddressHi.put((byte) (b >> 16)); - codeFragmentIndexXorAccountDeploymentNumberXorExpInstXorPrcCdsXorDeploymentNumberXorCoinbaseAddressHi.put((byte) (b >> 8)); - codeFragmentIndexXorAccountDeploymentNumberXorExpInstXorPrcCdsXorDeploymentNumberXorCoinbaseAddressHi.put((byte) b); - + if (b >= 4294967296L) { + throw new IllegalArgumentException("hub.scenario/PRC_CDS has invalid value (" + b + ")"); + } + codeFragmentIndexXorAccountDeploymentNumberXorExpInstXorPrcCdsXorDeploymentNumberXorCoinbaseAddressHi + .put((byte) (b >> 24)); + codeFragmentIndexXorAccountDeploymentNumberXorExpInstXorPrcCdsXorDeploymentNumberXorCoinbaseAddressHi + .put((byte) (b >> 16)); + codeFragmentIndexXorAccountDeploymentNumberXorExpInstXorPrcCdsXorDeploymentNumberXorCoinbaseAddressHi + .put((byte) (b >> 8)); + codeFragmentIndexXorAccountDeploymentNumberXorExpInstXorPrcCdsXorDeploymentNumberXorCoinbaseAddressHi + .put((byte) b); return this; } @@ -3685,12 +4583,17 @@ public Trace pScenarioPrcRac(final long b) { filled.set(105); } - if(b >= 4294967296L) { throw new IllegalArgumentException("hub.scenario/PRC_RAC has invalid value (" + b + ")"); } - codeSizeXorByteCodeAddressHiXorMmuAuxIdXorPrcRacXorDeploymentNumberInftyXorFromAddressHi.put((byte) (b >> 24)); - codeSizeXorByteCodeAddressHiXorMmuAuxIdXorPrcRacXorDeploymentNumberInftyXorFromAddressHi.put((byte) (b >> 16)); - codeSizeXorByteCodeAddressHiXorMmuAuxIdXorPrcRacXorDeploymentNumberInftyXorFromAddressHi.put((byte) (b >> 8)); - codeSizeXorByteCodeAddressHiXorMmuAuxIdXorPrcRacXorDeploymentNumberInftyXorFromAddressHi.put((byte) b); - + if (b >= 4294967296L) { + throw new IllegalArgumentException("hub.scenario/PRC_RAC has invalid value (" + b + ")"); + } + codeSizeXorByteCodeAddressHiXorMmuAuxIdXorPrcRacXorDeploymentNumberInftyXorFromAddressHi.put( + (byte) (b >> 24)); + codeSizeXorByteCodeAddressHiXorMmuAuxIdXorPrcRacXorDeploymentNumberInftyXorFromAddressHi.put( + (byte) (b >> 16)); + codeSizeXorByteCodeAddressHiXorMmuAuxIdXorPrcRacXorDeploymentNumberInftyXorFromAddressHi.put( + (byte) (b >> 8)); + codeSizeXorByteCodeAddressHiXorMmuAuxIdXorPrcRacXorDeploymentNumberInftyXorFromAddressHi.put( + (byte) b); return this; } @@ -3702,13 +4605,17 @@ public Trace pScenarioPrcRao(final long b) { filled.set(106); } - if(b >= 4294967296L) { throw new IllegalArgumentException("hub.scenario/PRC_RAO has invalid value (" + b + ")"); } - codeSizeNewXorByteCodeCodeFragmentIndexXorMmuExoSumXorPrcRaoXorInitCodeSize.put((byte) (b >> 24)); - codeSizeNewXorByteCodeCodeFragmentIndexXorMmuExoSumXorPrcRaoXorInitCodeSize.put((byte) (b >> 16)); - codeSizeNewXorByteCodeCodeFragmentIndexXorMmuExoSumXorPrcRaoXorInitCodeSize.put((byte) (b >> 8)); + if (b >= 4294967296L) { + throw new IllegalArgumentException("hub.scenario/PRC_RAO has invalid value (" + b + ")"); + } + codeSizeNewXorByteCodeCodeFragmentIndexXorMmuExoSumXorPrcRaoXorInitCodeSize.put( + (byte) (b >> 24)); + codeSizeNewXorByteCodeCodeFragmentIndexXorMmuExoSumXorPrcRaoXorInitCodeSize.put( + (byte) (b >> 16)); + codeSizeNewXorByteCodeCodeFragmentIndexXorMmuExoSumXorPrcRaoXorInitCodeSize.put( + (byte) (b >> 8)); codeSizeNewXorByteCodeCodeFragmentIndexXorMmuExoSumXorPrcRaoXorInitCodeSize.put((byte) b); - return this; } @@ -3722,11 +4629,18 @@ public Trace pScenarioPrcReturnGas(final Bytes b) { // Trim array to size Bytes bs = b.trimLeadingZeros(); // Sanity check against expected width - if(bs.bitLength() > 64) { throw new IllegalArgumentException("hub.scenario/PRC_RETURN_GAS has invalid width (" + bs.bitLength() + "bits)"); } + if (bs.bitLength() > 64) { + throw new IllegalArgumentException( + "hub.scenario/PRC_RETURN_GAS has invalid width (" + bs.bitLength() + "bits)"); + } // Write padding (if necessary) - for(int i=bs.size(); i<8; i++) { stpGasUpfrontGasCostXorPrcReturnGasXorGasLeftover.put((byte) 0); } + for (int i = bs.size(); i < 8; i++) { + stpGasUpfrontGasCostXorPrcReturnGasXorGasLeftover.put((byte) 0); + } // Write bytes - for(int j=0; j 128) { throw new IllegalArgumentException("hub.stack/HASH_INFO_KECCAK_HI has invalid width (" + bs.bitLength() + "bits)"); } + if (bs.bitLength() > 128) { + throw new IllegalArgumentException( + "hub.stack/HASH_INFO_KECCAK_HI has invalid width (" + bs.bitLength() + "bits)"); + } // Write padding (if necessary) - for(int i=bs.size(); i<16; i++) { addressLoXorAccountAddressLoXorExpData1XorHashInfoKeccakHiXorAddressLoXorCoinbaseAddressLo.put((byte) 0); } + for (int i = bs.size(); i < 16; i++) { + addressLoXorAccountAddressLoXorExpData1XorHashInfoKeccakHiXorAddressLoXorCoinbaseAddressLo + .put((byte) 0); + } // Write bytes - for(int j=0; j 128) { throw new IllegalArgumentException("hub.stack/HASH_INFO_KECCAK_LO has invalid width (" + bs.bitLength() + "bits)"); } + if (bs.bitLength() > 128) { + throw new IllegalArgumentException( + "hub.stack/HASH_INFO_KECCAK_LO has invalid width (" + bs.bitLength() + "bits)"); + } // Write padding (if necessary) - for(int i=bs.size(); i<16; i++) { balanceXorByteCodeAddressLoXorExpData2XorHashInfoKeccakLoXorStorageKeyHiXorFromAddressLo.put((byte) 0); } + for (int i = bs.size(); i < 16; i++) { + balanceXorByteCodeAddressLoXorExpData2XorHashInfoKeccakLoXorStorageKeyHiXorFromAddressLo.put( + (byte) 0); + } // Write bytes - for(int j=0; j 256) { throw new IllegalArgumentException("hub.stack/INSTRUCTION has invalid width (" + bs.bitLength() + "bits)"); } + if (bs.bitLength() > 256) { + throw new IllegalArgumentException( + "hub.stack/INSTRUCTION has invalid width (" + bs.bitLength() + "bits)"); + } // Write padding (if necessary) - for(int i=bs.size(); i<32; i++) { instruction.put((byte) 0); } + for (int i = bs.size(); i < 32; i++) { + instruction.put((byte) 0); + } // Write bytes - for(int j=0; j 128) { throw new IllegalArgumentException("hub.stack/PUSH_VALUE_HI has invalid width (" + bs.bitLength() + "bits)"); } + if (bs.bitLength() > 128) { + throw new IllegalArgumentException( + "hub.stack/PUSH_VALUE_HI has invalid width (" + bs.bitLength() + "bits)"); + } // Write padding (if necessary) - for(int i=bs.size(); i<16; i++) { balanceNewXorCallerAddressLoXorExpData3XorPushValueHiXorStorageKeyLoXorInitialBalance.put((byte) 0); } + for (int i = bs.size(); i < 16; i++) { + balanceNewXorCallerAddressLoXorExpData3XorPushValueHiXorStorageKeyLoXorInitialBalance.put( + (byte) 0); + } // Write bytes - for(int j=0; j 128) { throw new IllegalArgumentException("hub.stack/PUSH_VALUE_LO has invalid width (" + bs.bitLength() + "bits)"); } + if (bs.bitLength() > 128) { + throw new IllegalArgumentException( + "hub.stack/PUSH_VALUE_LO has invalid width (" + bs.bitLength() + "bits)"); + } // Write padding (if necessary) - for(int i=bs.size(); i<16; i++) { codeHashHiXorCallValueXorExpData4XorPushValueLoXorValueCurrHiXorToAddressLo.put((byte) 0); } + for (int i = bs.size(); i < 16; i++) { + codeHashHiXorCallValueXorExpData4XorPushValueLoXorValueCurrHiXorToAddressLo.put((byte) 0); + } // Write bytes - for(int j=0; j= 2048L) { throw new IllegalArgumentException("hub.stack/STACK_ITEM_HEIGHT_1 has invalid value (" + b + ")"); } + if (b >= 2048L) { + throw new IllegalArgumentException( + "hub.stack/STACK_ITEM_HEIGHT_1 has invalid value (" + b + ")"); + } callStackDepthXorStackItemHeight1.put((byte) (b >> 8)); callStackDepthXorStackItemHeight1.put((byte) b); - return this; } @@ -4496,11 +5477,13 @@ public Trace pStackStackItemHeight2(final long b) { filled.set(98); } - if(b >= 2048L) { throw new IllegalArgumentException("hub.stack/STACK_ITEM_HEIGHT_2 has invalid value (" + b + ")"); } + if (b >= 2048L) { + throw new IllegalArgumentException( + "hub.stack/STACK_ITEM_HEIGHT_2 has invalid value (" + b + ")"); + } stackItemHeight2.put((byte) (b >> 8)); stackItemHeight2.put((byte) b); - return this; } @@ -4511,11 +5494,13 @@ public Trace pStackStackItemHeight3(final long b) { filled.set(99); } - if(b >= 2048L) { throw new IllegalArgumentException("hub.stack/STACK_ITEM_HEIGHT_3 has invalid value (" + b + ")"); } + if (b >= 2048L) { + throw new IllegalArgumentException( + "hub.stack/STACK_ITEM_HEIGHT_3 has invalid value (" + b + ")"); + } stackItemHeight3.put((byte) (b >> 8)); stackItemHeight3.put((byte) b); - return this; } @@ -4526,11 +5511,13 @@ public Trace pStackStackItemHeight4(final long b) { filled.set(100); } - if(b >= 2048L) { throw new IllegalArgumentException("hub.stack/STACK_ITEM_HEIGHT_4 has invalid value (" + b + ")"); } + if (b >= 2048L) { + throw new IllegalArgumentException( + "hub.stack/STACK_ITEM_HEIGHT_4 has invalid value (" + b + ")"); + } stackItemHeight4.put((byte) (b >> 8)); stackItemHeight4.put((byte) b); - return this; } @@ -4589,14 +5576,16 @@ public Trace pStackStackItemStamp1(final long b) { filled.set(119); } - if(b >= 68719476736L) { throw new IllegalArgumentException("hub.stack/STACK_ITEM_STAMP_1 has invalid value (" + b + ")"); } + if (b >= 68719476736L) { + throw new IllegalArgumentException( + "hub.stack/STACK_ITEM_STAMP_1 has invalid value (" + b + ")"); + } stackItemStamp1.put((byte) (b >> 32)); stackItemStamp1.put((byte) (b >> 24)); stackItemStamp1.put((byte) (b >> 16)); stackItemStamp1.put((byte) (b >> 8)); stackItemStamp1.put((byte) b); - return this; } @@ -4607,14 +5596,16 @@ public Trace pStackStackItemStamp2(final long b) { filled.set(120); } - if(b >= 68719476736L) { throw new IllegalArgumentException("hub.stack/STACK_ITEM_STAMP_2 has invalid value (" + b + ")"); } + if (b >= 68719476736L) { + throw new IllegalArgumentException( + "hub.stack/STACK_ITEM_STAMP_2 has invalid value (" + b + ")"); + } stackItemStamp2.put((byte) (b >> 32)); stackItemStamp2.put((byte) (b >> 24)); stackItemStamp2.put((byte) (b >> 16)); stackItemStamp2.put((byte) (b >> 8)); stackItemStamp2.put((byte) b); - return this; } @@ -4625,14 +5616,16 @@ public Trace pStackStackItemStamp3(final long b) { filled.set(121); } - if(b >= 68719476736L) { throw new IllegalArgumentException("hub.stack/STACK_ITEM_STAMP_3 has invalid value (" + b + ")"); } + if (b >= 68719476736L) { + throw new IllegalArgumentException( + "hub.stack/STACK_ITEM_STAMP_3 has invalid value (" + b + ")"); + } stackItemStamp3.put((byte) (b >> 32)); stackItemStamp3.put((byte) (b >> 24)); stackItemStamp3.put((byte) (b >> 16)); stackItemStamp3.put((byte) (b >> 8)); stackItemStamp3.put((byte) b); - return this; } @@ -4643,14 +5636,16 @@ public Trace pStackStackItemStamp4(final long b) { filled.set(122); } - if(b >= 68719476736L) { throw new IllegalArgumentException("hub.stack/STACK_ITEM_STAMP_4 has invalid value (" + b + ")"); } + if (b >= 68719476736L) { + throw new IllegalArgumentException( + "hub.stack/STACK_ITEM_STAMP_4 has invalid value (" + b + ")"); + } stackItemStamp4.put((byte) (b >> 32)); stackItemStamp4.put((byte) (b >> 24)); stackItemStamp4.put((byte) (b >> 16)); stackItemStamp4.put((byte) (b >> 8)); stackItemStamp4.put((byte) b); - return this; } @@ -4664,11 +5659,18 @@ public Trace pStackStackItemValueHi1(final Bytes b) { // Trim array to size Bytes bs = b.trimLeadingZeros(); // Sanity check against expected width - if(bs.bitLength() > 128) { throw new IllegalArgumentException("hub.stack/STACK_ITEM_VALUE_HI_1 has invalid width (" + bs.bitLength() + "bits)"); } + if (bs.bitLength() > 128) { + throw new IllegalArgumentException( + "hub.stack/STACK_ITEM_VALUE_HI_1 has invalid width (" + bs.bitLength() + "bits)"); + } // Write padding (if necessary) - for(int i=bs.size(); i<16; i++) { codeHashHiNewXorExpData5XorStackItemValueHi1XorValueCurrLoXorValue.put((byte) 0); } + for (int i = bs.size(); i < 16; i++) { + codeHashHiNewXorExpData5XorStackItemValueHi1XorValueCurrLoXorValue.put((byte) 0); + } // Write bytes - for(int j=0; j 128) { throw new IllegalArgumentException("hub.stack/STACK_ITEM_VALUE_HI_2 has invalid width (" + bs.bitLength() + "bits)"); } + if (bs.bitLength() > 128) { + throw new IllegalArgumentException( + "hub.stack/STACK_ITEM_VALUE_HI_2 has invalid width (" + bs.bitLength() + "bits)"); + } // Write padding (if necessary) - for(int i=bs.size(); i<16; i++) { codeHashLoXorMmuLimb1XorStackItemValueHi2XorValueNextHi.put((byte) 0); } + for (int i = bs.size(); i < 16; i++) { + codeHashLoXorMmuLimb1XorStackItemValueHi2XorValueNextHi.put((byte) 0); + } // Write bytes - for(int j=0; j 128) { throw new IllegalArgumentException("hub.stack/STACK_ITEM_VALUE_HI_3 has invalid width (" + bs.bitLength() + "bits)"); } + if (bs.bitLength() > 128) { + throw new IllegalArgumentException( + "hub.stack/STACK_ITEM_VALUE_HI_3 has invalid width (" + bs.bitLength() + "bits)"); + } // Write padding (if necessary) - for(int i=bs.size(); i<16; i++) { codeHashLoNewXorMmuLimb2XorStackItemValueHi3XorValueNextLo.put((byte) 0); } + for (int i = bs.size(); i < 16; i++) { + codeHashLoNewXorMmuLimb2XorStackItemValueHi3XorValueNextLo.put((byte) 0); + } // Write bytes - for(int j=0; j 128) { throw new IllegalArgumentException("hub.stack/STACK_ITEM_VALUE_HI_4 has invalid width (" + bs.bitLength() + "bits)"); } + if (bs.bitLength() > 128) { + throw new IllegalArgumentException( + "hub.stack/STACK_ITEM_VALUE_HI_4 has invalid width (" + bs.bitLength() + "bits)"); + } // Write padding (if necessary) - for(int i=bs.size(); i<16; i++) { rlpaddrDepAddrLoXorMmuSrcOffsetHiXorStackItemValueHi4XorValueOrigHi.put((byte) 0); } + for (int i = bs.size(); i < 16; i++) { + rlpaddrDepAddrLoXorMmuSrcOffsetHiXorStackItemValueHi4XorValueOrigHi.put((byte) 0); + } // Write bytes - for(int j=0; j 128) { throw new IllegalArgumentException("hub.stack/STACK_ITEM_VALUE_LO_1 has invalid width (" + bs.bitLength() + "bits)"); } + if (bs.bitLength() > 128) { + throw new IllegalArgumentException( + "hub.stack/STACK_ITEM_VALUE_LO_1 has invalid width (" + bs.bitLength() + "bits)"); + } // Write padding (if necessary) - for(int i=bs.size(); i<16; i++) { rlpaddrKecHiXorMmuSrcOffsetLoXorStackItemValueLo1XorValueOrigLo.put((byte) 0); } + for (int i = bs.size(); i < 16; i++) { + rlpaddrKecHiXorMmuSrcOffsetLoXorStackItemValueLo1XorValueOrigLo.put((byte) 0); + } // Write bytes - for(int j=0; j 128) { throw new IllegalArgumentException("hub.stack/STACK_ITEM_VALUE_LO_2 has invalid width (" + bs.bitLength() + "bits)"); } + if (bs.bitLength() > 128) { + throw new IllegalArgumentException( + "hub.stack/STACK_ITEM_VALUE_LO_2 has invalid width (" + bs.bitLength() + "bits)"); + } // Write padding (if necessary) - for(int i=bs.size(); i<16; i++) { rlpaddrKecLoXorMmuTgtOffsetLoXorStackItemValueLo2.put((byte) 0); } + for (int i = bs.size(); i < 16; i++) { + rlpaddrKecLoXorMmuTgtOffsetLoXorStackItemValueLo2.put((byte) 0); + } // Write bytes - for(int j=0; j 128) { throw new IllegalArgumentException("hub.stack/STACK_ITEM_VALUE_LO_3 has invalid width (" + bs.bitLength() + "bits)"); } + if (bs.bitLength() > 128) { + throw new IllegalArgumentException( + "hub.stack/STACK_ITEM_VALUE_LO_3 has invalid width (" + bs.bitLength() + "bits)"); + } // Write padding (if necessary) - for(int i=bs.size(); i<16; i++) { rlpaddrSaltHiXorMxpGasMxpXorStackItemValueLo3.put((byte) 0); } + for (int i = bs.size(); i < 16; i++) { + rlpaddrSaltHiXorMxpGasMxpXorStackItemValueLo3.put((byte) 0); + } // Write bytes - for(int j=0; j 128) { throw new IllegalArgumentException("hub.stack/STACK_ITEM_VALUE_LO_4 has invalid width (" + bs.bitLength() + "bits)"); } + if (bs.bitLength() > 128) { + throw new IllegalArgumentException( + "hub.stack/STACK_ITEM_VALUE_LO_4 has invalid width (" + bs.bitLength() + "bits)"); + } // Write padding (if necessary) - for(int i=bs.size(); i<16; i++) { rlpaddrSaltLoXorMxpOffset1HiXorStackItemValueLo4.put((byte) 0); } + for (int i = bs.size(); i < 16; i++) { + rlpaddrSaltLoXorMxpOffset1HiXorStackItemValueLo4.put((byte) 0); + } // Write bytes - for(int j=0; j= 4294967296L) { throw new IllegalArgumentException("hub.stack/STATIC_GAS has invalid value (" + b + ")"); } - addressHiXorAccountAddressHiXorCcrsStampXorPrcCdoXorStaticGasXorAddressHiXorCallDataSize.put((byte) (b >> 24)); - addressHiXorAccountAddressHiXorCcrsStampXorPrcCdoXorStaticGasXorAddressHiXorCallDataSize.put((byte) (b >> 16)); - addressHiXorAccountAddressHiXorCcrsStampXorPrcCdoXorStaticGasXorAddressHiXorCallDataSize.put((byte) (b >> 8)); - addressHiXorAccountAddressHiXorCcrsStampXorPrcCdoXorStaticGasXorAddressHiXorCallDataSize.put((byte) b); - + if (b >= 4294967296L) { + throw new IllegalArgumentException("hub.stack/STATIC_GAS has invalid value (" + b + ")"); + } + addressHiXorAccountAddressHiXorCcrsStampXorPrcCdoXorStaticGasXorAddressHiXorCallDataSize.put( + (byte) (b >> 24)); + addressHiXorAccountAddressHiXorCcrsStampXorPrcCdoXorStaticGasXorAddressHiXorCallDataSize.put( + (byte) (b >> 16)); + addressHiXorAccountAddressHiXorCcrsStampXorPrcCdoXorStaticGasXorAddressHiXorCallDataSize.put( + (byte) (b >> 8)); + addressHiXorAccountAddressHiXorCcrsStampXorPrcCdoXorStaticGasXorAddressHiXorCallDataSize.put( + (byte) b); return this; } @@ -4926,12 +5982,17 @@ public Trace pStorageAddressHi(final long b) { filled.set(103); } - if(b >= 4294967296L) { throw new IllegalArgumentException("hub.storage/ADDRESS_HI has invalid value (" + b + ")"); } - addressHiXorAccountAddressHiXorCcrsStampXorPrcCdoXorStaticGasXorAddressHiXorCallDataSize.put((byte) (b >> 24)); - addressHiXorAccountAddressHiXorCcrsStampXorPrcCdoXorStaticGasXorAddressHiXorCallDataSize.put((byte) (b >> 16)); - addressHiXorAccountAddressHiXorCcrsStampXorPrcCdoXorStaticGasXorAddressHiXorCallDataSize.put((byte) (b >> 8)); - addressHiXorAccountAddressHiXorCcrsStampXorPrcCdoXorStaticGasXorAddressHiXorCallDataSize.put((byte) b); - + if (b >= 4294967296L) { + throw new IllegalArgumentException("hub.storage/ADDRESS_HI has invalid value (" + b + ")"); + } + addressHiXorAccountAddressHiXorCcrsStampXorPrcCdoXorStaticGasXorAddressHiXorCallDataSize.put( + (byte) (b >> 24)); + addressHiXorAccountAddressHiXorCcrsStampXorPrcCdoXorStaticGasXorAddressHiXorCallDataSize.put( + (byte) (b >> 16)); + addressHiXorAccountAddressHiXorCcrsStampXorPrcCdoXorStaticGasXorAddressHiXorCallDataSize.put( + (byte) (b >> 8)); + addressHiXorAccountAddressHiXorCcrsStampXorPrcCdoXorStaticGasXorAddressHiXorCallDataSize.put( + (byte) b); return this; } @@ -4946,11 +6007,20 @@ public Trace pStorageAddressLo(final Bytes b) { // Trim array to size Bytes bs = b.trimLeadingZeros(); // Sanity check against expected width - if(bs.bitLength() > 128) { throw new IllegalArgumentException("hub.storage/ADDRESS_LO has invalid width (" + bs.bitLength() + "bits)"); } + if (bs.bitLength() > 128) { + throw new IllegalArgumentException( + "hub.storage/ADDRESS_LO has invalid width (" + bs.bitLength() + "bits)"); + } // Write padding (if necessary) - for(int i=bs.size(); i<16; i++) { addressLoXorAccountAddressLoXorExpData1XorHashInfoKeccakHiXorAddressLoXorCoinbaseAddressLo.put((byte) 0); } + for (int i = bs.size(); i < 16; i++) { + addressLoXorAccountAddressLoXorExpData1XorHashInfoKeccakHiXorAddressLoXorCoinbaseAddressLo + .put((byte) 0); + } // Write bytes - for(int j=0; j= 4294967296L) { throw new IllegalArgumentException("hub.storage/DEPLOYMENT_NUMBER has invalid value (" + b + ")"); } - codeFragmentIndexXorAccountDeploymentNumberXorExpInstXorPrcCdsXorDeploymentNumberXorCoinbaseAddressHi.put((byte) (b >> 24)); - codeFragmentIndexXorAccountDeploymentNumberXorExpInstXorPrcCdsXorDeploymentNumberXorCoinbaseAddressHi.put((byte) (b >> 16)); - codeFragmentIndexXorAccountDeploymentNumberXorExpInstXorPrcCdsXorDeploymentNumberXorCoinbaseAddressHi.put((byte) (b >> 8)); - codeFragmentIndexXorAccountDeploymentNumberXorExpInstXorPrcCdsXorDeploymentNumberXorCoinbaseAddressHi.put((byte) b); - + if (b >= 4294967296L) { + throw new IllegalArgumentException( + "hub.storage/DEPLOYMENT_NUMBER has invalid value (" + b + ")"); + } + codeFragmentIndexXorAccountDeploymentNumberXorExpInstXorPrcCdsXorDeploymentNumberXorCoinbaseAddressHi + .put((byte) (b >> 24)); + codeFragmentIndexXorAccountDeploymentNumberXorExpInstXorPrcCdsXorDeploymentNumberXorCoinbaseAddressHi + .put((byte) (b >> 16)); + codeFragmentIndexXorAccountDeploymentNumberXorExpInstXorPrcCdsXorDeploymentNumberXorCoinbaseAddressHi + .put((byte) (b >> 8)); + codeFragmentIndexXorAccountDeploymentNumberXorExpInstXorPrcCdsXorDeploymentNumberXorCoinbaseAddressHi + .put((byte) b); return this; } @@ -5015,11 +6094,13 @@ public Trace pStorageDeploymentNumberFinalInBlock(final long b) { filled.set(101); } - if(b >= 65536L) { throw new IllegalArgumentException("hub.storage/DEPLOYMENT_NUMBER_FINAL_IN_BLOCK has invalid value (" + b + ")"); } + if (b >= 65536L) { + throw new IllegalArgumentException( + "hub.storage/DEPLOYMENT_NUMBER_FINAL_IN_BLOCK has invalid value (" + b + ")"); + } deploymentNumberFinalInBlockXorDeploymentNumberFinalInBlock.put((byte) (b >> 8)); deploymentNumberFinalInBlockXorDeploymentNumberFinalInBlock.put((byte) b); - return this; } @@ -5030,11 +6111,13 @@ public Trace pStorageDeploymentNumberFirstInBlock(final long b) { filled.set(102); } - if(b >= 65536L) { throw new IllegalArgumentException("hub.storage/DEPLOYMENT_NUMBER_FIRST_IN_BLOCK has invalid value (" + b + ")"); } + if (b >= 65536L) { + throw new IllegalArgumentException( + "hub.storage/DEPLOYMENT_NUMBER_FIRST_IN_BLOCK has invalid value (" + b + ")"); + } deploymentNumberFirstInBlockXorDeploymentNumberFirstInBlock.put((byte) (b >> 8)); deploymentNumberFirstInBlockXorDeploymentNumberFirstInBlock.put((byte) b); - return this; } @@ -5045,12 +6128,18 @@ public Trace pStorageDeploymentNumberInfty(final long b) { filled.set(105); } - if(b >= 4294967296L) { throw new IllegalArgumentException("hub.storage/DEPLOYMENT_NUMBER_INFTY has invalid value (" + b + ")"); } - codeSizeXorByteCodeAddressHiXorMmuAuxIdXorPrcRacXorDeploymentNumberInftyXorFromAddressHi.put((byte) (b >> 24)); - codeSizeXorByteCodeAddressHiXorMmuAuxIdXorPrcRacXorDeploymentNumberInftyXorFromAddressHi.put((byte) (b >> 16)); - codeSizeXorByteCodeAddressHiXorMmuAuxIdXorPrcRacXorDeploymentNumberInftyXorFromAddressHi.put((byte) (b >> 8)); - codeSizeXorByteCodeAddressHiXorMmuAuxIdXorPrcRacXorDeploymentNumberInftyXorFromAddressHi.put((byte) b); - + if (b >= 4294967296L) { + throw new IllegalArgumentException( + "hub.storage/DEPLOYMENT_NUMBER_INFTY has invalid value (" + b + ")"); + } + codeSizeXorByteCodeAddressHiXorMmuAuxIdXorPrcRacXorDeploymentNumberInftyXorFromAddressHi.put( + (byte) (b >> 24)); + codeSizeXorByteCodeAddressHiXorMmuAuxIdXorPrcRacXorDeploymentNumberInftyXorFromAddressHi.put( + (byte) (b >> 16)); + codeSizeXorByteCodeAddressHiXorMmuAuxIdXorPrcRacXorDeploymentNumberInftyXorFromAddressHi.put( + (byte) (b >> 8)); + codeSizeXorByteCodeAddressHiXorMmuAuxIdXorPrcRacXorDeploymentNumberInftyXorFromAddressHi.put( + (byte) b); return this; } @@ -5062,7 +6151,8 @@ public Trace pStorageFinalInBlk(final Boolean b) { filled.set(48); } - deploymentStatusXorMmuSuccessBitXorCallEoaSuccessCallerWontRevertXorBtcFlagXorFinalInBlkXorRequiresEvmExecution.put((byte) (b ? 1 : 0)); + deploymentStatusXorMmuSuccessBitXorCallEoaSuccessCallerWontRevertXorBtcFlagXorFinalInBlkXorRequiresEvmExecution + .put((byte) (b ? 1 : 0)); return this; } @@ -5074,7 +6164,8 @@ public Trace pStorageFinalInCnf(final Boolean b) { filled.set(49); } - deploymentStatusInftyXorMxpDeploysXorCallExceptionXorCallFlagXorFinalInCnfXorStatusCode.put((byte) (b ? 1 : 0)); + deploymentStatusInftyXorMxpDeploysXorCallExceptionXorCallFlagXorFinalInCnfXorStatusCode.put( + (byte) (b ? 1 : 0)); return this; } @@ -5098,7 +6189,8 @@ public Trace pStorageFirstInBlk(final Boolean b) { filled.set(51); } - existsXorMxpMtntopXorCallPrcSuccessCallerWillRevertXorCopyFlagXorFirstInBlk.put((byte) (b ? 1 : 0)); + existsXorMxpMtntopXorCallPrcSuccessCallerWillRevertXorCopyFlagXorFirstInBlk.put( + (byte) (b ? 1 : 0)); return this; } @@ -5110,7 +6202,8 @@ public Trace pStorageFirstInCnf(final Boolean b) { filled.set(52); } - existsNewXorMxpMxpxXorCallPrcSuccessCallerWontRevertXorCreateFlagXorFirstInCnf.put((byte) (b ? 1 : 0)); + existsNewXorMxpMxpxXorCallPrcSuccessCallerWontRevertXorCreateFlagXorFirstInCnf.put( + (byte) (b ? 1 : 0)); return this; } @@ -5122,7 +6215,8 @@ public Trace pStorageFirstInTxn(final Boolean b) { filled.set(53); } - finalInBlkXorMxpSize1NonzeroNoMxpxXorCallSmcFailureCallerWillRevertXorDecFlag1XorFirstInTxn.put((byte) (b ? 1 : 0)); + finalInBlkXorMxpSize1NonzeroNoMxpxXorCallSmcFailureCallerWillRevertXorDecFlag1XorFirstInTxn.put( + (byte) (b ? 1 : 0)); return this; } @@ -5137,11 +6231,20 @@ public Trace pStorageStorageKeyHi(final Bytes b) { // Trim array to size Bytes bs = b.trimLeadingZeros(); // Sanity check against expected width - if(bs.bitLength() > 128) { throw new IllegalArgumentException("hub.storage/STORAGE_KEY_HI has invalid width (" + bs.bitLength() + "bits)"); } + if (bs.bitLength() > 128) { + throw new IllegalArgumentException( + "hub.storage/STORAGE_KEY_HI has invalid width (" + bs.bitLength() + "bits)"); + } // Write padding (if necessary) - for(int i=bs.size(); i<16; i++) { balanceXorByteCodeAddressLoXorExpData2XorHashInfoKeccakLoXorStorageKeyHiXorFromAddressLo.put((byte) 0); } + for (int i = bs.size(); i < 16; i++) { + balanceXorByteCodeAddressLoXorExpData2XorHashInfoKeccakLoXorStorageKeyHiXorFromAddressLo.put( + (byte) 0); + } // Write bytes - for(int j=0; j 128) { throw new IllegalArgumentException("hub.storage/STORAGE_KEY_LO has invalid width (" + bs.bitLength() + "bits)"); } + if (bs.bitLength() > 128) { + throw new IllegalArgumentException( + "hub.storage/STORAGE_KEY_LO has invalid width (" + bs.bitLength() + "bits)"); + } // Write padding (if necessary) - for(int i=bs.size(); i<16; i++) { balanceNewXorCallerAddressLoXorExpData3XorPushValueHiXorStorageKeyLoXorInitialBalance.put((byte) 0); } + for (int i = bs.size(); i < 16; i++) { + balanceNewXorCallerAddressLoXorExpData3XorPushValueHiXorStorageKeyLoXorInitialBalance.put( + (byte) 0); + } // Write bytes - for(int j=0; j 128) { throw new IllegalArgumentException("hub.storage/VALUE_CURR_HI has invalid width (" + bs.bitLength() + "bits)"); } + if (bs.bitLength() > 128) { + throw new IllegalArgumentException( + "hub.storage/VALUE_CURR_HI has invalid width (" + bs.bitLength() + "bits)"); + } // Write padding (if necessary) - for(int i=bs.size(); i<16; i++) { codeHashHiXorCallValueXorExpData4XorPushValueLoXorValueCurrHiXorToAddressLo.put((byte) 0); } + for (int i = bs.size(); i < 16; i++) { + codeHashHiXorCallValueXorExpData4XorPushValueLoXorValueCurrHiXorToAddressLo.put((byte) 0); + } // Write bytes - for(int j=0; j 128) { throw new IllegalArgumentException("hub.storage/VALUE_CURR_LO has invalid width (" + bs.bitLength() + "bits)"); } + if (bs.bitLength() > 128) { + throw new IllegalArgumentException( + "hub.storage/VALUE_CURR_LO has invalid width (" + bs.bitLength() + "bits)"); + } // Write padding (if necessary) - for(int i=bs.size(); i<16; i++) { codeHashHiNewXorExpData5XorStackItemValueHi1XorValueCurrLoXorValue.put((byte) 0); } + for (int i = bs.size(); i < 16; i++) { + codeHashHiNewXorExpData5XorStackItemValueHi1XorValueCurrLoXorValue.put((byte) 0); + } // Write bytes - for(int j=0; j 128) { throw new IllegalArgumentException("hub.storage/VALUE_NEXT_HI has invalid width (" + bs.bitLength() + "bits)"); } + if (bs.bitLength() > 128) { + throw new IllegalArgumentException( + "hub.storage/VALUE_NEXT_HI has invalid width (" + bs.bitLength() + "bits)"); + } // Write padding (if necessary) - for(int i=bs.size(); i<16; i++) { codeHashLoXorMmuLimb1XorStackItemValueHi2XorValueNextHi.put((byte) 0); } + for (int i = bs.size(); i < 16; i++) { + codeHashLoXorMmuLimb1XorStackItemValueHi2XorValueNextHi.put((byte) 0); + } // Write bytes - for(int j=0; j 128) { throw new IllegalArgumentException("hub.storage/VALUE_NEXT_LO has invalid width (" + bs.bitLength() + "bits)"); } + if (bs.bitLength() > 128) { + throw new IllegalArgumentException( + "hub.storage/VALUE_NEXT_LO has invalid width (" + bs.bitLength() + "bits)"); + } // Write padding (if necessary) - for(int i=bs.size(); i<16; i++) { codeHashLoNewXorMmuLimb2XorStackItemValueHi3XorValueNextLo.put((byte) 0); } + for (int i = bs.size(); i < 16; i++) { + codeHashLoNewXorMmuLimb2XorStackItemValueHi3XorValueNextLo.put((byte) 0); + } // Write bytes - for(int j=0; j 128) { throw new IllegalArgumentException("hub.storage/VALUE_ORIG_HI has invalid width (" + bs.bitLength() + "bits)"); } + if (bs.bitLength() > 128) { + throw new IllegalArgumentException( + "hub.storage/VALUE_ORIG_HI has invalid width (" + bs.bitLength() + "bits)"); + } // Write padding (if necessary) - for(int i=bs.size(); i<16; i++) { rlpaddrDepAddrLoXorMmuSrcOffsetHiXorStackItemValueHi4XorValueOrigHi.put((byte) 0); } + for (int i = bs.size(); i < 16; i++) { + rlpaddrDepAddrLoXorMmuSrcOffsetHiXorStackItemValueHi4XorValueOrigHi.put((byte) 0); + } // Write bytes - for(int j=0; j 128) { throw new IllegalArgumentException("hub.storage/VALUE_ORIG_LO has invalid width (" + bs.bitLength() + "bits)"); } + if (bs.bitLength() > 128) { + throw new IllegalArgumentException( + "hub.storage/VALUE_ORIG_LO has invalid width (" + bs.bitLength() + "bits)"); + } // Write padding (if necessary) - for(int i=bs.size(); i<16; i++) { rlpaddrKecHiXorMmuSrcOffsetLoXorStackItemValueLo1XorValueOrigLo.put((byte) 0); } + for (int i = bs.size(); i < 16; i++) { + rlpaddrKecHiXorMmuSrcOffsetLoXorStackItemValueLo1XorValueOrigLo.put((byte) 0); + } // Write bytes - for(int j=0; j 64) { throw new IllegalArgumentException("hub.transaction/BASEFEE has invalid width (" + bs.bitLength() + "bits)"); } + if (bs.bitLength() > 64) { + throw new IllegalArgumentException( + "hub.transaction/BASEFEE has invalid width (" + bs.bitLength() + "bits)"); + } // Write padding (if necessary) - for(int i=bs.size(); i<8; i++) { nonceXorStpGasMxpXorPrcCalleeGasXorBasefee.put((byte) 0); } + for (int i = bs.size(); i < 8; i++) { + nonceXorStpGasMxpXorPrcCalleeGasXorBasefee.put((byte) 0); + } // Write bytes - for(int j=0; j= 4294967296L) { throw new IllegalArgumentException("hub.transaction/CALL_DATA_SIZE has invalid value (" + b + ")"); } - addressHiXorAccountAddressHiXorCcrsStampXorPrcCdoXorStaticGasXorAddressHiXorCallDataSize.put((byte) (b >> 24)); - addressHiXorAccountAddressHiXorCcrsStampXorPrcCdoXorStaticGasXorAddressHiXorCallDataSize.put((byte) (b >> 16)); - addressHiXorAccountAddressHiXorCcrsStampXorPrcCdoXorStaticGasXorAddressHiXorCallDataSize.put((byte) (b >> 8)); - addressHiXorAccountAddressHiXorCcrsStampXorPrcCdoXorStaticGasXorAddressHiXorCallDataSize.put((byte) b); - + if (b >= 4294967296L) { + throw new IllegalArgumentException( + "hub.transaction/CALL_DATA_SIZE has invalid value (" + b + ")"); + } + addressHiXorAccountAddressHiXorCcrsStampXorPrcCdoXorStaticGasXorAddressHiXorCallDataSize.put( + (byte) (b >> 24)); + addressHiXorAccountAddressHiXorCcrsStampXorPrcCdoXorStaticGasXorAddressHiXorCallDataSize.put( + (byte) (b >> 16)); + addressHiXorAccountAddressHiXorCcrsStampXorPrcCdoXorStaticGasXorAddressHiXorCallDataSize.put( + (byte) (b >> 8)); + addressHiXorAccountAddressHiXorCcrsStampXorPrcCdoXorStaticGasXorAddressHiXorCallDataSize.put( + (byte) b); return this; } @@ -5430,12 +6603,18 @@ public Trace pTransactionCoinbaseAddressHi(final long b) { filled.set(104); } - if(b >= 4294967296L) { throw new IllegalArgumentException("hub.transaction/COINBASE_ADDRESS_HI has invalid value (" + b + ")"); } - codeFragmentIndexXorAccountDeploymentNumberXorExpInstXorPrcCdsXorDeploymentNumberXorCoinbaseAddressHi.put((byte) (b >> 24)); - codeFragmentIndexXorAccountDeploymentNumberXorExpInstXorPrcCdsXorDeploymentNumberXorCoinbaseAddressHi.put((byte) (b >> 16)); - codeFragmentIndexXorAccountDeploymentNumberXorExpInstXorPrcCdsXorDeploymentNumberXorCoinbaseAddressHi.put((byte) (b >> 8)); - codeFragmentIndexXorAccountDeploymentNumberXorExpInstXorPrcCdsXorDeploymentNumberXorCoinbaseAddressHi.put((byte) b); - + if (b >= 4294967296L) { + throw new IllegalArgumentException( + "hub.transaction/COINBASE_ADDRESS_HI has invalid value (" + b + ")"); + } + codeFragmentIndexXorAccountDeploymentNumberXorExpInstXorPrcCdsXorDeploymentNumberXorCoinbaseAddressHi + .put((byte) (b >> 24)); + codeFragmentIndexXorAccountDeploymentNumberXorExpInstXorPrcCdsXorDeploymentNumberXorCoinbaseAddressHi + .put((byte) (b >> 16)); + codeFragmentIndexXorAccountDeploymentNumberXorExpInstXorPrcCdsXorDeploymentNumberXorCoinbaseAddressHi + .put((byte) (b >> 8)); + codeFragmentIndexXorAccountDeploymentNumberXorExpInstXorPrcCdsXorDeploymentNumberXorCoinbaseAddressHi + .put((byte) b); return this; } @@ -5450,11 +6629,20 @@ public Trace pTransactionCoinbaseAddressLo(final Bytes b) { // Trim array to size Bytes bs = b.trimLeadingZeros(); // Sanity check against expected width - if(bs.bitLength() > 128) { throw new IllegalArgumentException("hub.transaction/COINBASE_ADDRESS_LO has invalid width (" + bs.bitLength() + "bits)"); } + if (bs.bitLength() > 128) { + throw new IllegalArgumentException( + "hub.transaction/COINBASE_ADDRESS_LO has invalid width (" + bs.bitLength() + "bits)"); + } // Write padding (if necessary) - for(int i=bs.size(); i<16; i++) { addressLoXorAccountAddressLoXorExpData1XorHashInfoKeccakHiXorAddressLoXorCoinbaseAddressLo.put((byte) 0); } + for (int i = bs.size(); i < 16; i++) { + addressLoXorAccountAddressLoXorExpData1XorHashInfoKeccakHiXorAddressLoXorCoinbaseAddressLo + .put((byte) 0); + } // Write bytes - for(int j=0; j= 4294967296L) { throw new IllegalArgumentException("hub.transaction/FROM_ADDRESS_HI has invalid value (" + b + ")"); } - codeSizeXorByteCodeAddressHiXorMmuAuxIdXorPrcRacXorDeploymentNumberInftyXorFromAddressHi.put((byte) (b >> 24)); - codeSizeXorByteCodeAddressHiXorMmuAuxIdXorPrcRacXorDeploymentNumberInftyXorFromAddressHi.put((byte) (b >> 16)); - codeSizeXorByteCodeAddressHiXorMmuAuxIdXorPrcRacXorDeploymentNumberInftyXorFromAddressHi.put((byte) (b >> 8)); - codeSizeXorByteCodeAddressHiXorMmuAuxIdXorPrcRacXorDeploymentNumberInftyXorFromAddressHi.put((byte) b); - + if (b >= 4294967296L) { + throw new IllegalArgumentException( + "hub.transaction/FROM_ADDRESS_HI has invalid value (" + b + ")"); + } + codeSizeXorByteCodeAddressHiXorMmuAuxIdXorPrcRacXorDeploymentNumberInftyXorFromAddressHi.put( + (byte) (b >> 24)); + codeSizeXorByteCodeAddressHiXorMmuAuxIdXorPrcRacXorDeploymentNumberInftyXorFromAddressHi.put( + (byte) (b >> 16)); + codeSizeXorByteCodeAddressHiXorMmuAuxIdXorPrcRacXorDeploymentNumberInftyXorFromAddressHi.put( + (byte) (b >> 8)); + codeSizeXorByteCodeAddressHiXorMmuAuxIdXorPrcRacXorDeploymentNumberInftyXorFromAddressHi.put( + (byte) b); return this; } @@ -5498,11 +6693,20 @@ public Trace pTransactionFromAddressLo(final Bytes b) { // Trim array to size Bytes bs = b.trimLeadingZeros(); // Sanity check against expected width - if(bs.bitLength() > 128) { throw new IllegalArgumentException("hub.transaction/FROM_ADDRESS_LO has invalid width (" + bs.bitLength() + "bits)"); } + if (bs.bitLength() > 128) { + throw new IllegalArgumentException( + "hub.transaction/FROM_ADDRESS_LO has invalid width (" + bs.bitLength() + "bits)"); + } // Write padding (if necessary) - for(int i=bs.size(); i<16; i++) { balanceXorByteCodeAddressLoXorExpData2XorHashInfoKeccakLoXorStorageKeyHiXorFromAddressLo.put((byte) 0); } + for (int i = bs.size(); i < 16; i++) { + balanceXorByteCodeAddressLoXorExpData2XorHashInfoKeccakLoXorStorageKeyHiXorFromAddressLo.put( + (byte) 0); + } // Write bytes - for(int j=0; j 64) { throw new IllegalArgumentException("hub.transaction/GAS_INITIALLY_AVAILABLE has invalid width (" + bs.bitLength() + "bits)"); } + if (bs.bitLength() > 64) { + throw new IllegalArgumentException( + "hub.transaction/GAS_INITIALLY_AVAILABLE has invalid width (" + bs.bitLength() + "bits)"); + } // Write padding (if necessary) - for(int i=bs.size(); i<8; i++) { nonceNewXorStpGasPaidOutOfPocketXorPrcCallerGasXorGasInitiallyAvailable.put((byte) 0); } + for (int i = bs.size(); i < 8; i++) { + nonceNewXorStpGasPaidOutOfPocketXorPrcCallerGasXorGasInitiallyAvailable.put((byte) 0); + } // Write bytes - for(int j=0; j 64) { throw new IllegalArgumentException("hub.transaction/GAS_LEFTOVER has invalid width (" + bs.bitLength() + "bits)"); } + if (bs.bitLength() > 64) { + throw new IllegalArgumentException( + "hub.transaction/GAS_LEFTOVER has invalid width (" + bs.bitLength() + "bits)"); + } // Write padding (if necessary) - for(int i=bs.size(); i<8; i++) { stpGasUpfrontGasCostXorPrcReturnGasXorGasLeftover.put((byte) 0); } + for (int i = bs.size(); i < 8; i++) { + stpGasUpfrontGasCostXorPrcReturnGasXorGasLeftover.put((byte) 0); + } // Write bytes - for(int j=0; j 64) { throw new IllegalArgumentException("hub.transaction/GAS_LIMIT has invalid width (" + bs.bitLength() + "bits)"); } + if (bs.bitLength() > 64) { + throw new IllegalArgumentException( + "hub.transaction/GAS_LIMIT has invalid width (" + bs.bitLength() + "bits)"); + } // Write padding (if necessary) - for(int i=bs.size(); i<8; i++) { gasLimit.put((byte) 0); } + for (int i = bs.size(); i < 8; i++) { + gasLimit.put((byte) 0); + } // Write bytes - for(int j=0; j 64) { throw new IllegalArgumentException("hub.transaction/GAS_PRICE has invalid width (" + bs.bitLength() + "bits)"); } + if (bs.bitLength() > 64) { + throw new IllegalArgumentException( + "hub.transaction/GAS_PRICE has invalid width (" + bs.bitLength() + "bits)"); + } // Write padding (if necessary) - for(int i=bs.size(); i<8; i++) { gasPrice.put((byte) 0); } + for (int i = bs.size(); i < 8; i++) { + gasPrice.put((byte) 0); + } // Write bytes - for(int j=0; j= 4294967296L) { throw new IllegalArgumentException("hub.transaction/INIT_CODE_SIZE has invalid value (" + b + ")"); } - codeSizeNewXorByteCodeCodeFragmentIndexXorMmuExoSumXorPrcRaoXorInitCodeSize.put((byte) (b >> 24)); - codeSizeNewXorByteCodeCodeFragmentIndexXorMmuExoSumXorPrcRaoXorInitCodeSize.put((byte) (b >> 16)); - codeSizeNewXorByteCodeCodeFragmentIndexXorMmuExoSumXorPrcRaoXorInitCodeSize.put((byte) (b >> 8)); + if (b >= 4294967296L) { + throw new IllegalArgumentException( + "hub.transaction/INIT_CODE_SIZE has invalid value (" + b + ")"); + } + codeSizeNewXorByteCodeCodeFragmentIndexXorMmuExoSumXorPrcRaoXorInitCodeSize.put( + (byte) (b >> 24)); + codeSizeNewXorByteCodeCodeFragmentIndexXorMmuExoSumXorPrcRaoXorInitCodeSize.put( + (byte) (b >> 16)); + codeSizeNewXorByteCodeCodeFragmentIndexXorMmuExoSumXorPrcRaoXorInitCodeSize.put( + (byte) (b >> 8)); codeSizeNewXorByteCodeCodeFragmentIndexXorMmuExoSumXorPrcRaoXorInitCodeSize.put((byte) b); - return this; } @@ -5610,11 +6847,20 @@ public Trace pTransactionInitialBalance(final Bytes b) { // Trim array to size Bytes bs = b.trimLeadingZeros(); // Sanity check against expected width - if(bs.bitLength() > 128) { throw new IllegalArgumentException("hub.transaction/INITIAL_BALANCE has invalid width (" + bs.bitLength() + "bits)"); } + if (bs.bitLength() > 128) { + throw new IllegalArgumentException( + "hub.transaction/INITIAL_BALANCE has invalid width (" + bs.bitLength() + "bits)"); + } // Write padding (if necessary) - for(int i=bs.size(); i<16; i++) { balanceNewXorCallerAddressLoXorExpData3XorPushValueHiXorStorageKeyLoXorInitialBalance.put((byte) 0); } + for (int i = bs.size(); i < 16; i++) { + balanceNewXorCallerAddressLoXorExpData3XorPushValueHiXorStorageKeyLoXorInitialBalance.put( + (byte) 0); + } // Write bytes - for(int j=0; j 64) { throw new IllegalArgumentException("hub.transaction/NONCE has invalid width (" + bs.bitLength() + "bits)"); } + if (bs.bitLength() > 64) { + throw new IllegalArgumentException( + "hub.transaction/NONCE has invalid width (" + bs.bitLength() + "bits)"); + } // Write padding (if necessary) - for(int i=bs.size(); i<8; i++) { nonce.put((byte) 0); } + for (int i = bs.size(); i < 8; i++) { + nonce.put((byte) 0); + } // Write bytes - for(int j=0; j 64) { throw new IllegalArgumentException("hub.transaction/PRIORITY_FEE_PER_GAS has invalid width (" + bs.bitLength() + "bits)"); } + if (bs.bitLength() > 64) { + throw new IllegalArgumentException( + "hub.transaction/PRIORITY_FEE_PER_GAS has invalid width (" + bs.bitLength() + "bits)"); + } // Write padding (if necessary) - for(int i=bs.size(); i<8; i++) { priorityFeePerGas.put((byte) 0); } + for (int i = bs.size(); i < 8; i++) { + priorityFeePerGas.put((byte) 0); + } // Write bytes - for(int j=0; j 64) { throw new IllegalArgumentException("hub.transaction/REFUND_COUNTER_INFINITY has invalid width (" + bs.bitLength() + "bits)"); } + if (bs.bitLength() > 64) { + throw new IllegalArgumentException( + "hub.transaction/REFUND_COUNTER_INFINITY has invalid width (" + bs.bitLength() + "bits)"); + } // Write padding (if necessary) - for(int i=bs.size(); i<8; i++) { refundCounterInfinity.put((byte) 0); } + for (int i = bs.size(); i < 8; i++) { + refundCounterInfinity.put((byte) 0); + } // Write bytes - for(int j=0; j 64) { throw new IllegalArgumentException("hub.transaction/REFUND_EFFECTIVE has invalid width (" + bs.bitLength() + "bits)"); } + if (bs.bitLength() > 64) { + throw new IllegalArgumentException( + "hub.transaction/REFUND_EFFECTIVE has invalid width (" + bs.bitLength() + "bits)"); + } // Write padding (if necessary) - for(int i=bs.size(); i<8; i++) { refundEffective.put((byte) 0); } + for (int i = bs.size(); i < 8; i++) { + refundEffective.put((byte) 0); + } // Write bytes - for(int j=0; j= 4294967296L) { throw new IllegalArgumentException("hub.transaction/TO_ADDRESS_HI has invalid value (" + b + ")"); } + if (b >= 4294967296L) { + throw new IllegalArgumentException( + "hub.transaction/TO_ADDRESS_HI has invalid value (" + b + ")"); + } deploymentNumberXorByteCodeDeploymentNumberXorMmuInstXorToAddressHi.put((byte) (b >> 24)); deploymentNumberXorByteCodeDeploymentNumberXorMmuInstXorToAddressHi.put((byte) (b >> 16)); deploymentNumberXorByteCodeDeploymentNumberXorMmuInstXorToAddressHi.put((byte) (b >> 8)); deploymentNumberXorByteCodeDeploymentNumberXorMmuInstXorToAddressHi.put((byte) b); - return this; } @@ -5770,11 +7050,18 @@ public Trace pTransactionToAddressLo(final Bytes b) { // Trim array to size Bytes bs = b.trimLeadingZeros(); // Sanity check against expected width - if(bs.bitLength() > 128) { throw new IllegalArgumentException("hub.transaction/TO_ADDRESS_LO has invalid width (" + bs.bitLength() + "bits)"); } + if (bs.bitLength() > 128) { + throw new IllegalArgumentException( + "hub.transaction/TO_ADDRESS_LO has invalid width (" + bs.bitLength() + "bits)"); + } // Write padding (if necessary) - for(int i=bs.size(); i<16; i++) { codeHashHiXorCallValueXorExpData4XorPushValueLoXorValueCurrHiXorToAddressLo.put((byte) 0); } + for (int i = bs.size(); i < 16; i++) { + codeHashHiXorCallValueXorExpData4XorPushValueLoXorValueCurrHiXorToAddressLo.put((byte) 0); + } // Write bytes - for(int j=0; j 128) { throw new IllegalArgumentException("hub.transaction/VALUE has invalid width (" + bs.bitLength() + "bits)"); } + if (bs.bitLength() > 128) { + throw new IllegalArgumentException( + "hub.transaction/VALUE has invalid width (" + bs.bitLength() + "bits)"); + } // Write padding (if necessary) - for(int i=bs.size(); i<16; i++) { codeHashHiNewXorExpData5XorStackItemValueHi1XorValueCurrLoXorValue.put((byte) 0); } + for (int i = bs.size(); i < 16; i++) { + codeHashHiNewXorExpData5XorStackItemValueHi1XorValueCurrLoXorValue.put((byte) 0); + } // Write bytes - for(int j=0; j= 4294967296L) { throw new IllegalArgumentException("hub.PROGRAM_COUNTER has invalid value (" + b + ")"); } + if (b >= 4294967296L) { + throw new IllegalArgumentException("hub.PROGRAM_COUNTER has invalid value (" + b + ")"); + } programCounter.put((byte) (b >> 24)); programCounter.put((byte) (b >> 16)); programCounter.put((byte) (b >> 8)); programCounter.put((byte) b); - return this; } @@ -5906,13 +7201,14 @@ public Trace programCounterNew(final long b) { filled.set(34); } - if(b >= 4294967296L) { throw new IllegalArgumentException("hub.PROGRAM_COUNTER_NEW has invalid value (" + b + ")"); } + if (b >= 4294967296L) { + throw new IllegalArgumentException("hub.PROGRAM_COUNTER_NEW has invalid value (" + b + ")"); + } programCounterNew.put((byte) (b >> 24)); programCounterNew.put((byte) (b >> 16)); programCounterNew.put((byte) (b >> 8)); programCounterNew.put((byte) b); - return this; } @@ -5923,13 +7219,14 @@ public Trace refundCounter(final long b) { filled.set(35); } - if(b >= 4294967296L) { throw new IllegalArgumentException("hub.REFUND_COUNTER has invalid value (" + b + ")"); } + if (b >= 4294967296L) { + throw new IllegalArgumentException("hub.REFUND_COUNTER has invalid value (" + b + ")"); + } refundCounter.put((byte) (b >> 24)); refundCounter.put((byte) (b >> 16)); refundCounter.put((byte) (b >> 8)); refundCounter.put((byte) b); - return this; } @@ -5940,13 +7237,14 @@ public Trace refundCounterNew(final long b) { filled.set(36); } - if(b >= 4294967296L) { throw new IllegalArgumentException("hub.REFUND_COUNTER_NEW has invalid value (" + b + ")"); } + if (b >= 4294967296L) { + throw new IllegalArgumentException("hub.REFUND_COUNTER_NEW has invalid value (" + b + ")"); + } refundCounterNew.put((byte) (b >> 24)); refundCounterNew.put((byte) (b >> 16)); refundCounterNew.put((byte) (b >> 8)); refundCounterNew.put((byte) b); - return this; } @@ -5957,11 +7255,12 @@ public Trace relativeBlockNumber(final long b) { filled.set(37); } - if(b >= 65536L) { throw new IllegalArgumentException("hub.RELATIVE_BLOCK_NUMBER has invalid value (" + b + ")"); } + if (b >= 65536L) { + throw new IllegalArgumentException("hub.RELATIVE_BLOCK_NUMBER has invalid value (" + b + ")"); + } relativeBlockNumber.put((byte) (b >> 8)); relativeBlockNumber.put((byte) b); - return this; } @@ -5972,13 +7271,14 @@ public Trace subStamp(final long b) { filled.set(38); } - if(b >= 4294967296L) { throw new IllegalArgumentException("hub.SUB_STAMP has invalid value (" + b + ")"); } + if (b >= 4294967296L) { + throw new IllegalArgumentException("hub.SUB_STAMP has invalid value (" + b + ")"); + } subStamp.put((byte) (b >> 24)); subStamp.put((byte) (b >> 16)); subStamp.put((byte) (b >> 8)); subStamp.put((byte) b); - return this; } @@ -6060,23 +7360,28 @@ public Trace validateRow() { } if (!filled.get(103)) { - throw new IllegalStateException("hub.ADDRESS_HI_xor_ACCOUNT_ADDRESS_HI_xor_CCRS_STAMP_xor_PRC_CDO_xor_STATIC_GAS_xor_ADDRESS_HI_xor_CALL_DATA_SIZE has not been filled"); + throw new IllegalStateException( + "hub.ADDRESS_HI_xor_ACCOUNT_ADDRESS_HI_xor_CCRS_STAMP_xor_PRC_CDO_xor_STATIC_GAS_xor_ADDRESS_HI_xor_CALL_DATA_SIZE has not been filled"); } if (!filled.get(132)) { - throw new IllegalStateException("hub.ADDRESS_LO_xor_ACCOUNT_ADDRESS_LO_xor_EXP_DATA_1_xor_HASH_INFO_KECCAK_HI_xor_ADDRESS_LO_xor_COINBASE_ADDRESS_LO has not been filled"); + throw new IllegalStateException( + "hub.ADDRESS_LO_xor_ACCOUNT_ADDRESS_LO_xor_EXP_DATA_1_xor_HASH_INFO_KECCAK_HI_xor_ADDRESS_LO_xor_COINBASE_ADDRESS_LO has not been filled"); } if (!filled.get(45)) { - throw new IllegalStateException("hub.AGAIN_IN_BLK_xor_IS_ROOT_xor_CCSR_FLAG_xor_CALL_ABORT_WILL_REVERT_xor_ACC_FLAG_xor_AGAIN_IN_BLK_xor_COPY_TXCD has not been filled"); + throw new IllegalStateException( + "hub.AGAIN_IN_BLK_xor_IS_ROOT_xor_CCSR_FLAG_xor_CALL_ABORT_WILL_REVERT_xor_ACC_FLAG_xor_AGAIN_IN_BLK_xor_COPY_TXCD has not been filled"); } if (!filled.get(46)) { - throw new IllegalStateException("hub.AGAIN_IN_CNF_xor_IS_STATIC_xor_EXP_FLAG_xor_CALL_ABORT_WONT_REVERT_xor_ADD_FLAG_xor_AGAIN_IN_CNF_xor_IS_DEPLOYMENT has not been filled"); + throw new IllegalStateException( + "hub.AGAIN_IN_CNF_xor_IS_STATIC_xor_EXP_FLAG_xor_CALL_ABORT_WONT_REVERT_xor_ADD_FLAG_xor_AGAIN_IN_CNF_xor_IS_DEPLOYMENT has not been filled"); } if (!filled.get(47)) { - throw new IllegalStateException("hub.AGAIN_IN_TXN_xor_UPDATE_xor_MMU_FLAG_xor_CALL_EOA_SUCCESS_CALLER_WILL_REVERT_xor_BIN_FLAG_xor_AGAIN_IN_TXN_xor_IS_TYPE2 has not been filled"); + throw new IllegalStateException( + "hub.AGAIN_IN_TXN_xor_UPDATE_xor_MMU_FLAG_xor_CALL_EOA_SUCCESS_CALLER_WILL_REVERT_xor_BIN_FLAG_xor_AGAIN_IN_TXN_xor_IS_TYPE2 has not been filled"); } if (!filled.get(94)) { @@ -6084,11 +7389,13 @@ public Trace validateRow() { } if (!filled.get(134)) { - throw new IllegalStateException("hub.BALANCE_NEW_xor_CALLER_ADDRESS_LO_xor_EXP_DATA_3_xor_PUSH_VALUE_HI_xor_STORAGE_KEY_LO_xor_INITIAL_BALANCE has not been filled"); + throw new IllegalStateException( + "hub.BALANCE_NEW_xor_CALLER_ADDRESS_LO_xor_EXP_DATA_3_xor_PUSH_VALUE_HI_xor_STORAGE_KEY_LO_xor_INITIAL_BALANCE has not been filled"); } if (!filled.get(133)) { - throw new IllegalStateException("hub.BALANCE_xor_BYTE_CODE_ADDRESS_LO_xor_EXP_DATA_2_xor_HASH_INFO_KECCAK_LO_xor_STORAGE_KEY_HI_xor_FROM_ADDRESS_LO has not been filled"); + throw new IllegalStateException( + "hub.BALANCE_xor_BYTE_CODE_ADDRESS_LO_xor_EXP_DATA_2_xor_HASH_INFO_KECCAK_LO_xor_STORAGE_KEY_HI_xor_FROM_ADDRESS_LO has not been filled"); } if (!filled.get(111)) { @@ -6100,7 +7407,8 @@ public Trace validateRow() { } if (!filled.get(97)) { - throw new IllegalStateException("hub.CALL_STACK_DEPTH_xor_STACK_ITEM_HEIGHT_1 has not been filled"); + throw new IllegalStateException( + "hub.CALL_STACK_DEPTH_xor_STACK_ITEM_HEIGHT_1 has not been filled"); } if (!filled.get(1)) { @@ -6112,31 +7420,38 @@ public Trace validateRow() { } if (!filled.get(104)) { - throw new IllegalStateException("hub.CODE_FRAGMENT_INDEX_xor_ACCOUNT_DEPLOYMENT_NUMBER_xor_EXP_INST_xor_PRC_CDS_xor_DEPLOYMENT_NUMBER_xor_COINBASE_ADDRESS_HI has not been filled"); + throw new IllegalStateException( + "hub.CODE_FRAGMENT_INDEX_xor_ACCOUNT_DEPLOYMENT_NUMBER_xor_EXP_INST_xor_PRC_CDS_xor_DEPLOYMENT_NUMBER_xor_COINBASE_ADDRESS_HI has not been filled"); } if (!filled.get(136)) { - throw new IllegalStateException("hub.CODE_HASH_HI_NEW_xor_EXP_DATA_5_xor_STACK_ITEM_VALUE_HI_1_xor_VALUE_CURR_LO_xor_VALUE has not been filled"); + throw new IllegalStateException( + "hub.CODE_HASH_HI_NEW_xor_EXP_DATA_5_xor_STACK_ITEM_VALUE_HI_1_xor_VALUE_CURR_LO_xor_VALUE has not been filled"); } if (!filled.get(135)) { - throw new IllegalStateException("hub.CODE_HASH_HI_xor_CALL_VALUE_xor_EXP_DATA_4_xor_PUSH_VALUE_LO_xor_VALUE_CURR_HI_xor_TO_ADDRESS_LO has not been filled"); + throw new IllegalStateException( + "hub.CODE_HASH_HI_xor_CALL_VALUE_xor_EXP_DATA_4_xor_PUSH_VALUE_LO_xor_VALUE_CURR_HI_xor_TO_ADDRESS_LO has not been filled"); } if (!filled.get(138)) { - throw new IllegalStateException("hub.CODE_HASH_LO_NEW_xor_MMU_LIMB_2_xor_STACK_ITEM_VALUE_HI_3_xor_VALUE_NEXT_LO has not been filled"); + throw new IllegalStateException( + "hub.CODE_HASH_LO_NEW_xor_MMU_LIMB_2_xor_STACK_ITEM_VALUE_HI_3_xor_VALUE_NEXT_LO has not been filled"); } if (!filled.get(137)) { - throw new IllegalStateException("hub.CODE_HASH_LO_xor_MMU_LIMB_1_xor_STACK_ITEM_VALUE_HI_2_xor_VALUE_NEXT_HI has not been filled"); + throw new IllegalStateException( + "hub.CODE_HASH_LO_xor_MMU_LIMB_1_xor_STACK_ITEM_VALUE_HI_2_xor_VALUE_NEXT_HI has not been filled"); } if (!filled.get(106)) { - throw new IllegalStateException("hub.CODE_SIZE_NEW_xor_BYTE_CODE_CODE_FRAGMENT_INDEX_xor_MMU_EXO_SUM_xor_PRC_RAO_xor_INIT_CODE_SIZE has not been filled"); + throw new IllegalStateException( + "hub.CODE_SIZE_NEW_xor_BYTE_CODE_CODE_FRAGMENT_INDEX_xor_MMU_EXO_SUM_xor_PRC_RAO_xor_INIT_CODE_SIZE has not been filled"); } if (!filled.get(105)) { - throw new IllegalStateException("hub.CODE_SIZE_xor_BYTE_CODE_ADDRESS_HI_xor_MMU_AUX_ID_xor_PRC_RAC_xor_DEPLOYMENT_NUMBER_INFTY_xor_FROM_ADDRESS_HI has not been filled"); + throw new IllegalStateException( + "hub.CODE_SIZE_xor_BYTE_CODE_ADDRESS_HI_xor_MMU_AUX_ID_xor_PRC_RAC_xor_DEPLOYMENT_NUMBER_INFTY_xor_FROM_ADDRESS_HI has not been filled"); } if (!filled.get(3)) { @@ -6184,35 +7499,43 @@ public Trace validateRow() { } if (!filled.get(101)) { - throw new IllegalStateException("hub.DEPLOYMENT_NUMBER_FINAL_IN_BLOCK_xor_DEPLOYMENT_NUMBER_FINAL_IN_BLOCK has not been filled"); + throw new IllegalStateException( + "hub.DEPLOYMENT_NUMBER_FINAL_IN_BLOCK_xor_DEPLOYMENT_NUMBER_FINAL_IN_BLOCK has not been filled"); } if (!filled.get(102)) { - throw new IllegalStateException("hub.DEPLOYMENT_NUMBER_FIRST_IN_BLOCK_xor_DEPLOYMENT_NUMBER_FIRST_IN_BLOCK has not been filled"); + throw new IllegalStateException( + "hub.DEPLOYMENT_NUMBER_FIRST_IN_BLOCK_xor_DEPLOYMENT_NUMBER_FIRST_IN_BLOCK has not been filled"); } if (!filled.get(108)) { - throw new IllegalStateException("hub.DEPLOYMENT_NUMBER_INFTY_xor_BYTE_CODE_DEPLOYMENT_STATUS_xor_MMU_PHASE has not been filled"); + throw new IllegalStateException( + "hub.DEPLOYMENT_NUMBER_INFTY_xor_BYTE_CODE_DEPLOYMENT_STATUS_xor_MMU_PHASE has not been filled"); } if (!filled.get(109)) { - throw new IllegalStateException("hub.DEPLOYMENT_NUMBER_NEW_xor_CALLER_ADDRESS_HI_xor_MMU_REF_OFFSET has not been filled"); + throw new IllegalStateException( + "hub.DEPLOYMENT_NUMBER_NEW_xor_CALLER_ADDRESS_HI_xor_MMU_REF_OFFSET has not been filled"); } if (!filled.get(107)) { - throw new IllegalStateException("hub.DEPLOYMENT_NUMBER_xor_BYTE_CODE_DEPLOYMENT_NUMBER_xor_MMU_INST_xor_TO_ADDRESS_HI has not been filled"); + throw new IllegalStateException( + "hub.DEPLOYMENT_NUMBER_xor_BYTE_CODE_DEPLOYMENT_NUMBER_xor_MMU_INST_xor_TO_ADDRESS_HI has not been filled"); } if (!filled.get(49)) { - throw new IllegalStateException("hub.DEPLOYMENT_STATUS_INFTY_xor_MXP_DEPLOYS_xor_CALL_EXCEPTION_xor_CALL_FLAG_xor_FINAL_IN_CNF_xor_STATUS_CODE has not been filled"); + throw new IllegalStateException( + "hub.DEPLOYMENT_STATUS_INFTY_xor_MXP_DEPLOYS_xor_CALL_EXCEPTION_xor_CALL_FLAG_xor_FINAL_IN_CNF_xor_STATUS_CODE has not been filled"); } if (!filled.get(50)) { - throw new IllegalStateException("hub.DEPLOYMENT_STATUS_NEW_xor_MXP_FLAG_xor_CALL_PRC_FAILURE_xor_CON_FLAG_xor_FINAL_IN_TXN has not been filled"); + throw new IllegalStateException( + "hub.DEPLOYMENT_STATUS_NEW_xor_MXP_FLAG_xor_CALL_PRC_FAILURE_xor_CON_FLAG_xor_FINAL_IN_TXN has not been filled"); } if (!filled.get(48)) { - throw new IllegalStateException("hub.DEPLOYMENT_STATUS_xor_MMU_SUCCESS_BIT_xor_CALL_EOA_SUCCESS_CALLER_WONT_REVERT_xor_BTC_FLAG_xor_FINAL_IN_BLK_xor_REQUIRES_EVM_EXECUTION has not been filled"); + throw new IllegalStateException( + "hub.DEPLOYMENT_STATUS_xor_MMU_SUCCESS_BIT_xor_CALL_EOA_SUCCESS_CALLER_WONT_REVERT_xor_BTC_FLAG_xor_FINAL_IN_BLK_xor_REQUIRES_EVM_EXECUTION has not been filled"); } if (!filled.get(12)) { @@ -6224,35 +7547,43 @@ public Trace validateRow() { } if (!filled.get(52)) { - throw new IllegalStateException("hub.EXISTS_NEW_xor_MXP_MXPX_xor_CALL_PRC_SUCCESS_CALLER_WONT_REVERT_xor_CREATE_FLAG_xor_FIRST_IN_CNF has not been filled"); + throw new IllegalStateException( + "hub.EXISTS_NEW_xor_MXP_MXPX_xor_CALL_PRC_SUCCESS_CALLER_WONT_REVERT_xor_CREATE_FLAG_xor_FIRST_IN_CNF has not been filled"); } if (!filled.get(51)) { - throw new IllegalStateException("hub.EXISTS_xor_MXP_MTNTOP_xor_CALL_PRC_SUCCESS_CALLER_WILL_REVERT_xor_COPY_FLAG_xor_FIRST_IN_BLK has not been filled"); + throw new IllegalStateException( + "hub.EXISTS_xor_MXP_MTNTOP_xor_CALL_PRC_SUCCESS_CALLER_WILL_REVERT_xor_COPY_FLAG_xor_FIRST_IN_BLK has not been filled"); } if (!filled.get(53)) { - throw new IllegalStateException("hub.FINAL_IN_BLK_xor_MXP_SIZE_1_NONZERO_NO_MXPX_xor_CALL_SMC_FAILURE_CALLER_WILL_REVERT_xor_DEC_FLAG_1_xor_FIRST_IN_TXN has not been filled"); + throw new IllegalStateException( + "hub.FINAL_IN_BLK_xor_MXP_SIZE_1_NONZERO_NO_MXPX_xor_CALL_SMC_FAILURE_CALLER_WILL_REVERT_xor_DEC_FLAG_1_xor_FIRST_IN_TXN has not been filled"); } if (!filled.get(54)) { - throw new IllegalStateException("hub.FINAL_IN_CNF_xor_MXP_SIZE_2_NONZERO_NO_MXPX_xor_CALL_SMC_FAILURE_CALLER_WONT_REVERT_xor_DEC_FLAG_2_xor_VALUE_CURR_CHANGES has not been filled"); + throw new IllegalStateException( + "hub.FINAL_IN_CNF_xor_MXP_SIZE_2_NONZERO_NO_MXPX_xor_CALL_SMC_FAILURE_CALLER_WONT_REVERT_xor_DEC_FLAG_2_xor_VALUE_CURR_CHANGES has not been filled"); } if (!filled.get(55)) { - throw new IllegalStateException("hub.FINAL_IN_TXN_xor_OOB_FLAG_xor_CALL_SMC_SUCCESS_CALLER_WILL_REVERT_xor_DEC_FLAG_3_xor_VALUE_CURR_IS_ORIG has not been filled"); + throw new IllegalStateException( + "hub.FINAL_IN_TXN_xor_OOB_FLAG_xor_CALL_SMC_SUCCESS_CALLER_WILL_REVERT_xor_DEC_FLAG_3_xor_VALUE_CURR_IS_ORIG has not been filled"); } if (!filled.get(56)) { - throw new IllegalStateException("hub.FIRST_IN_BLK_xor_STP_EXISTS_xor_CALL_SMC_SUCCESS_CALLER_WONT_REVERT_xor_DEC_FLAG_4_xor_VALUE_CURR_IS_ZERO has not been filled"); + throw new IllegalStateException( + "hub.FIRST_IN_BLK_xor_STP_EXISTS_xor_CALL_SMC_SUCCESS_CALLER_WONT_REVERT_xor_DEC_FLAG_4_xor_VALUE_CURR_IS_ZERO has not been filled"); } if (!filled.get(57)) { - throw new IllegalStateException("hub.FIRST_IN_CNF_xor_STP_FLAG_xor_CREATE_ABORT_xor_DUP_FLAG_xor_VALUE_NEXT_IS_CURR has not been filled"); + throw new IllegalStateException( + "hub.FIRST_IN_CNF_xor_STP_FLAG_xor_CREATE_ABORT_xor_DUP_FLAG_xor_VALUE_NEXT_IS_CURR has not been filled"); } if (!filled.get(58)) { - throw new IllegalStateException("hub.FIRST_IN_TXN_xor_STP_OOGX_xor_CREATE_EMPTY_INIT_CODE_WILL_REVERT_xor_EXT_FLAG_xor_VALUE_NEXT_IS_ORIG has not been filled"); + throw new IllegalStateException( + "hub.FIRST_IN_TXN_xor_STP_OOGX_xor_CREATE_EMPTY_INIT_CODE_WILL_REVERT_xor_EXT_FLAG_xor_VALUE_NEXT_IS_ORIG has not been filled"); } if (!filled.get(14)) { @@ -6280,11 +7611,13 @@ public Trace validateRow() { } if (!filled.get(60)) { - throw new IllegalStateException("hub.HAS_CODE_NEW_xor_CREATE_EXCEPTION_xor_HASH_INFO_FLAG_xor_VALUE_ORIG_IS_ZERO has not been filled"); + throw new IllegalStateException( + "hub.HAS_CODE_NEW_xor_CREATE_EXCEPTION_xor_HASH_INFO_FLAG_xor_VALUE_ORIG_IS_ZERO has not been filled"); } if (!filled.get(59)) { - throw new IllegalStateException("hub.HAS_CODE_xor_STP_WARMTH_xor_CREATE_EMPTY_INIT_CODE_WONT_REVERT_xor_HALT_FLAG_xor_VALUE_NEXT_IS_ZERO has not been filled"); + throw new IllegalStateException( + "hub.HAS_CODE_xor_STP_WARMTH_xor_CREATE_EMPTY_INIT_CODE_WONT_REVERT_xor_HALT_FLAG_xor_VALUE_NEXT_IS_ZERO has not been filled"); } if (!filled.get(18)) { @@ -6308,7 +7641,8 @@ public Trace validateRow() { } if (!filled.get(61)) { - throw new IllegalStateException("hub.IS_PRECOMPILE_xor_CREATE_FAILURE_CONDITION_WILL_REVERT_xor_ICPX_xor_WARMTH has not been filled"); + throw new IllegalStateException( + "hub.IS_PRECOMPILE_xor_CREATE_FAILURE_CONDITION_WILL_REVERT_xor_ICPX_xor_WARMTH has not been filled"); } if (!filled.get(22)) { @@ -6316,11 +7650,13 @@ public Trace validateRow() { } if (!filled.get(63)) { - throw new IllegalStateException("hub.MARKED_FOR_SELFDESTRUCT_NEW_xor_CREATE_NONEMPTY_INIT_CODE_FAILURE_WILL_REVERT_xor_JUMPX has not been filled"); + throw new IllegalStateException( + "hub.MARKED_FOR_SELFDESTRUCT_NEW_xor_CREATE_NONEMPTY_INIT_CODE_FAILURE_WILL_REVERT_xor_JUMPX has not been filled"); } if (!filled.get(62)) { - throw new IllegalStateException("hub.MARKED_FOR_SELFDESTRUCT_xor_CREATE_FAILURE_CONDITION_WONT_REVERT_xor_INVALID_FLAG_xor_WARMTH_NEW has not been filled"); + throw new IllegalStateException( + "hub.MARKED_FOR_SELFDESTRUCT_xor_CREATE_FAILURE_CONDITION_WONT_REVERT_xor_INVALID_FLAG_xor_WARMTH_NEW has not been filled"); } if (!filled.get(23)) { @@ -6368,11 +7704,13 @@ public Trace validateRow() { } if (!filled.get(124)) { - throw new IllegalStateException("hub.NONCE_NEW_xor_STP_GAS_PAID_OUT_OF_POCKET_xor_PRC_CALLER_GAS_xor_GAS_INITIALLY_AVAILABLE has not been filled"); + throw new IllegalStateException( + "hub.NONCE_NEW_xor_STP_GAS_PAID_OUT_OF_POCKET_xor_PRC_CALLER_GAS_xor_GAS_INITIALLY_AVAILABLE has not been filled"); } if (!filled.get(123)) { - throw new IllegalStateException("hub.NONCE_xor_STP_GAS_MXP_xor_PRC_CALLEE_GAS_xor_BASEFEE has not been filled"); + throw new IllegalStateException( + "hub.NONCE_xor_STP_GAS_MXP_xor_PRC_CALLEE_GAS_xor_BASEFEE has not been filled"); } if (!filled.get(152)) { @@ -6452,7 +7790,8 @@ public Trace validateRow() { } if (!filled.get(72)) { - throw new IllegalStateException("hub.PRC_FAILURE_KNOWN_TO_HUB_xor_MUL_FLAG has not been filled"); + throw new IllegalStateException( + "hub.PRC_FAILURE_KNOWN_TO_HUB_xor_MUL_FLAG has not been filled"); } if (!filled.get(73)) { @@ -6476,11 +7815,13 @@ public Trace validateRow() { } if (!filled.get(78)) { - throw new IllegalStateException("hub.PRC_SUCCESS_CALLER_WILL_REVERT_xor_RDCX has not been filled"); + throw new IllegalStateException( + "hub.PRC_SUCCESS_CALLER_WILL_REVERT_xor_RDCX has not been filled"); } if (!filled.get(79)) { - throw new IllegalStateException("hub.PRC_SUCCESS_CALLER_WONT_REVERT_xor_SHF_FLAG has not been filled"); + throw new IllegalStateException( + "hub.PRC_SUCCESS_CALLER_WONT_REVERT_xor_SHF_FLAG has not been filled"); } if (!filled.get(129)) { @@ -6524,11 +7865,13 @@ public Trace validateRow() { } if (!filled.get(116)) { - throw new IllegalStateException("hub.RETURN_DATA_CONTEXT_NUMBER_xor_STP_GAS_STIPEND has not been filled"); + throw new IllegalStateException( + "hub.RETURN_DATA_CONTEXT_NUMBER_xor_STP_GAS_STIPEND has not been filled"); } if (!filled.get(117)) { - throw new IllegalStateException("hub.RETURN_DATA_OFFSET_xor_STP_INSTRUCTION has not been filled"); + throw new IllegalStateException( + "hub.RETURN_DATA_OFFSET_xor_STP_INSTRUCTION has not been filled"); } if (!filled.get(118)) { @@ -6540,47 +7883,58 @@ public Trace validateRow() { } if (!filled.get(81)) { - throw new IllegalStateException("hub.RETURN_FROM_DEPLOYMENT_EMPTY_CODE_WILL_REVERT_xor_SSTOREX has not been filled"); + throw new IllegalStateException( + "hub.RETURN_FROM_DEPLOYMENT_EMPTY_CODE_WILL_REVERT_xor_SSTOREX has not been filled"); } if (!filled.get(82)) { - throw new IllegalStateException("hub.RETURN_FROM_DEPLOYMENT_EMPTY_CODE_WONT_REVERT_xor_STACKRAM_FLAG has not been filled"); + throw new IllegalStateException( + "hub.RETURN_FROM_DEPLOYMENT_EMPTY_CODE_WONT_REVERT_xor_STACKRAM_FLAG has not been filled"); } if (!filled.get(83)) { - throw new IllegalStateException("hub.RETURN_FROM_DEPLOYMENT_NONEMPTY_CODE_WILL_REVERT_xor_STACK_ITEM_POP_1 has not been filled"); + throw new IllegalStateException( + "hub.RETURN_FROM_DEPLOYMENT_NONEMPTY_CODE_WILL_REVERT_xor_STACK_ITEM_POP_1 has not been filled"); } if (!filled.get(84)) { - throw new IllegalStateException("hub.RETURN_FROM_DEPLOYMENT_NONEMPTY_CODE_WONT_REVERT_xor_STACK_ITEM_POP_2 has not been filled"); + throw new IllegalStateException( + "hub.RETURN_FROM_DEPLOYMENT_NONEMPTY_CODE_WONT_REVERT_xor_STACK_ITEM_POP_2 has not been filled"); } if (!filled.get(85)) { - throw new IllegalStateException("hub.RETURN_FROM_MESSAGE_CALL_WILL_TOUCH_RAM_xor_STACK_ITEM_POP_3 has not been filled"); + throw new IllegalStateException( + "hub.RETURN_FROM_MESSAGE_CALL_WILL_TOUCH_RAM_xor_STACK_ITEM_POP_3 has not been filled"); } if (!filled.get(86)) { - throw new IllegalStateException("hub.RETURN_FROM_MESSAGE_CALL_WONT_TOUCH_RAM_xor_STACK_ITEM_POP_4 has not been filled"); + throw new IllegalStateException( + "hub.RETURN_FROM_MESSAGE_CALL_WONT_TOUCH_RAM_xor_STACK_ITEM_POP_4 has not been filled"); } if (!filled.get(110)) { - throw new IllegalStateException("hub.RLPADDR_DEP_ADDR_HI_xor_CALL_DATA_CONTEXT_NUMBER_xor_MMU_REF_SIZE has not been filled"); + throw new IllegalStateException( + "hub.RLPADDR_DEP_ADDR_HI_xor_CALL_DATA_CONTEXT_NUMBER_xor_MMU_REF_SIZE has not been filled"); } if (!filled.get(139)) { - throw new IllegalStateException("hub.RLPADDR_DEP_ADDR_LO_xor_MMU_SRC_OFFSET_HI_xor_STACK_ITEM_VALUE_HI_4_xor_VALUE_ORIG_HI has not been filled"); + throw new IllegalStateException( + "hub.RLPADDR_DEP_ADDR_LO_xor_MMU_SRC_OFFSET_HI_xor_STACK_ITEM_VALUE_HI_4_xor_VALUE_ORIG_HI has not been filled"); } if (!filled.get(64)) { - throw new IllegalStateException("hub.RLPADDR_FLAG_xor_CREATE_NONEMPTY_INIT_CODE_FAILURE_WONT_REVERT_xor_JUMP_DESTINATION_VETTING_REQUIRED has not been filled"); + throw new IllegalStateException( + "hub.RLPADDR_FLAG_xor_CREATE_NONEMPTY_INIT_CODE_FAILURE_WONT_REVERT_xor_JUMP_DESTINATION_VETTING_REQUIRED has not been filled"); } if (!filled.get(140)) { - throw new IllegalStateException("hub.RLPADDR_KEC_HI_xor_MMU_SRC_OFFSET_LO_xor_STACK_ITEM_VALUE_LO_1_xor_VALUE_ORIG_LO has not been filled"); + throw new IllegalStateException( + "hub.RLPADDR_KEC_HI_xor_MMU_SRC_OFFSET_LO_xor_STACK_ITEM_VALUE_LO_1_xor_VALUE_ORIG_LO has not been filled"); } if (!filled.get(141)) { - throw new IllegalStateException("hub.RLPADDR_KEC_LO_xor_MMU_TGT_OFFSET_LO_xor_STACK_ITEM_VALUE_LO_2 has not been filled"); + throw new IllegalStateException( + "hub.RLPADDR_KEC_LO_xor_MMU_TGT_OFFSET_LO_xor_STACK_ITEM_VALUE_LO_2 has not been filled"); } if (!filled.get(96)) { @@ -6588,15 +7942,18 @@ public Trace validateRow() { } if (!filled.get(142)) { - throw new IllegalStateException("hub.RLPADDR_SALT_HI_xor_MXP_GAS_MXP_xor_STACK_ITEM_VALUE_LO_3 has not been filled"); + throw new IllegalStateException( + "hub.RLPADDR_SALT_HI_xor_MXP_GAS_MXP_xor_STACK_ITEM_VALUE_LO_3 has not been filled"); } if (!filled.get(143)) { - throw new IllegalStateException("hub.RLPADDR_SALT_LO_xor_MXP_OFFSET_1_HI_xor_STACK_ITEM_VALUE_LO_4 has not been filled"); + throw new IllegalStateException( + "hub.RLPADDR_SALT_LO_xor_MXP_OFFSET_1_HI_xor_STACK_ITEM_VALUE_LO_4 has not been filled"); } if (!filled.get(65)) { - throw new IllegalStateException("hub.ROMLEX_FLAG_xor_CREATE_NONEMPTY_INIT_CODE_SUCCESS_WILL_REVERT_xor_JUMP_FLAG has not been filled"); + throw new IllegalStateException( + "hub.ROMLEX_FLAG_xor_CREATE_NONEMPTY_INIT_CODE_SUCCESS_WILL_REVERT_xor_JUMP_FLAG has not been filled"); } if (!filled.get(87)) { @@ -6604,15 +7961,18 @@ public Trace validateRow() { } if (!filled.get(88)) { - throw new IllegalStateException("hub.SELFDESTRUCT_WILL_REVERT_xor_STATIC_FLAG has not been filled"); + throw new IllegalStateException( + "hub.SELFDESTRUCT_WILL_REVERT_xor_STATIC_FLAG has not been filled"); } if (!filled.get(89)) { - throw new IllegalStateException("hub.SELFDESTRUCT_WONT_REVERT_ALREADY_MARKED_xor_STO_FLAG has not been filled"); + throw new IllegalStateException( + "hub.SELFDESTRUCT_WONT_REVERT_ALREADY_MARKED_xor_STO_FLAG has not been filled"); } if (!filled.get(90)) { - throw new IllegalStateException("hub.SELFDESTRUCT_WONT_REVERT_NOT_YET_MARKED_xor_SUX has not been filled"); + throw new IllegalStateException( + "hub.SELFDESTRUCT_WONT_REVERT_NOT_YET_MARKED_xor_SUX has not been filled"); } if (!filled.get(98)) { @@ -6652,7 +8012,8 @@ public Trace validateRow() { } if (!filled.get(125)) { - throw new IllegalStateException("hub.STP_GAS_UPFRONT_GAS_COST_xor_PRC_RETURN_GAS_xor_GAS_LEFTOVER has not been filled"); + throw new IllegalStateException( + "hub.STP_GAS_UPFRONT_GAS_COST_xor_PRC_RETURN_GAS_xor_GAS_LEFTOVER has not been filled"); } if (!filled.get(163)) { @@ -6672,11 +8033,13 @@ public Trace validateRow() { } if (!filled.get(66)) { - throw new IllegalStateException("hub.TRM_FLAG_xor_CREATE_NONEMPTY_INIT_CODE_SUCCESS_WONT_REVERT_xor_KEC_FLAG has not been filled"); + throw new IllegalStateException( + "hub.TRM_FLAG_xor_CREATE_NONEMPTY_INIT_CODE_SUCCESS_WONT_REVERT_xor_KEC_FLAG has not been filled"); } if (!filled.get(144)) { - throw new IllegalStateException("hub.TRM_RAW_ADDRESS_HI_xor_MXP_OFFSET_1_LO has not been filled"); + throw new IllegalStateException( + "hub.TRM_RAW_ADDRESS_HI_xor_MXP_OFFSET_1_LO has not been filled"); } if (!filled.get(39)) { @@ -6708,11 +8071,13 @@ public Trace validateRow() { } if (!filled.get(68)) { - throw new IllegalStateException("hub.WARMTH_NEW_xor_PRC_ECADD_xor_LOG_INFO_FLAG has not been filled"); + throw new IllegalStateException( + "hub.WARMTH_NEW_xor_PRC_ECADD_xor_LOG_INFO_FLAG has not been filled"); } if (!filled.get(67)) { - throw new IllegalStateException("hub.WARMTH_xor_PRC_BLAKE2f_xor_LOG_FLAG has not been filled"); + throw new IllegalStateException( + "hub.WARMTH_xor_PRC_BLAKE2f_xor_LOG_FLAG has not been filled"); } if (!filled.get(93)) { @@ -6731,23 +8096,43 @@ public Trace fillAndValidateRow() { } if (!filled.get(103)) { - addressHiXorAccountAddressHiXorCcrsStampXorPrcCdoXorStaticGasXorAddressHiXorCallDataSize.position(addressHiXorAccountAddressHiXorCcrsStampXorPrcCdoXorStaticGasXorAddressHiXorCallDataSize.position() + 4); + addressHiXorAccountAddressHiXorCcrsStampXorPrcCdoXorStaticGasXorAddressHiXorCallDataSize + .position( + addressHiXorAccountAddressHiXorCcrsStampXorPrcCdoXorStaticGasXorAddressHiXorCallDataSize + .position() + + 4); } if (!filled.get(132)) { - addressLoXorAccountAddressLoXorExpData1XorHashInfoKeccakHiXorAddressLoXorCoinbaseAddressLo.position(addressLoXorAccountAddressLoXorExpData1XorHashInfoKeccakHiXorAddressLoXorCoinbaseAddressLo.position() + 16); + addressLoXorAccountAddressLoXorExpData1XorHashInfoKeccakHiXorAddressLoXorCoinbaseAddressLo + .position( + addressLoXorAccountAddressLoXorExpData1XorHashInfoKeccakHiXorAddressLoXorCoinbaseAddressLo + .position() + + 16); } if (!filled.get(45)) { - againInBlkXorIsRootXorCcsrFlagXorCallAbortWillRevertXorAccFlagXorAgainInBlkXorCopyTxcd.position(againInBlkXorIsRootXorCcsrFlagXorCallAbortWillRevertXorAccFlagXorAgainInBlkXorCopyTxcd.position() + 1); + againInBlkXorIsRootXorCcsrFlagXorCallAbortWillRevertXorAccFlagXorAgainInBlkXorCopyTxcd + .position( + againInBlkXorIsRootXorCcsrFlagXorCallAbortWillRevertXorAccFlagXorAgainInBlkXorCopyTxcd + .position() + + 1); } if (!filled.get(46)) { - againInCnfXorIsStaticXorExpFlagXorCallAbortWontRevertXorAddFlagXorAgainInCnfXorIsDeployment.position(againInCnfXorIsStaticXorExpFlagXorCallAbortWontRevertXorAddFlagXorAgainInCnfXorIsDeployment.position() + 1); + againInCnfXorIsStaticXorExpFlagXorCallAbortWontRevertXorAddFlagXorAgainInCnfXorIsDeployment + .position( + againInCnfXorIsStaticXorExpFlagXorCallAbortWontRevertXorAddFlagXorAgainInCnfXorIsDeployment + .position() + + 1); } if (!filled.get(47)) { - againInTxnXorUpdateXorMmuFlagXorCallEoaSuccessCallerWillRevertXorBinFlagXorAgainInTxnXorIsType2.position(againInTxnXorUpdateXorMmuFlagXorCallEoaSuccessCallerWillRevertXorBinFlagXorAgainInTxnXorIsType2.position() + 1); + againInTxnXorUpdateXorMmuFlagXorCallEoaSuccessCallerWillRevertXorBinFlagXorAgainInTxnXorIsType2 + .position( + againInTxnXorUpdateXorMmuFlagXorCallEoaSuccessCallerWillRevertXorBinFlagXorAgainInTxnXorIsType2 + .position() + + 1); } if (!filled.get(94)) { @@ -6755,11 +8140,19 @@ public Trace fillAndValidateRow() { } if (!filled.get(134)) { - balanceNewXorCallerAddressLoXorExpData3XorPushValueHiXorStorageKeyLoXorInitialBalance.position(balanceNewXorCallerAddressLoXorExpData3XorPushValueHiXorStorageKeyLoXorInitialBalance.position() + 16); + balanceNewXorCallerAddressLoXorExpData3XorPushValueHiXorStorageKeyLoXorInitialBalance + .position( + balanceNewXorCallerAddressLoXorExpData3XorPushValueHiXorStorageKeyLoXorInitialBalance + .position() + + 16); } if (!filled.get(133)) { - balanceXorByteCodeAddressLoXorExpData2XorHashInfoKeccakLoXorStorageKeyHiXorFromAddressLo.position(balanceXorByteCodeAddressLoXorExpData2XorHashInfoKeccakLoXorStorageKeyHiXorFromAddressLo.position() + 16); + balanceXorByteCodeAddressLoXorExpData2XorHashInfoKeccakLoXorStorageKeyHiXorFromAddressLo + .position( + balanceXorByteCodeAddressLoXorExpData2XorHashInfoKeccakLoXorStorageKeyHiXorFromAddressLo + .position() + + 16); } if (!filled.get(111)) { @@ -6783,31 +8176,46 @@ public Trace fillAndValidateRow() { } if (!filled.get(104)) { - codeFragmentIndexXorAccountDeploymentNumberXorExpInstXorPrcCdsXorDeploymentNumberXorCoinbaseAddressHi.position(codeFragmentIndexXorAccountDeploymentNumberXorExpInstXorPrcCdsXorDeploymentNumberXorCoinbaseAddressHi.position() + 4); + codeFragmentIndexXorAccountDeploymentNumberXorExpInstXorPrcCdsXorDeploymentNumberXorCoinbaseAddressHi + .position( + codeFragmentIndexXorAccountDeploymentNumberXorExpInstXorPrcCdsXorDeploymentNumberXorCoinbaseAddressHi + .position() + + 4); } if (!filled.get(136)) { - codeHashHiNewXorExpData5XorStackItemValueHi1XorValueCurrLoXorValue.position(codeHashHiNewXorExpData5XorStackItemValueHi1XorValueCurrLoXorValue.position() + 16); + codeHashHiNewXorExpData5XorStackItemValueHi1XorValueCurrLoXorValue.position( + codeHashHiNewXorExpData5XorStackItemValueHi1XorValueCurrLoXorValue.position() + 16); } if (!filled.get(135)) { - codeHashHiXorCallValueXorExpData4XorPushValueLoXorValueCurrHiXorToAddressLo.position(codeHashHiXorCallValueXorExpData4XorPushValueLoXorValueCurrHiXorToAddressLo.position() + 16); + codeHashHiXorCallValueXorExpData4XorPushValueLoXorValueCurrHiXorToAddressLo.position( + codeHashHiXorCallValueXorExpData4XorPushValueLoXorValueCurrHiXorToAddressLo.position() + + 16); } if (!filled.get(138)) { - codeHashLoNewXorMmuLimb2XorStackItemValueHi3XorValueNextLo.position(codeHashLoNewXorMmuLimb2XorStackItemValueHi3XorValueNextLo.position() + 16); + codeHashLoNewXorMmuLimb2XorStackItemValueHi3XorValueNextLo.position( + codeHashLoNewXorMmuLimb2XorStackItemValueHi3XorValueNextLo.position() + 16); } if (!filled.get(137)) { - codeHashLoXorMmuLimb1XorStackItemValueHi2XorValueNextHi.position(codeHashLoXorMmuLimb1XorStackItemValueHi2XorValueNextHi.position() + 16); + codeHashLoXorMmuLimb1XorStackItemValueHi2XorValueNextHi.position( + codeHashLoXorMmuLimb1XorStackItemValueHi2XorValueNextHi.position() + 16); } if (!filled.get(106)) { - codeSizeNewXorByteCodeCodeFragmentIndexXorMmuExoSumXorPrcRaoXorInitCodeSize.position(codeSizeNewXorByteCodeCodeFragmentIndexXorMmuExoSumXorPrcRaoXorInitCodeSize.position() + 4); + codeSizeNewXorByteCodeCodeFragmentIndexXorMmuExoSumXorPrcRaoXorInitCodeSize.position( + codeSizeNewXorByteCodeCodeFragmentIndexXorMmuExoSumXorPrcRaoXorInitCodeSize.position() + + 4); } if (!filled.get(105)) { - codeSizeXorByteCodeAddressHiXorMmuAuxIdXorPrcRacXorDeploymentNumberInftyXorFromAddressHi.position(codeSizeXorByteCodeAddressHiXorMmuAuxIdXorPrcRacXorDeploymentNumberInftyXorFromAddressHi.position() + 4); + codeSizeXorByteCodeAddressHiXorMmuAuxIdXorPrcRacXorDeploymentNumberInftyXorFromAddressHi + .position( + codeSizeXorByteCodeAddressHiXorMmuAuxIdXorPrcRacXorDeploymentNumberInftyXorFromAddressHi + .position() + + 4); } if (!filled.get(3)) { @@ -6855,35 +8263,49 @@ public Trace fillAndValidateRow() { } if (!filled.get(101)) { - deploymentNumberFinalInBlockXorDeploymentNumberFinalInBlock.position(deploymentNumberFinalInBlockXorDeploymentNumberFinalInBlock.position() + 2); + deploymentNumberFinalInBlockXorDeploymentNumberFinalInBlock.position( + deploymentNumberFinalInBlockXorDeploymentNumberFinalInBlock.position() + 2); } if (!filled.get(102)) { - deploymentNumberFirstInBlockXorDeploymentNumberFirstInBlock.position(deploymentNumberFirstInBlockXorDeploymentNumberFirstInBlock.position() + 2); + deploymentNumberFirstInBlockXorDeploymentNumberFirstInBlock.position( + deploymentNumberFirstInBlockXorDeploymentNumberFirstInBlock.position() + 2); } if (!filled.get(108)) { - deploymentNumberInftyXorByteCodeDeploymentStatusXorMmuPhase.position(deploymentNumberInftyXorByteCodeDeploymentStatusXorMmuPhase.position() + 4); + deploymentNumberInftyXorByteCodeDeploymentStatusXorMmuPhase.position( + deploymentNumberInftyXorByteCodeDeploymentStatusXorMmuPhase.position() + 4); } if (!filled.get(109)) { - deploymentNumberNewXorCallerAddressHiXorMmuRefOffset.position(deploymentNumberNewXorCallerAddressHiXorMmuRefOffset.position() + 4); + deploymentNumberNewXorCallerAddressHiXorMmuRefOffset.position( + deploymentNumberNewXorCallerAddressHiXorMmuRefOffset.position() + 4); } if (!filled.get(107)) { - deploymentNumberXorByteCodeDeploymentNumberXorMmuInstXorToAddressHi.position(deploymentNumberXorByteCodeDeploymentNumberXorMmuInstXorToAddressHi.position() + 4); + deploymentNumberXorByteCodeDeploymentNumberXorMmuInstXorToAddressHi.position( + deploymentNumberXorByteCodeDeploymentNumberXorMmuInstXorToAddressHi.position() + 4); } if (!filled.get(49)) { - deploymentStatusInftyXorMxpDeploysXorCallExceptionXorCallFlagXorFinalInCnfXorStatusCode.position(deploymentStatusInftyXorMxpDeploysXorCallExceptionXorCallFlagXorFinalInCnfXorStatusCode.position() + 1); + deploymentStatusInftyXorMxpDeploysXorCallExceptionXorCallFlagXorFinalInCnfXorStatusCode + .position( + deploymentStatusInftyXorMxpDeploysXorCallExceptionXorCallFlagXorFinalInCnfXorStatusCode + .position() + + 1); } if (!filled.get(50)) { - deploymentStatusNewXorMxpFlagXorCallPrcFailureXorConFlagXorFinalInTxn.position(deploymentStatusNewXorMxpFlagXorCallPrcFailureXorConFlagXorFinalInTxn.position() + 1); + deploymentStatusNewXorMxpFlagXorCallPrcFailureXorConFlagXorFinalInTxn.position( + deploymentStatusNewXorMxpFlagXorCallPrcFailureXorConFlagXorFinalInTxn.position() + 1); } if (!filled.get(48)) { - deploymentStatusXorMmuSuccessBitXorCallEoaSuccessCallerWontRevertXorBtcFlagXorFinalInBlkXorRequiresEvmExecution.position(deploymentStatusXorMmuSuccessBitXorCallEoaSuccessCallerWontRevertXorBtcFlagXorFinalInBlkXorRequiresEvmExecution.position() + 1); + deploymentStatusXorMmuSuccessBitXorCallEoaSuccessCallerWontRevertXorBtcFlagXorFinalInBlkXorRequiresEvmExecution + .position( + deploymentStatusXorMmuSuccessBitXorCallEoaSuccessCallerWontRevertXorBtcFlagXorFinalInBlkXorRequiresEvmExecution + .position() + + 1); } if (!filled.get(12)) { @@ -6895,35 +8317,57 @@ public Trace fillAndValidateRow() { } if (!filled.get(52)) { - existsNewXorMxpMxpxXorCallPrcSuccessCallerWontRevertXorCreateFlagXorFirstInCnf.position(existsNewXorMxpMxpxXorCallPrcSuccessCallerWontRevertXorCreateFlagXorFirstInCnf.position() + 1); + existsNewXorMxpMxpxXorCallPrcSuccessCallerWontRevertXorCreateFlagXorFirstInCnf.position( + existsNewXorMxpMxpxXorCallPrcSuccessCallerWontRevertXorCreateFlagXorFirstInCnf.position() + + 1); } if (!filled.get(51)) { - existsXorMxpMtntopXorCallPrcSuccessCallerWillRevertXorCopyFlagXorFirstInBlk.position(existsXorMxpMtntopXorCallPrcSuccessCallerWillRevertXorCopyFlagXorFirstInBlk.position() + 1); + existsXorMxpMtntopXorCallPrcSuccessCallerWillRevertXorCopyFlagXorFirstInBlk.position( + existsXorMxpMtntopXorCallPrcSuccessCallerWillRevertXorCopyFlagXorFirstInBlk.position() + + 1); } if (!filled.get(53)) { - finalInBlkXorMxpSize1NonzeroNoMxpxXorCallSmcFailureCallerWillRevertXorDecFlag1XorFirstInTxn.position(finalInBlkXorMxpSize1NonzeroNoMxpxXorCallSmcFailureCallerWillRevertXorDecFlag1XorFirstInTxn.position() + 1); + finalInBlkXorMxpSize1NonzeroNoMxpxXorCallSmcFailureCallerWillRevertXorDecFlag1XorFirstInTxn + .position( + finalInBlkXorMxpSize1NonzeroNoMxpxXorCallSmcFailureCallerWillRevertXorDecFlag1XorFirstInTxn + .position() + + 1); } if (!filled.get(54)) { - finalInCnfXorMxpSize2NonzeroNoMxpxXorCallSmcFailureCallerWontRevertXorDecFlag2XorValueCurrChanges.position(finalInCnfXorMxpSize2NonzeroNoMxpxXorCallSmcFailureCallerWontRevertXorDecFlag2XorValueCurrChanges.position() + 1); + finalInCnfXorMxpSize2NonzeroNoMxpxXorCallSmcFailureCallerWontRevertXorDecFlag2XorValueCurrChanges + .position( + finalInCnfXorMxpSize2NonzeroNoMxpxXorCallSmcFailureCallerWontRevertXorDecFlag2XorValueCurrChanges + .position() + + 1); } if (!filled.get(55)) { - finalInTxnXorOobFlagXorCallSmcSuccessCallerWillRevertXorDecFlag3XorValueCurrIsOrig.position(finalInTxnXorOobFlagXorCallSmcSuccessCallerWillRevertXorDecFlag3XorValueCurrIsOrig.position() + 1); + finalInTxnXorOobFlagXorCallSmcSuccessCallerWillRevertXorDecFlag3XorValueCurrIsOrig.position( + finalInTxnXorOobFlagXorCallSmcSuccessCallerWillRevertXorDecFlag3XorValueCurrIsOrig + .position() + + 1); } if (!filled.get(56)) { - firstInBlkXorStpExistsXorCallSmcSuccessCallerWontRevertXorDecFlag4XorValueCurrIsZero.position(firstInBlkXorStpExistsXorCallSmcSuccessCallerWontRevertXorDecFlag4XorValueCurrIsZero.position() + 1); + firstInBlkXorStpExistsXorCallSmcSuccessCallerWontRevertXorDecFlag4XorValueCurrIsZero.position( + firstInBlkXorStpExistsXorCallSmcSuccessCallerWontRevertXorDecFlag4XorValueCurrIsZero + .position() + + 1); } if (!filled.get(57)) { - firstInCnfXorStpFlagXorCreateAbortXorDupFlagXorValueNextIsCurr.position(firstInCnfXorStpFlagXorCreateAbortXorDupFlagXorValueNextIsCurr.position() + 1); + firstInCnfXorStpFlagXorCreateAbortXorDupFlagXorValueNextIsCurr.position( + firstInCnfXorStpFlagXorCreateAbortXorDupFlagXorValueNextIsCurr.position() + 1); } if (!filled.get(58)) { - firstInTxnXorStpOogxXorCreateEmptyInitCodeWillRevertXorExtFlagXorValueNextIsOrig.position(firstInTxnXorStpOogxXorCreateEmptyInitCodeWillRevertXorExtFlagXorValueNextIsOrig.position() + 1); + firstInTxnXorStpOogxXorCreateEmptyInitCodeWillRevertXorExtFlagXorValueNextIsOrig.position( + firstInTxnXorStpOogxXorCreateEmptyInitCodeWillRevertXorExtFlagXorValueNextIsOrig + .position() + + 1); } if (!filled.get(14)) { @@ -6951,11 +8395,15 @@ public Trace fillAndValidateRow() { } if (!filled.get(60)) { - hasCodeNewXorCreateExceptionXorHashInfoFlagXorValueOrigIsZero.position(hasCodeNewXorCreateExceptionXorHashInfoFlagXorValueOrigIsZero.position() + 1); + hasCodeNewXorCreateExceptionXorHashInfoFlagXorValueOrigIsZero.position( + hasCodeNewXorCreateExceptionXorHashInfoFlagXorValueOrigIsZero.position() + 1); } if (!filled.get(59)) { - hasCodeXorStpWarmthXorCreateEmptyInitCodeWontRevertXorHaltFlagXorValueNextIsZero.position(hasCodeXorStpWarmthXorCreateEmptyInitCodeWontRevertXorHaltFlagXorValueNextIsZero.position() + 1); + hasCodeXorStpWarmthXorCreateEmptyInitCodeWontRevertXorHaltFlagXorValueNextIsZero.position( + hasCodeXorStpWarmthXorCreateEmptyInitCodeWontRevertXorHaltFlagXorValueNextIsZero + .position() + + 1); } if (!filled.get(18)) { @@ -6979,7 +8427,8 @@ public Trace fillAndValidateRow() { } if (!filled.get(61)) { - isPrecompileXorCreateFailureConditionWillRevertXorIcpxXorWarmth.position(isPrecompileXorCreateFailureConditionWillRevertXorIcpxXorWarmth.position() + 1); + isPrecompileXorCreateFailureConditionWillRevertXorIcpxXorWarmth.position( + isPrecompileXorCreateFailureConditionWillRevertXorIcpxXorWarmth.position() + 1); } if (!filled.get(22)) { @@ -6987,11 +8436,16 @@ public Trace fillAndValidateRow() { } if (!filled.get(63)) { - markedForSelfdestructNewXorCreateNonemptyInitCodeFailureWillRevertXorJumpx.position(markedForSelfdestructNewXorCreateNonemptyInitCodeFailureWillRevertXorJumpx.position() + 1); + markedForSelfdestructNewXorCreateNonemptyInitCodeFailureWillRevertXorJumpx.position( + markedForSelfdestructNewXorCreateNonemptyInitCodeFailureWillRevertXorJumpx.position() + + 1); } if (!filled.get(62)) { - markedForSelfdestructXorCreateFailureConditionWontRevertXorInvalidFlagXorWarmthNew.position(markedForSelfdestructXorCreateFailureConditionWontRevertXorInvalidFlagXorWarmthNew.position() + 1); + markedForSelfdestructXorCreateFailureConditionWontRevertXorInvalidFlagXorWarmthNew.position( + markedForSelfdestructXorCreateFailureConditionWontRevertXorInvalidFlagXorWarmthNew + .position() + + 1); } if (!filled.get(23)) { @@ -7039,11 +8493,13 @@ public Trace fillAndValidateRow() { } if (!filled.get(124)) { - nonceNewXorStpGasPaidOutOfPocketXorPrcCallerGasXorGasInitiallyAvailable.position(nonceNewXorStpGasPaidOutOfPocketXorPrcCallerGasXorGasInitiallyAvailable.position() + 8); + nonceNewXorStpGasPaidOutOfPocketXorPrcCallerGasXorGasInitiallyAvailable.position( + nonceNewXorStpGasPaidOutOfPocketXorPrcCallerGasXorGasInitiallyAvailable.position() + 8); } if (!filled.get(123)) { - nonceXorStpGasMxpXorPrcCalleeGasXorBasefee.position(nonceXorStpGasMxpXorPrcCalleeGasXorBasefee.position() + 8); + nonceXorStpGasMxpXorPrcCalleeGasXorBasefee.position( + nonceXorStpGasMxpXorPrcCalleeGasXorBasefee.position() + 8); } if (!filled.get(152)) { @@ -7151,7 +8607,8 @@ public Trace fillAndValidateRow() { } if (!filled.get(79)) { - prcSuccessCallerWontRevertXorShfFlag.position(prcSuccessCallerWontRevertXorShfFlag.position() + 1); + prcSuccessCallerWontRevertXorShfFlag.position( + prcSuccessCallerWontRevertXorShfFlag.position() + 1); } if (!filled.get(129)) { @@ -7195,7 +8652,8 @@ public Trace fillAndValidateRow() { } if (!filled.get(116)) { - returnDataContextNumberXorStpGasStipend.position(returnDataContextNumberXorStpGasStipend.position() + 4); + returnDataContextNumberXorStpGasStipend.position( + returnDataContextNumberXorStpGasStipend.position() + 4); } if (!filled.get(117)) { @@ -7211,47 +8669,61 @@ public Trace fillAndValidateRow() { } if (!filled.get(81)) { - returnFromDeploymentEmptyCodeWillRevertXorSstorex.position(returnFromDeploymentEmptyCodeWillRevertXorSstorex.position() + 1); + returnFromDeploymentEmptyCodeWillRevertXorSstorex.position( + returnFromDeploymentEmptyCodeWillRevertXorSstorex.position() + 1); } if (!filled.get(82)) { - returnFromDeploymentEmptyCodeWontRevertXorStackramFlag.position(returnFromDeploymentEmptyCodeWontRevertXorStackramFlag.position() + 1); + returnFromDeploymentEmptyCodeWontRevertXorStackramFlag.position( + returnFromDeploymentEmptyCodeWontRevertXorStackramFlag.position() + 1); } if (!filled.get(83)) { - returnFromDeploymentNonemptyCodeWillRevertXorStackItemPop1.position(returnFromDeploymentNonemptyCodeWillRevertXorStackItemPop1.position() + 1); + returnFromDeploymentNonemptyCodeWillRevertXorStackItemPop1.position( + returnFromDeploymentNonemptyCodeWillRevertXorStackItemPop1.position() + 1); } if (!filled.get(84)) { - returnFromDeploymentNonemptyCodeWontRevertXorStackItemPop2.position(returnFromDeploymentNonemptyCodeWontRevertXorStackItemPop2.position() + 1); + returnFromDeploymentNonemptyCodeWontRevertXorStackItemPop2.position( + returnFromDeploymentNonemptyCodeWontRevertXorStackItemPop2.position() + 1); } if (!filled.get(85)) { - returnFromMessageCallWillTouchRamXorStackItemPop3.position(returnFromMessageCallWillTouchRamXorStackItemPop3.position() + 1); + returnFromMessageCallWillTouchRamXorStackItemPop3.position( + returnFromMessageCallWillTouchRamXorStackItemPop3.position() + 1); } if (!filled.get(86)) { - returnFromMessageCallWontTouchRamXorStackItemPop4.position(returnFromMessageCallWontTouchRamXorStackItemPop4.position() + 1); + returnFromMessageCallWontTouchRamXorStackItemPop4.position( + returnFromMessageCallWontTouchRamXorStackItemPop4.position() + 1); } if (!filled.get(110)) { - rlpaddrDepAddrHiXorCallDataContextNumberXorMmuRefSize.position(rlpaddrDepAddrHiXorCallDataContextNumberXorMmuRefSize.position() + 4); + rlpaddrDepAddrHiXorCallDataContextNumberXorMmuRefSize.position( + rlpaddrDepAddrHiXorCallDataContextNumberXorMmuRefSize.position() + 4); } if (!filled.get(139)) { - rlpaddrDepAddrLoXorMmuSrcOffsetHiXorStackItemValueHi4XorValueOrigHi.position(rlpaddrDepAddrLoXorMmuSrcOffsetHiXorStackItemValueHi4XorValueOrigHi.position() + 16); + rlpaddrDepAddrLoXorMmuSrcOffsetHiXorStackItemValueHi4XorValueOrigHi.position( + rlpaddrDepAddrLoXorMmuSrcOffsetHiXorStackItemValueHi4XorValueOrigHi.position() + 16); } if (!filled.get(64)) { - rlpaddrFlagXorCreateNonemptyInitCodeFailureWontRevertXorJumpDestinationVettingRequired.position(rlpaddrFlagXorCreateNonemptyInitCodeFailureWontRevertXorJumpDestinationVettingRequired.position() + 1); + rlpaddrFlagXorCreateNonemptyInitCodeFailureWontRevertXorJumpDestinationVettingRequired + .position( + rlpaddrFlagXorCreateNonemptyInitCodeFailureWontRevertXorJumpDestinationVettingRequired + .position() + + 1); } if (!filled.get(140)) { - rlpaddrKecHiXorMmuSrcOffsetLoXorStackItemValueLo1XorValueOrigLo.position(rlpaddrKecHiXorMmuSrcOffsetLoXorStackItemValueLo1XorValueOrigLo.position() + 16); + rlpaddrKecHiXorMmuSrcOffsetLoXorStackItemValueLo1XorValueOrigLo.position( + rlpaddrKecHiXorMmuSrcOffsetLoXorStackItemValueLo1XorValueOrigLo.position() + 16); } if (!filled.get(141)) { - rlpaddrKecLoXorMmuTgtOffsetLoXorStackItemValueLo2.position(rlpaddrKecLoXorMmuTgtOffsetLoXorStackItemValueLo2.position() + 16); + rlpaddrKecLoXorMmuTgtOffsetLoXorStackItemValueLo2.position( + rlpaddrKecLoXorMmuTgtOffsetLoXorStackItemValueLo2.position() + 16); } if (!filled.get(96)) { @@ -7259,15 +8731,18 @@ public Trace fillAndValidateRow() { } if (!filled.get(142)) { - rlpaddrSaltHiXorMxpGasMxpXorStackItemValueLo3.position(rlpaddrSaltHiXorMxpGasMxpXorStackItemValueLo3.position() + 16); + rlpaddrSaltHiXorMxpGasMxpXorStackItemValueLo3.position( + rlpaddrSaltHiXorMxpGasMxpXorStackItemValueLo3.position() + 16); } if (!filled.get(143)) { - rlpaddrSaltLoXorMxpOffset1HiXorStackItemValueLo4.position(rlpaddrSaltLoXorMxpOffset1HiXorStackItemValueLo4.position() + 16); + rlpaddrSaltLoXorMxpOffset1HiXorStackItemValueLo4.position( + rlpaddrSaltLoXorMxpOffset1HiXorStackItemValueLo4.position() + 16); } if (!filled.get(65)) { - romlexFlagXorCreateNonemptyInitCodeSuccessWillRevertXorJumpFlag.position(romlexFlagXorCreateNonemptyInitCodeSuccessWillRevertXorJumpFlag.position() + 1); + romlexFlagXorCreateNonemptyInitCodeSuccessWillRevertXorJumpFlag.position( + romlexFlagXorCreateNonemptyInitCodeSuccessWillRevertXorJumpFlag.position() + 1); } if (!filled.get(87)) { @@ -7275,15 +8750,18 @@ public Trace fillAndValidateRow() { } if (!filled.get(88)) { - selfdestructWillRevertXorStaticFlag.position(selfdestructWillRevertXorStaticFlag.position() + 1); + selfdestructWillRevertXorStaticFlag.position( + selfdestructWillRevertXorStaticFlag.position() + 1); } if (!filled.get(89)) { - selfdestructWontRevertAlreadyMarkedXorStoFlag.position(selfdestructWontRevertAlreadyMarkedXorStoFlag.position() + 1); + selfdestructWontRevertAlreadyMarkedXorStoFlag.position( + selfdestructWontRevertAlreadyMarkedXorStoFlag.position() + 1); } if (!filled.get(90)) { - selfdestructWontRevertNotYetMarkedXorSux.position(selfdestructWontRevertNotYetMarkedXorSux.position() + 1); + selfdestructWontRevertNotYetMarkedXorSux.position( + selfdestructWontRevertNotYetMarkedXorSux.position() + 1); } if (!filled.get(98)) { @@ -7323,7 +8801,8 @@ public Trace fillAndValidateRow() { } if (!filled.get(125)) { - stpGasUpfrontGasCostXorPrcReturnGasXorGasLeftover.position(stpGasUpfrontGasCostXorPrcReturnGasXorGasLeftover.position() + 8); + stpGasUpfrontGasCostXorPrcReturnGasXorGasLeftover.position( + stpGasUpfrontGasCostXorPrcReturnGasXorGasLeftover.position() + 8); } if (!filled.get(163)) { @@ -7343,7 +8822,8 @@ public Trace fillAndValidateRow() { } if (!filled.get(66)) { - trmFlagXorCreateNonemptyInitCodeSuccessWontRevertXorKecFlag.position(trmFlagXorCreateNonemptyInitCodeSuccessWontRevertXorKecFlag.position() + 1); + trmFlagXorCreateNonemptyInitCodeSuccessWontRevertXorKecFlag.position( + trmFlagXorCreateNonemptyInitCodeSuccessWontRevertXorKecFlag.position() + 1); } if (!filled.get(144)) { @@ -7379,7 +8859,8 @@ public Trace fillAndValidateRow() { } if (!filled.get(68)) { - warmthNewXorPrcEcaddXorLogInfoFlag.position(warmthNewXorPrcEcaddXorLogInfoFlag.position() + 1); + warmthNewXorPrcEcaddXorLogInfoFlag.position( + warmthNewXorPrcEcaddXorLogInfoFlag.position() + 1); } if (!filled.get(67)) { diff --git a/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/callTests/smc/complexTargets/FailureWillRevertTest.java b/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/callTests/smc/complexTargets/FailureWillRevertTest.java index b689e696e8..2560ff8a88 100644 --- a/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/callTests/smc/complexTargets/FailureWillRevertTest.java +++ b/arithmetization/src/test/java/net/consensys/linea/zktracer/instructionprocessing/callTests/smc/complexTargets/FailureWillRevertTest.java @@ -14,148 +14,124 @@ */ package net.consensys.linea.zktracer.instructionprocessing.callTests.smc.complexTargets; +import static net.consensys.linea.zktracer.instructionprocessing.utilities.Calls.appendRevert; +import static net.consensys.linea.zktracer.opcode.OpCode.*; + import net.consensys.linea.testing.BytecodeCompiler; import net.consensys.linea.testing.BytecodeRunner; import net.consensys.linea.zktracer.opcode.OpCode; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.EnumSource; -import static net.consensys.linea.zktracer.instructionprocessing.utilities.Calls.appendRevert; -import static net.consensys.linea.zktracer.opcode.OpCode.*; - /** - * The following uses a smart contract that calls itself but stops after one iteration. - * At which point it reverts and its caller reverts, too. + * The following uses a smart contract that calls itself but stops after one iteration. At which + * point it reverts and its caller reverts, too. */ public class FailureWillRevertTest { - @ParameterizedTest - @EnumSource( - value = OpCode.class, - names = {"CALL", "CALLCODE", "DELEGATECALL", "STATICCALL"}) - public void singleSelfCallFailureWillRevertTest(OpCode callOpCode) { - - BytecodeCompiler program = BytecodeCompiler.newProgram(); - sloadFrom(program, 0x00); - addX(program, 0x01); - duplicateTop(program); - sstoreAt(program, 0x00); - reduceMod2(program); - negateBit(program); - - int currentSize = program.compile().size(); - - jumpToXIfTopIsZero(program, currentSize + 4 + 5); // + 4 - // top is nonzero execution path - appendRevert(program, 13, 9); // + 5 - // top is zero execution path - prepareLanding(program); - selfCall(program, callOpCode, 0xffff, 0x01); - appendRevert(program, 31, 7); - - BytecodeRunner.of(program).run(); - } - - @ParameterizedTest - @EnumSource( - value = OpCode.class, - names = {"CALL", "CALLCODE", "DELEGATECALL", "STATICCALL"}) - public void thirdSelfCallBreaksTriggeringFailureWillRevertTest(OpCode callOpCode) { - - BytecodeCompiler program = BytecodeCompiler.newProgram(); - sloadFrom(program, 0x00); - addX(program, 0x01); - duplicateTop(program); - sstoreAt(program, 0x00); - compareToX(program, 3); - - int currentSize = program.compile().size(); - - jumpToXIfTopIsZero(program, currentSize + 4 + 5); // + 4 - // top is nonzero execution path - appendRevert(program, 13, 9); // + 5 - // top is zero execution path - prepareLanding(program); - selfCall(program, callOpCode, 0xffff, 0x01); - appendRevert(program, 31, 7); - - BytecodeRunner.of(program).run(); - } - - public void sloadFrom(BytecodeCompiler program, int storageKey) { - program - .push(storageKey) - .op(SLOAD); - } - - public void addX(BytecodeCompiler program, int x) { - program - .push(x) - .op(ADD); - } - - public void duplicateTop(BytecodeCompiler program) { - program.op(DUP1); - } - - public void sstoreAt(BytecodeCompiler program, int storageKey) { - program - .push(storageKey) - .op(SSTORE); - } - - public void reduceModX(BytecodeCompiler program, int x) { - program - .push(x) - .op(SWAP1) - .op(MOD); - } - - public void reduceMod2(BytecodeCompiler program) { - reduceModX(program, 0x02); - } - - public void jumpToXIfTopIsZero(BytecodeCompiler program, int x) { - program - .op(ISZERO) - .push(x) - .op(JUMPI); - } - - public void prepareLanding(BytecodeCompiler program) { - program.op(JUMPDEST); - } - - public void selfCall(BytecodeCompiler program, OpCode callOpCode, int gas, int value) { - program - .push(0x20) - .push(0x33) - .push(0x46) - .push(0x59); // just some random bullshit - if (callOpCode.callHasValueArgument()) { - program.push(value); - } - program - .op(ADDRESS) - .push(gas) - .op(callOpCode); - - } - - /** - * This method assumes that the top of the stack is a boolean value and negates it. - * - * @param program - */ - public void negateBit(BytecodeCompiler program) { - program - .push(1) - .op(XOR); - } - - public void compareToX(BytecodeCompiler program, int x) { - program - .push(x) - .op(EQ); + @ParameterizedTest + @EnumSource( + value = OpCode.class, + names = {"CALL", "CALLCODE", "DELEGATECALL", "STATICCALL"}) + public void singleSelfCallFailureWillRevertTest(OpCode callOpCode) { + + BytecodeCompiler program = BytecodeCompiler.newProgram(); + sloadFrom(program, 0x00); + addX(program, 0x01); + duplicateTop(program); + sstoreAt(program, 0x00); + reduceMod2(program); + negateBit(program); + + int currentSize = program.compile().size(); + + jumpToXIfTopIsZero(program, currentSize + 4 + 5); // + 4 + // top is nonzero execution path + appendRevert(program, 13, 9); // + 5 + // top is zero execution path + prepareLanding(program); + selfCall(program, callOpCode, 0xffff, 0x01); + appendRevert(program, 31, 7); + + BytecodeRunner.of(program).run(); + } + + @ParameterizedTest + @EnumSource( + value = OpCode.class, + names = {"CALL", "CALLCODE", "DELEGATECALL", "STATICCALL"}) + public void thirdSelfCallBreaksTriggeringFailureWillRevertTest(OpCode callOpCode) { + + BytecodeCompiler program = BytecodeCompiler.newProgram(); + sloadFrom(program, 0x00); + addX(program, 0x01); + duplicateTop(program); + sstoreAt(program, 0x00); + compareToX(program, 3); + + int currentSize = program.compile().size(); + + jumpToXIfTopIsZero(program, currentSize + 4 + 5); // + 4 + // top is nonzero execution path + appendRevert(program, 13, 9); // + 5 + // top is zero execution path + prepareLanding(program); + selfCall(program, callOpCode, 0xffff, 0x01); + appendRevert(program, 31, 7); + + BytecodeRunner.of(program).run(); + } + + public void sloadFrom(BytecodeCompiler program, int storageKey) { + program.push(storageKey).op(SLOAD); + } + + public void addX(BytecodeCompiler program, int x) { + program.push(x).op(ADD); + } + + public void duplicateTop(BytecodeCompiler program) { + program.op(DUP1); + } + + public void sstoreAt(BytecodeCompiler program, int storageKey) { + program.push(storageKey).op(SSTORE); + } + + public void reduceModX(BytecodeCompiler program, int x) { + program.push(x).op(SWAP1).op(MOD); + } + + public void reduceMod2(BytecodeCompiler program) { + reduceModX(program, 0x02); + } + + public void jumpToXIfTopIsZero(BytecodeCompiler program, int x) { + program.op(ISZERO).push(x).op(JUMPI); + } + + public void prepareLanding(BytecodeCompiler program) { + program.op(JUMPDEST); + } + + public void selfCall(BytecodeCompiler program, OpCode callOpCode, int gas, int value) { + program.push(0x20).push(0x33).push(0x46).push(0x59); // just some random bullshit + if (callOpCode.callHasValueArgument()) { + program.push(value); } + program.op(ADDRESS).push(gas).op(callOpCode); + } + + /** + * This method assumes that the top of the stack is a boolean value and negates it. + * + * @param program + */ + public void negateBit(BytecodeCompiler program) { + program.push(1).op(XOR); + } + + public void compareToX(BytecodeCompiler program, int x) { + program.push(x).op(EQ); + } }