Skip to content

Commit

Permalink
Cleanup in logs
Browse files Browse the repository at this point in the history
  • Loading branch information
0xVolosnikov committed Sep 23, 2024
1 parent 2bc8785 commit 4892af8
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 27 deletions.
36 changes: 18 additions & 18 deletions system-contracts/contracts/EvmInterpreter.yul
Original file line number Diff line number Diff line change
Expand Up @@ -2722,11 +2722,10 @@ object "EVMInterpreter" {
revertWithGas(evmGasLeft)
}

let offset, size, topic1
let offset, size
popStackCheck(sp, evmGasLeft, 3)
offset, sp := popStackItemWithoutCheck(sp)
size, sp := popStackItemWithoutCheck(sp)
topic1, sp := popStackItemWithoutCheck(sp)

checkOverflow(offset, size, evmGasLeft)
checkMemOverflowByOffset(add(offset, size), evmGasLeft)
Expand All @@ -2736,7 +2735,11 @@ object "EVMInterpreter" {
dynamicGas := add(dynamicGas, 375)
evmGasLeft := chargeGas(evmGasLeft, dynamicGas)

log1(add(offset, MEM_OFFSET_INNER()), size, topic1)
{
let topic1
topic1, sp := popStackItemWithoutCheck(sp)
log1(add(offset, MEM_OFFSET_INNER()), size, topic1)
}
ip := add(ip, 1)
}
case 0xA2 { // OP_LOG2
Expand All @@ -2746,7 +2749,7 @@ object "EVMInterpreter" {
}

let offset, size
popStackCheck(sp, evmGasLeft, 2)
popStackCheck(sp, evmGasLeft, 4)
offset, sp := popStackItemWithoutCheck(sp)
size, sp := popStackItemWithoutCheck(sp)

Expand All @@ -2760,7 +2763,6 @@ object "EVMInterpreter" {

{
let topic1, topic2
popStackCheck(sp, evmGasLeft, 2)
topic1, sp := popStackItemWithoutCheck(sp)
topic2, sp := popStackItemWithoutCheck(sp)
log2(add(offset, MEM_OFFSET_INNER()), size, topic1, topic2)
Expand All @@ -2775,7 +2777,7 @@ object "EVMInterpreter" {
}

let offset, size
popStackCheck(sp, evmGasLeft, 2)
popStackCheck(sp, evmGasLeft, 5)
offset, sp := popStackItemWithoutCheck(sp)
size, sp := popStackItemWithoutCheck(sp)

Expand All @@ -2789,7 +2791,6 @@ object "EVMInterpreter" {

{
let topic1, topic2, topic3
popStackCheck(sp, evmGasLeft, 3)
topic1, sp := popStackItemWithoutCheck(sp)
topic2, sp := popStackItemWithoutCheck(sp)
topic3, sp := popStackItemWithoutCheck(sp)
Expand All @@ -2805,7 +2806,7 @@ object "EVMInterpreter" {
}

let offset, size
popStackCheck(sp, evmGasLeft, 2)
popStackCheck(sp, evmGasLeft, 6)
offset, sp := popStackItemWithoutCheck(sp)
size, sp := popStackItemWithoutCheck(sp)

Expand All @@ -2819,7 +2820,6 @@ object "EVMInterpreter" {

{
let topic1, topic2, topic3, topic4
popStackCheck(sp, evmGasLeft, 4)
topic1, sp := popStackItemWithoutCheck(sp)
topic2, sp := popStackItemWithoutCheck(sp)
topic3, sp := popStackItemWithoutCheck(sp)
Expand Down Expand Up @@ -5588,11 +5588,10 @@ object "EVMInterpreter" {
revertWithGas(evmGasLeft)
}

let offset, size, topic1
let offset, size
popStackCheck(sp, evmGasLeft, 3)
offset, sp := popStackItemWithoutCheck(sp)
size, sp := popStackItemWithoutCheck(sp)
topic1, sp := popStackItemWithoutCheck(sp)

checkOverflow(offset, size, evmGasLeft)
checkMemOverflowByOffset(add(offset, size), evmGasLeft)
Expand All @@ -5602,7 +5601,11 @@ object "EVMInterpreter" {
dynamicGas := add(dynamicGas, 375)
evmGasLeft := chargeGas(evmGasLeft, dynamicGas)

log1(add(offset, MEM_OFFSET_INNER()), size, topic1)
{
let topic1
topic1, sp := popStackItemWithoutCheck(sp)
log1(add(offset, MEM_OFFSET_INNER()), size, topic1)
}
ip := add(ip, 1)
}
case 0xA2 { // OP_LOG2
Expand All @@ -5612,7 +5615,7 @@ object "EVMInterpreter" {
}

let offset, size
popStackCheck(sp, evmGasLeft, 2)
popStackCheck(sp, evmGasLeft, 4)
offset, sp := popStackItemWithoutCheck(sp)
size, sp := popStackItemWithoutCheck(sp)

Expand All @@ -5626,7 +5629,6 @@ object "EVMInterpreter" {

{
let topic1, topic2
popStackCheck(sp, evmGasLeft, 2)
topic1, sp := popStackItemWithoutCheck(sp)
topic2, sp := popStackItemWithoutCheck(sp)
log2(add(offset, MEM_OFFSET_INNER()), size, topic1, topic2)
Expand All @@ -5641,7 +5643,7 @@ object "EVMInterpreter" {
}

let offset, size
popStackCheck(sp, evmGasLeft, 2)
popStackCheck(sp, evmGasLeft, 5)
offset, sp := popStackItemWithoutCheck(sp)
size, sp := popStackItemWithoutCheck(sp)

Expand All @@ -5655,7 +5657,6 @@ object "EVMInterpreter" {

{
let topic1, topic2, topic3
popStackCheck(sp, evmGasLeft, 3)
topic1, sp := popStackItemWithoutCheck(sp)
topic2, sp := popStackItemWithoutCheck(sp)
topic3, sp := popStackItemWithoutCheck(sp)
Expand All @@ -5671,7 +5672,7 @@ object "EVMInterpreter" {
}

let offset, size
popStackCheck(sp, evmGasLeft, 2)
popStackCheck(sp, evmGasLeft, 6)
offset, sp := popStackItemWithoutCheck(sp)
size, sp := popStackItemWithoutCheck(sp)

Expand All @@ -5685,7 +5686,6 @@ object "EVMInterpreter" {

{
let topic1, topic2, topic3, topic4
popStackCheck(sp, evmGasLeft, 4)
topic1, sp := popStackItemWithoutCheck(sp)
topic2, sp := popStackItemWithoutCheck(sp)
topic3, sp := popStackItemWithoutCheck(sp)
Expand Down
18 changes: 9 additions & 9 deletions system-contracts/evm-interpreter/EvmInterpreterLoop.template.yul
Original file line number Diff line number Diff line change
Expand Up @@ -1272,11 +1272,10 @@ for { } true { } {
revertWithGas(evmGasLeft)
}

let offset, size, topic1
let offset, size
popStackCheck(sp, evmGasLeft, 3)
offset, sp := popStackItemWithoutCheck(sp)
size, sp := popStackItemWithoutCheck(sp)
topic1, sp := popStackItemWithoutCheck(sp)

checkOverflow(offset, size, evmGasLeft)
checkMemOverflowByOffset(add(offset, size), evmGasLeft)
Expand All @@ -1286,7 +1285,11 @@ for { } true { } {
dynamicGas := add(dynamicGas, 375)
evmGasLeft := chargeGas(evmGasLeft, dynamicGas)

log1(add(offset, MEM_OFFSET_INNER()), size, topic1)
{
let topic1
topic1, sp := popStackItemWithoutCheck(sp)
log1(add(offset, MEM_OFFSET_INNER()), size, topic1)
}
ip := add(ip, 1)
}
case 0xA2 { // OP_LOG2
Expand All @@ -1296,7 +1299,7 @@ for { } true { } {
}

let offset, size
popStackCheck(sp, evmGasLeft, 2)
popStackCheck(sp, evmGasLeft, 4)
offset, sp := popStackItemWithoutCheck(sp)
size, sp := popStackItemWithoutCheck(sp)

Expand All @@ -1310,7 +1313,6 @@ for { } true { } {

{
let topic1, topic2
popStackCheck(sp, evmGasLeft, 2)
topic1, sp := popStackItemWithoutCheck(sp)
topic2, sp := popStackItemWithoutCheck(sp)
log2(add(offset, MEM_OFFSET_INNER()), size, topic1, topic2)
Expand All @@ -1325,7 +1327,7 @@ for { } true { } {
}

let offset, size
popStackCheck(sp, evmGasLeft, 2)
popStackCheck(sp, evmGasLeft, 5)
offset, sp := popStackItemWithoutCheck(sp)
size, sp := popStackItemWithoutCheck(sp)

Expand All @@ -1339,7 +1341,6 @@ for { } true { } {

{
let topic1, topic2, topic3
popStackCheck(sp, evmGasLeft, 3)
topic1, sp := popStackItemWithoutCheck(sp)
topic2, sp := popStackItemWithoutCheck(sp)
topic3, sp := popStackItemWithoutCheck(sp)
Expand All @@ -1355,7 +1356,7 @@ for { } true { } {
}

let offset, size
popStackCheck(sp, evmGasLeft, 2)
popStackCheck(sp, evmGasLeft, 6)
offset, sp := popStackItemWithoutCheck(sp)
size, sp := popStackItemWithoutCheck(sp)

Expand All @@ -1369,7 +1370,6 @@ for { } true { } {

{
let topic1, topic2, topic3, topic4
popStackCheck(sp, evmGasLeft, 4)
topic1, sp := popStackItemWithoutCheck(sp)
topic2, sp := popStackItemWithoutCheck(sp)
topic3, sp := popStackItemWithoutCheck(sp)
Expand Down

0 comments on commit 4892af8

Please sign in to comment.