Skip to content

Commit

Permalink
refactor: group RLPs modules, use retro-compatible module keys (#508)
Browse files Browse the repository at this point in the history
  • Loading branch information
delehef authored Dec 20, 2023
1 parent 3ee98ea commit e656ae0
Show file tree
Hide file tree
Showing 20 changed files with 29 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@
import net.consensys.linea.zktracer.module.mod.Mod;
import net.consensys.linea.zktracer.module.mul.Mul;
import net.consensys.linea.zktracer.module.mxp.Mxp;
import net.consensys.linea.zktracer.module.rlpAddr.RlpAddr;
import net.consensys.linea.zktracer.module.rlp_txn.RlpTxn;
import net.consensys.linea.zktracer.module.rlp_txrcpt.RlpTxrcpt;
import net.consensys.linea.zktracer.module.rlp.addr.RlpAddr;
import net.consensys.linea.zktracer.module.rlp.txn.RlpTxn;
import net.consensys.linea.zktracer.module.rlp.txrcpt.RlpTxrcpt;
import net.consensys.linea.zktracer.module.rom.Rom;
import net.consensys.linea.zktracer.module.romLex.RomLex;
import net.consensys.linea.zktracer.module.shf.Shf;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@

import net.consensys.linea.zktracer.ColumnHeader;
import net.consensys.linea.zktracer.module.Module;
import net.consensys.linea.zktracer.module.rlp_txrcpt.RlpTxrcpt;
import net.consensys.linea.zktracer.module.rlp_txrcpt.RlpTxrcptChunk;
import net.consensys.linea.zktracer.module.rlp.txrcpt.RlpTxrcpt;
import net.consensys.linea.zktracer.module.rlp.txrcpt.RlpTxrcptChunk;
import org.apache.tuweni.bytes.Bytes;
import org.hyperledger.besu.evm.log.Log;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@

import net.consensys.linea.zktracer.ColumnHeader;
import net.consensys.linea.zktracer.module.Module;
import net.consensys.linea.zktracer.module.rlp_txrcpt.RlpTxrcpt;
import net.consensys.linea.zktracer.module.rlp_txrcpt.RlpTxrcptChunk;
import net.consensys.linea.zktracer.module.rlp.txrcpt.RlpTxrcpt;
import net.consensys.linea.zktracer.module.rlp.txrcpt.RlpTxrcptChunk;
import org.apache.tuweni.bytes.Bytes32;
import org.hyperledger.besu.evm.log.Log;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* SPDX-License-Identifier: Apache-2.0
*/

package net.consensys.linea.zktracer.module.rlpAddr;
package net.consensys.linea.zktracer.module.rlp.addr;

import static net.consensys.linea.zktracer.module.rlputils.Pattern.byteCounting;
import static net.consensys.linea.zktracer.types.AddressUtils.getCreate2Address;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* SPDX-License-Identifier: Apache-2.0
*/

package net.consensys.linea.zktracer.module.rlpAddr;
package net.consensys.linea.zktracer.module.rlp.addr;

import java.math.BigInteger;
import java.util.Optional;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* SPDX-License-Identifier: Apache-2.0
*/

package net.consensys.linea.zktracer.module.rlpAddr;
package net.consensys.linea.zktracer.module.rlp.addr;

import java.nio.MappedByteBuffer;
import java.util.BitSet;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* SPDX-License-Identifier: Apache-2.0
*/

package net.consensys.linea.zktracer.module.rlp_txn;
package net.consensys.linea.zktracer.module.rlp.txn;

import static net.consensys.linea.zktracer.module.Util.getTxTypeAsInt;
import static net.consensys.linea.zktracer.module.rlputils.Pattern.byteCounting;
Expand Down Expand Up @@ -65,7 +65,7 @@ public RlpTxn(RomLex _romLex) {

@Override
public String moduleKey() {
return "RLP_TXN";
return "TX_RLP";
}

public static final int LLARGE = TxnrlpTrace.LLARGE.intValue();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* SPDX-License-Identifier: Apache-2.0
*/

package net.consensys.linea.zktracer.module.rlp_txn;
package net.consensys.linea.zktracer.module.rlp.txn;

import java.util.Optional;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* SPDX-License-Identifier: Apache-2.0
*/

package net.consensys.linea.zktracer.module.rlp_txn;
package net.consensys.linea.zktracer.module.rlp.txn;

import java.math.BigInteger;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* SPDX-License-Identifier: Apache-2.0
*/

package net.consensys.linea.zktracer.module.rlp_txn;
package net.consensys.linea.zktracer.module.rlp.txn;

import java.nio.MappedByteBuffer;
import java.util.BitSet;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* SPDX-License-Identifier: Apache-2.0
*/

package net.consensys.linea.zktracer.module.rlp_txn;
package net.consensys.linea.zktracer.module.rlp.txn;

import java.math.BigInteger;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* SPDX-License-Identifier: Apache-2.0
*/

package net.consensys.linea.zktracer.module.rlp_txrcpt;
package net.consensys.linea.zktracer.module.rlp.txrcpt;

import static net.consensys.linea.zktracer.module.rlputils.Pattern.byteCounting;
import static net.consensys.linea.zktracer.module.rlputils.Pattern.outerRlpSize;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* SPDX-License-Identifier: Apache-2.0
*/

package net.consensys.linea.zktracer.module.rlp_txrcpt;
package net.consensys.linea.zktracer.module.rlp.txrcpt;

import java.util.List;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* SPDX-License-Identifier: Apache-2.0
*/

package net.consensys.linea.zktracer.module.rlp_txrcpt;
package net.consensys.linea.zktracer.module.rlp.txrcpt;

import java.math.BigInteger;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* SPDX-License-Identifier: Apache-2.0
*/

package net.consensys.linea.zktracer.module.rlp_txrcpt;
package net.consensys.linea.zktracer.module.rlp.txrcpt;

import com.fasterxml.jackson.annotation.JsonProperty;
import net.consensys.linea.zktracer.module.ModuleTrace;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* SPDX-License-Identifier: Apache-2.0
*/

package net.consensys.linea.zktracer.module.rlp_txrcpt;
package net.consensys.linea.zktracer.module.rlp.txrcpt;

import java.nio.MappedByteBuffer;
import java.util.BitSet;
Expand Down
2 changes: 1 addition & 1 deletion arithmetization/src/main/resources/spillings.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ MUL = 9
MXP = 4
MMU = 10
RLP_ADDR = 7
RLP_TXN = 7
TX_RLP = 7
RLP_TXRCPT = 7
ROM = 2
ROM_LEX = 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,9 @@ void testAdd() {
BytecodeRunner.of(BytecodeCompiler.newProgram().push(32).push(27).op(OpCode.ADD).compile())
.run();
}

@Test
void testBreakingCall() {
BytecodeRunner.of(BytecodeCompiler.newProgram().push(32).op(OpCode.CALL).compile()).run();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

import net.consensys.linea.zktracer.module.logData.LogData;
import net.consensys.linea.zktracer.module.logInfo.LogInfo;
import net.consensys.linea.zktracer.module.rlp.txrcpt.RlpTxrcpt;
import net.consensys.linea.zktracer.opcode.OpCodes;
import net.consensys.linea.zktracer.testing.ToyAccount;
import net.consensys.linea.zktracer.testing.ToyTransaction;
Expand Down
2 changes: 1 addition & 1 deletion zkevm-constraints

0 comments on commit e656ae0

Please sign in to comment.