Skip to content

Commit

Permalink
EIP-2999
Browse files Browse the repository at this point in the history
Update costs to 2999
Update benchmark

Signed-off-by: Danno Ferrin <[email protected]>
  • Loading branch information
shemnon committed Oct 1, 2020
1 parent a90611b commit 8c5185e
Show file tree
Hide file tree
Showing 5 changed files with 282 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,12 @@ public Bytes compute(final Bytes input, final MessageFrame messageFrame) {
if (errorNo == 0) {
return Bytes.wrap(result, 0, o_len.getValue());
} else {
String errorMessage = new String(error, 0, err_len.getValue(), UTF_8);
messageFrame.setRevertReason(Bytes.wrap(error, 0, err_len.getValue()));
LOG.trace(
"Error executing precompiled contract {}: '{}'",
name,
new String(error, 0, err_len.getValue(), UTF_8));
errorMessage);
return null;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ public BLS12G2MulPrecompiledContract() {

@Override
public Gas gasRequirement(final Bytes input) {
return Gas.of(55_000);
return Gas.of(45_000);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ public BLS12MapFp2ToG2PrecompiledContract() {

@Override
public Gas gasRequirement(final Bytes input) {
return Gas.of(110_000);
return Gas.of(75_000);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@ public BLS12PairingPrecompiledContract() {
@Override
public Gas gasRequirement(final Bytes input) {
final int k = input.size() / 384;
return Gas.of(23_000L * k + 115_000);
return Gas.of(43_000L * k + 65_000);
}
}
Loading

0 comments on commit 8c5185e

Please sign in to comment.