Skip to content

Commit

Permalink
Perf/issue 520/update wcp module (#521)
Browse files Browse the repository at this point in the history
* perf: new spec

* feat: constraint update

* fix: debug

* style: spotless

* fix: constraint

* fix: constraint

* fix: constraint

* fix: debug

* perf: smart slt and sgt

* docs: add reminder for value of slt and sgt + constraints update

* fix: maxCT must take acc5 and acc6 as arg

* style: rename + move stuff to tracing time
  • Loading branch information
letypequividelespoubelles authored Dec 29, 2023
1 parent cdd35b0 commit 97f0b74
Show file tree
Hide file tree
Showing 7 changed files with 431 additions and 181 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public class Trace {
private final MappedByteBuffer wcpArgOneLo;
private final MappedByteBuffer wcpArgTwoLo;
private final MappedByteBuffer wcpInst;
private final MappedByteBuffer wcpResLo;
private final MappedByteBuffer wcpRes;

static List<ColumnHeader> headers(int length) {
return List.of(
Expand Down Expand Up @@ -140,7 +140,7 @@ static List<ColumnHeader> headers(int length) {
new ColumnHeader("txnData.WCP_ARG_ONE_LO", 32, length),
new ColumnHeader("txnData.WCP_ARG_TWO_LO", 32, length),
new ColumnHeader("txnData.WCP_INST", 1, length),
new ColumnHeader("txnData.WCP_RES_LO", 1, length));
new ColumnHeader("txnData.WCP_RES", 1, length));
}

public Trace(List<MappedByteBuffer> buffers) {
Expand Down Expand Up @@ -185,7 +185,7 @@ public Trace(List<MappedByteBuffer> buffers) {
this.wcpArgOneLo = buffers.get(38);
this.wcpArgTwoLo = buffers.get(39);
this.wcpInst = buffers.get(40);
this.wcpResLo = buffers.get(41);
this.wcpRes = buffers.get(41);
}

public int size() {
Expand Down Expand Up @@ -812,14 +812,14 @@ public Trace wcpInst(final UnsignedByte b) {
return this;
}

public Trace wcpResLo(final Boolean b) {
public Trace wcpRes(final Boolean b) {
if (filled.get(41)) {
throw new IllegalStateException("txnData.WCP_RES_LO already set");
throw new IllegalStateException("txnData.WCP_RES already set");
} else {
filled.set(41);
}

wcpResLo.put((byte) (b ? 1 : 0));
wcpRes.put((byte) (b ? 1 : 0));

return this;
}
Expand Down Expand Up @@ -990,7 +990,7 @@ public Trace validateRow() {
}

if (!filled.get(41)) {
throw new IllegalStateException("txnData.WCP_RES_LO has not been filled");
throw new IllegalStateException("txnData.WCP_RES has not been filled");
}

filled.clear();
Expand Down Expand Up @@ -1165,7 +1165,7 @@ public Trace fillAndValidateRow() {
}

if (!filled.get(41)) {
wcpResLo.position(wcpResLo.position() + 1);
wcpRes.position(wcpRes.position() + 1);
}

filled.clear();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ private void traceTx(
.outgoingLo(bigIntegerToBytes(outgoingLos.get(ct)))
.wcpArgOneLo(wcpArgOneLo.get(ct))
.wcpArgTwoLo(wcpArgTwoLo.get(ct))
.wcpResLo(wcpRes.get(ct))
.wcpRes(wcpRes.get(ct))
.wcpInst(UnsignedByte.of(wcpInsts.get(ct)))
.phaseRlpTxnrcpt(UnsignedByte.of(phaseRlpTxnRcpt.get(ct)))
.outgoingRlpTxnrcpt(Bytes.ofUnsignedLong(outgoingRlpTxnRcpt.get(ct)))
Expand Down
Loading

0 comments on commit 97f0b74

Please sign in to comment.