Skip to content

Commit

Permalink
Adjusting gas cost
Browse files Browse the repository at this point in the history
  • Loading branch information
nagarev committed Dec 9, 2024
1 parent fcc9294 commit be19790
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion rskj-core/src/main/java/org/ethereum/vm/OpCode.java
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ public enum OpCode {
/**
* (0x5e) Memory copying instruction
*/
MCOPY(0x5e, 3, 0, ZERO_TIER),
MCOPY(0x5e, 3, 0, VERY_LOW_TIER),

/* Push Operations */
/**
Expand Down
3 changes: 2 additions & 1 deletion rskj-core/src/main/java/org/ethereum/vm/VM.java
Original file line number Diff line number Diff line change
Expand Up @@ -773,7 +773,8 @@ private long computeMemoryCopyGas() {
long copySize = Program.limitToMaxLong(length);
checkSizeArgument(copySize);
long newMemSize = memNeeded(offset, copySize);
return GasCost.add(calcMemGas(oldMemSize, newMemSize, copySize), GasCost.MEMORY);
// Note: 3 additional units are added outside because of the "Very Low Tier" configuration
return calcMemGas(oldMemSize, newMemSize, copySize);
}

protected void doCODESIZE() {
Expand Down

0 comments on commit be19790

Please sign in to comment.