Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

style: update name of prec limits to avoid confusion with old geth name #506

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions acceptance-tests/src/test/resources/moduleLimits.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,13 @@ BLOCK_L1SIZE = 1000000
#
# Precompiles limits
#
PRECOMPILE_ECRECOVER = 10000
PRECOMPILE_SHA2 = 10000
PRECOMPILE_RIPEMD = 10000
PRECOMPILE_ECRECOVER_EFFECTIVE_CALL = 10000
PRECOMPILE_SHA2_BLOCKS = 10000
PRECOMPILE_RIPEMD_BLOCKS = 10000
PRECOMPILE_IDENTITY = 10000
PRECOMPILE_MODEXP = 10000
PRECOMPILE_ECADD = 10000
PRECOMPILE_ECMUL = 10000
PRECOMPILE_ECPAIRING = 10000
PRECOMPILE_ECPAIRING_WEIGHTED = 10000
PRECOMPILE_BLAKE2F = 512
PRECOMPILE_MODEXP_EFFECTIVE_CALL = 10000
PRECOMPILE_ECADD_EFFECTIVE_CALL = 10000
PRECOMPILE_ECMUL_EFFECTIVE_CALL = 10000
PRECOMPILE_ECPAIRING_EFFECTIVE_CALL = 10000
PRECOMPILE_ECPAIRING_MILLER_LOOP = 10000
PRECOMPILE_BLAKE2F_ROUNDS = 512
18 changes: 9 additions & 9 deletions acceptance-tests/src/test/resources/noModuleLimits.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,13 @@ BLOCK_L1SIZE = 1000000
#
# Precompiles limits
#
PRECOMPILE_ECRECOVER = 10000
PRECOMPILE_SHA2 = 10000
PRECOMPILE_RIPEMD = 10000
PRECOMPILE_ECRECOVER_EFFECTIVE_CALL = 10000
PRECOMPILE_SHA2_BLOCKS = 10000
PRECOMPILE_RIPEMD_BLOCKS = 10000
PRECOMPILE_IDENTITY = 10000
PRECOMPILE_MODEXP = 10000
PRECOMPILE_ECADD = 10000
PRECOMPILE_ECMUL = 10000
PRECOMPILE_ECPAIRING = 10000
PRECOMPILE_ECPAIRING_WEIGHTED = 10000
PRECOMPILE_BLAKE2F = 512
PRECOMPILE_MODEXP_EFFECTIVE_CALL = 10000
PRECOMPILE_ECADD_EFFECTIVE_CALL = 10000
PRECOMPILE_ECMUL_EFFECTIVE_CALL = 10000
PRECOMPILE_ECPAIRING_EFFECTIVE_CALL = 10000
PRECOMPILE_ECPAIRING_MILLER_LOOP = 10000
PRECOMPILE_BLAKE2F_ROUNDS = 512
18 changes: 9 additions & 9 deletions acceptance-tests/src/test/resources/txOverflowModuleLimits.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,13 @@ BLOCK_L1SIZE = 1000000
#
# Precompiles limits
#
PRECOMPILE_ECRECOVER = 10000
PRECOMPILE_SHA2 = 10000
PRECOMPILE_RIPEMD = 10000
PRECOMPILE_ECRECOVER_EFFECTIVE_CALL = 10000
PRECOMPILE_SHA2_BLOCKS = 10000
PRECOMPILE_RIPEMD_BLOCKS = 10000
PRECOMPILE_IDENTITY = 10000
PRECOMPILE_MODEXP = 10000
PRECOMPILE_ECADD = 10000
PRECOMPILE_ECMUL = 10000
PRECOMPILE_ECPAIRING = 10000
PRECOMPILE_ECPAIRING_WEIGHTED = 10000
PRECOMPILE_BLAKE2F = 512
PRECOMPILE_MODEXP_EFFECTIVE_CALL = 10000
PRECOMPILE_ECADD_EFFECTIVE_CALL = 10000
PRECOMPILE_ECMUL_EFFECTIVE_CALL = 10000
PRECOMPILE_ECPAIRING_EFFECTIVE_CALL = 10000
PRECOMPILE_ECPAIRING_MILLER_LOOP = 10000
PRECOMPILE_BLAKE2F_ROUNDS = 512
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,15 @@
import net.consensys.linea.zktracer.module.limits.Keccak;
import net.consensys.linea.zktracer.module.limits.L2Block;
import net.consensys.linea.zktracer.module.limits.L2L1Logs;
import net.consensys.linea.zktracer.module.limits.precompiles.Blake2f;
import net.consensys.linea.zktracer.module.limits.precompiles.EcAdd;
import net.consensys.linea.zktracer.module.limits.precompiles.EcMul;
import net.consensys.linea.zktracer.module.limits.precompiles.EcPairingCall;
import net.consensys.linea.zktracer.module.limits.precompiles.EcPairingWeightedCall;
import net.consensys.linea.zktracer.module.limits.precompiles.EcRecover;
import net.consensys.linea.zktracer.module.limits.precompiles.Modexp;
import net.consensys.linea.zktracer.module.limits.precompiles.Rip160;
import net.consensys.linea.zktracer.module.limits.precompiles.Sha256;
import net.consensys.linea.zktracer.module.limits.precompiles.Blake2fRounds;
import net.consensys.linea.zktracer.module.limits.precompiles.EcAddEffectiveCall;
import net.consensys.linea.zktracer.module.limits.precompiles.EcMulEffectiveCall;
import net.consensys.linea.zktracer.module.limits.precompiles.EcPairingCallEffectiveCall;
import net.consensys.linea.zktracer.module.limits.precompiles.EcPairingMillerLoop;
import net.consensys.linea.zktracer.module.limits.precompiles.EcRecoverEffectiveCall;
import net.consensys.linea.zktracer.module.limits.precompiles.ModexpEffectiveCall;
import net.consensys.linea.zktracer.module.limits.precompiles.Rip160Blocks;
import net.consensys.linea.zktracer.module.limits.precompiles.Sha256Blocks;
import net.consensys.linea.zktracer.module.logData.LogData;
import net.consensys.linea.zktracer.module.logInfo.LogInfo;
import net.consensys.linea.zktracer.module.mmu.Mmu;
Expand Down Expand Up @@ -181,7 +181,7 @@ public void addTraceSection(TraceSection section) {
private final RomLex romLex;
private final TxnData txnData;
private final Trm trm = new Trm();
private final Modexp modexp;
private final ModexpEffectiveCall modexp;
private final Stp stp = new Stp(this, wcp, mod);
private final L2Block l2Block = new L2Block();

Expand All @@ -199,20 +199,20 @@ public Hub() {
this.txnData = new TxnData(this, this.romLex, this.wcp);
this.ecData = new EcData(this, this.wcp, this.ext);

final EcRecover ecRec = new EcRecover(this);
this.modexp = new Modexp(this);
final EcPairingCall ecpairingCall = new EcPairingCall(this);
final EcRecoverEffectiveCall ecRec = new EcRecoverEffectiveCall(this);
this.modexp = new ModexpEffectiveCall(this);
final EcPairingCallEffectiveCall ecpairingCall = new EcPairingCallEffectiveCall(this);
this.precompileLimitModules =
List.of(
new Sha256(this),
new Sha256Blocks(this),
ecRec,
new Rip160(this),
new Rip160Blocks(this),
this.modexp,
new EcAdd(this),
new EcMul(this),
new EcAddEffectiveCall(this),
new EcMulEffectiveCall(this),
ecpairingCall,
new EcPairingWeightedCall(ecpairingCall),
new Blake2f(this),
new EcPairingMillerLoop(ecpairingCall),
new Blake2fRounds(this),
// Block level limits
this.l2Block,
new Keccak(this, ecRec, this.l2Block),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import net.consensys.linea.zktracer.ColumnHeader;
import net.consensys.linea.zktracer.module.Module;
import net.consensys.linea.zktracer.module.hub.Hub;
import net.consensys.linea.zktracer.module.limits.precompiles.EcRecover;
import net.consensys.linea.zktracer.module.limits.precompiles.EcRecoverEffectiveCall;
import net.consensys.linea.zktracer.opcode.OpCode;
import org.hyperledger.besu.evm.frame.MessageFrame;
import org.hyperledger.besu.evm.internal.Words;
Expand All @@ -41,7 +41,7 @@ public class Keccak implements Module {
private static final int PUBKEY_BYTES = 64;

private final Hub hub;
private final EcRecover ecRec;
private final EcRecoverEffectiveCall ecRec;
private final L2Block l2Block;

private final Deque<List<Long>> deployedCodesizes = new ArrayDeque<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@
import org.hyperledger.besu.evm.internal.Words;

@RequiredArgsConstructor
public final class Blake2f implements Module {
public final class Blake2fRounds implements Module {
final Hub hub;
private final Stack<Integer> counts = new Stack<>();

@Override
public String moduleKey() {
return "PRECOMPILE_BLAKE2F";
return "PRECOMPILE_BLAKE2F_ROUNDS";
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@
import org.hyperledger.besu.evm.internal.Words;

@RequiredArgsConstructor
public final class EcAdd implements Module {
public final class EcAddEffectiveCall implements Module {
private final Hub hub;
private final Stack<Integer> counts = new Stack<>();

@Override
public String moduleKey() {
return "PRECOMPILE_ECADD";
return "PRECOMPILE_ECADD_EFFECTIVE_CALL";
}

private static final int PRECOMPILE_GAS_FEE = 150; // cf EIP-1108
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@
import org.hyperledger.besu.evm.internal.Words;

@RequiredArgsConstructor
public final class EcMul implements Module {
public final class EcMulEffectiveCall implements Module {
private final Hub hub;
private final Stack<Integer> counts = new Stack<>();

@Override
public String moduleKey() {
return "PRECOMPILE_ECMUL";
return "PRECOMPILE_ECMUL_EFFECTIVE_CALL";
}

private static final int PRECOMPILE_GAS_FEE = 6000; // cf EIP-1108
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

@Slf4j
@RequiredArgsConstructor
public final class EcPairingCall implements Module {
public final class EcPairingCallEffectiveCall implements Module {
private final Hub hub;
@Getter private final Stack<EcPairingLimit> counts = new Stack<>();
private static final int PRECOMPILE_BASE_GAS_FEE = 45000; // cf EIP-1108
Expand All @@ -41,7 +41,7 @@ public final class EcPairingCall implements Module {

@Override
public String moduleKey() {
return "PRECOMPILE_ECPAIRING";
return "PRECOMPILE_ECPAIRING_EFFECTIVE_CALL";
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,16 @@
import net.consensys.linea.zktracer.ColumnHeader;
import net.consensys.linea.zktracer.module.Module;

public final class EcPairingWeightedCall implements Module {
private final EcPairingCall ecpairingCall;
public final class EcPairingMillerLoop implements Module {
private final EcPairingCallEffectiveCall ecpairingCall;

public EcPairingWeightedCall(EcPairingCall ecpairingCall) {
public EcPairingMillerLoop(EcPairingCallEffectiveCall ecpairingCall) {
this.ecpairingCall = ecpairingCall;
}

@Override
public String moduleKey() {
return "PRECOMPILE_ECPAIRING_WEIGHTED";
return "PRECOMPILE_ECPAIRING_MILLER_LOOP";
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@
import org.hyperledger.besu.evm.internal.Words;

@RequiredArgsConstructor
public final class EcRecover implements Module {
public final class EcRecoverEffectiveCall implements Module {
private final Hub hub;
private final Stack<Integer> counts = new Stack<>();

@Override
public String moduleKey() {
return "PRECOMPILE_ECRECOVER";
return "PRECOMPILE_ECRECOVER_EFFECTIVE_CALL";
}

private static final int ECRECOVER_GAS_FEE = 3000;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@

@Slf4j
@RequiredArgsConstructor
public class Modexp implements Module {
public class ModexpEffectiveCall implements Module {
private final Hub hub;
private final Stack<Integer> counts = new Stack<>();
private static final BigInteger PROVER_MAX_INPUT_BIT_SIZE = BigInteger.valueOf(4096);
private static final int EVM_WORD_SIZE = 32;

@Override
public String moduleKey() {
return "PRECOMPILE_MODEXP";
return "PRECOMPILE_MODEXP_EFFECTIVE_CALL";
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@
import org.hyperledger.besu.evm.internal.Words;

@RequiredArgsConstructor
public final class Rip160 implements Module {
public final class Rip160Blocks implements Module {
private final Hub hub;
private final Stack<Integer> counts = new Stack<>();

@Override
public String moduleKey() {
return "PRECOMPILE_RIPEMD";
return "PRECOMPILE_RIPEMD_BLOCKS";
}

private static final int PRECOMPILE_BASE_GAS_FEE = 600;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@
import org.hyperledger.besu.evm.internal.Words;

@RequiredArgsConstructor
public final class Sha256 implements Module {
public final class Sha256Blocks implements Module {
private final Hub hub;
private final Stack<Integer> counts = new Stack<>();

@Override
public String moduleKey() {
return "PRECOMPILE_SHA2";
return "PRECOMPILE_SHA2_BLOCKS";
}

private static final int PRECOMPILE_BASE_GAS_FEE = 60;
Expand Down
18 changes: 9 additions & 9 deletions arithmetization/src/main/resources/spillings.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,16 @@ STP = 4
TRM = 7
WCP = 16

PRECOMPILE_ECRECOVER = 0
PRECOMPILE_SHA2 = 0
PRECOMPILE_RIPEMD = 0
PRECOMPILE_ECRECOVER_EFFECTIVE_CALL = 0
PRECOMPILE_SHA2_BLOCKS = 0
PRECOMPILE_RIPEMD_BLOCKS = 0
PRECOMPILE_IDENTITY = 0
PRECOMPILE_MODEXP = 0
PRECOMPILE_ECADD = 0
PRECOMPILE_ECMUL = 0
PRECOMPILE_ECPAIRING = 0
PRECOMPILE_ECPAIRING_WEIGHTED = 0
PRECOMPILE_BLAKE2F = 0
PRECOMPILE_MODEXP_EFFECTIVE_CALL = 0
PRECOMPILE_ECADD_EFFECTIVE_CALL = 0
PRECOMPILE_ECMUL_EFFECTIVE_CALL = 0
PRECOMPILE_ECPAIRING_EFFECTIVE_CALL = 0
PRECOMPILE_ECPAIRING_MILLER_LOOP = 0
PRECOMPILE_BLAKE2F_ROUNDS = 0

BLOCK_TX = 0
BLOCK_L2L1LOGS = 0
Expand Down
Loading