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 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.Blake2fNbRounds;
import net.consensys.linea.zktracer.module.limits.precompiles.EcAddNbEffectiveCall;
import net.consensys.linea.zktracer.module.limits.precompiles.EcMulNbEffectiveCall;
import net.consensys.linea.zktracer.module.limits.precompiles.EcPairingCallNbEffectiveCall;
import net.consensys.linea.zktracer.module.limits.precompiles.EcPairingNbMillerLoop;
import net.consensys.linea.zktracer.module.limits.precompiles.EcRecoverNbEffectiveCall;
import net.consensys.linea.zktracer.module.limits.precompiles.ModexpNbEffectiveCall;
import net.consensys.linea.zktracer.module.limits.precompiles.Rip160NbBlocks;
import net.consensys.linea.zktracer.module.limits.precompiles.Sha256NbBlocks;
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 ModexpNbEffectiveCall 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 EcRecoverNbEffectiveCall ecRec = new EcRecoverNbEffectiveCall(this);
this.modexp = new ModexpNbEffectiveCall(this);
final EcPairingCallNbEffectiveCall ecpairingCall = new EcPairingCallNbEffectiveCall(this);
this.precompileLimitModules =
List.of(
new Sha256(this),
new Sha256NbBlocks(this),
ecRec,
new Rip160(this),
new Rip160NbBlocks(this),
this.modexp,
new EcAdd(this),
new EcMul(this),
new EcAddNbEffectiveCall(this),
new EcMulNbEffectiveCall(this),
ecpairingCall,
new EcPairingWeightedCall(ecpairingCall),
new Blake2f(this),
new EcPairingNbMillerLoop(ecpairingCall),
new Blake2fNbRounds(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.EcRecoverNbEffectiveCall;
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 EcRecoverNbEffectiveCall 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 Blake2fNbRounds implements Module {
final Hub hub;
private final Stack<Integer> counts = new Stack<>();

@Override
public String moduleKey() {
return "PRECOMPILE_BLAKE2F";
return "PRECOMPILE_BLAKE2F_NB_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 EcAddNbEffectiveCall implements Module {
private final Hub hub;
private final Stack<Integer> counts = new Stack<>();

@Override
public String moduleKey() {
return "PRECOMPILE_ECADD";
return "PRECOMPILE_ECADD_NB_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 EcMulNbEffectiveCall implements Module {
private final Hub hub;
private final Stack<Integer> counts = new Stack<>();

@Override
public String moduleKey() {
return "PRECOMPILE_ECMUL";
return "PRECOMPILE_ECMUL_NB_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 EcPairingCallNbEffectiveCall 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_NB_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 EcPairingNbMillerLoop implements Module {
private final EcPairingCallNbEffectiveCall ecpairingCall;

public EcPairingWeightedCall(EcPairingCall ecpairingCall) {
public EcPairingNbMillerLoop(EcPairingCallNbEffectiveCall ecpairingCall) {
this.ecpairingCall = ecpairingCall;
}

@Override
public String moduleKey() {
return "PRECOMPILE_ECPAIRING_WEIGHTED";
return "PRECOMPILE_ECPAIRING_NB_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 EcRecoverNbEffectiveCall implements Module {
private final Hub hub;
private final Stack<Integer> counts = new Stack<>();

@Override
public String moduleKey() {
return "PRECOMPILE_ECRECOVER";
return "PRECOMPILE_ECRECOVER_NB_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 ModexpNbEffectiveCall 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_NB_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 Rip160NbBlocks implements Module {
private final Hub hub;
private final Stack<Integer> counts = new Stack<>();

@Override
public String moduleKey() {
return "PRECOMPILE_RIPEMD";
return "PRECOMPILE_RIPEMD_NB_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 Sha256NbBlocks implements Module {
private final Hub hub;
private final Stack<Integer> counts = new Stack<>();

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

private static final int PRECOMPILE_BASE_GAS_FEE = 60;
Expand Down
Loading