Skip to content

Commit

Permalink
adjust unit test gas costs, fix offset-by-one bug in the discount table
Browse files Browse the repository at this point in the history
Signed-off-by: garyschulte <[email protected]>
  • Loading branch information
garyschulte committed Dec 11, 2024
1 parent ed005ca commit a2df684
Show file tree
Hide file tree
Showing 9 changed files with 815 additions and 817 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,28 +41,26 @@ public abstract class AbstractBLS12PrecompiledContract implements PrecompiledCon
/** The Discount table. */
static final int[] G1_DISCOUNT_TABLE =
new int[] {
1800, 888, 955, 802, 743, 821, 750, 680, 657, 635, 612, 591, 664, 637,
611, 585, 578, 571, 564, 557, 628, 620, 612, 604, 596, 588, 578, 570,
562, 693, 683, 673, 670, 665, 663, 658, 655, 650, 648, 643, 640, 635,
633, 628, 625, 620, 618, 613, 610, 605, 603, 598, 595, 590, 588, 583,
580, 578, 573, 570, 565, 563, 558, 555, 553, 550, 548, 548, 545, 543,
540, 540, 538, 535, 533, 533, 530, 528, 528, 525, 523, 520, 520, 518,
515, 513, 513, 510, 508, 505, 505, 503, 500, 498, 498, 495, 493, 490,
490, 488, 485, 483, 483, 480, 478, 478, 475, 473, 470, 470, 468, 465,
463, 463, 460, 458, 455, 455, 453, 450, 448, 448, 445, 443, 440, 440,
438, 435
-1, 1800, 888, 955, 802, 743, 821, 750, 680, 657, 635, 612, 591, 664, 637, 611, 585, 578,
571, 564, 557, 628, 620, 612, 604, 596, 588, 578, 570, 562, 693, 683, 673, 670, 665, 663,
658, 655, 650, 648, 643, 640, 635, 633, 628, 625, 620, 618, 613, 610, 605, 603, 598, 595,
590, 588, 583, 580, 578, 573, 570, 565, 563, 558, 555, 553, 550, 548, 548, 545, 543, 540,
540, 538, 535, 533, 533, 530, 528, 528, 525, 523, 520, 520, 518, 515, 513, 513, 510, 508,
505, 505, 503, 500, 498, 498, 495, 493, 490, 490, 488, 485, 483, 483, 480, 478, 478, 475,
473, 470, 470, 468, 465, 463, 463, 460, 458, 455, 455, 453, 450, 448, 448, 445, 443, 440,
440, 438, 435
};

static final int[] G2_DISCOUNT_TABLE =
new int[] {
1800, 1776, 1528, 1282, 1188, 1368, 1250, 1133, 1095, 1269, 1224, 1182, 1137, 1274, 1222,
1169, 1155, 1141, 1127, 1113, 1256, 1240, 1224, 1208, 1192, 1176, 1156, 1140, 1124, 1108,
1092, 1076, 1072, 1064, 1060, 1052, 1048, 1040, 1036, 1028, 1024, 1016, 1012, 1004, 1000,
992, 988, 980, 976, 968, 964, 956, 952, 944, 940, 932, 928, 924, 916, 912, 904, 900, 892,
888, 884, 880, 876, 876, 872, 868, 864, 864, 860, 856, 852, 852, 848, 844, 844, 840, 836,
832, 832, 828, 824, 820, 820, 816, 812, 808, 808, 804, 800, 796, 796, 792, 788, 784, 784,
780, 776, 772, 772, 768, 764, 764, 760, 756, 752, 752, 748, 744, 740, 740, 736, 732, 728,
728, 724, 720, 716, 716, 712, 708, 704, 704, 700, 696
-1, 1800, 1776, 1528, 1282, 1188, 1368, 1250, 1133, 1095, 1269, 1224, 1182, 1137, 1274,
1222, 1169, 1155, 1141, 1127, 1113, 1256, 1240, 1224, 1208, 1192, 1176, 1156, 1140, 1124,
1108, 1092, 1076, 1072, 1064, 1060, 1052, 1048, 1040, 1036, 1028, 1024, 1016, 1012, 1004,
1000, 992, 988, 980, 976, 968, 964, 956, 952, 944, 940, 932, 928, 924, 916, 912, 904, 900,
892, 888, 884, 880, 876, 876, 872, 868, 864, 864, 860, 856, 852, 852, 848, 844, 844, 840,
836, 832, 832, 828, 824, 820, 820, 816, 812, 808, 808, 804, 800, 796, 796, 792, 788, 784,
784, 780, 776, 772, 772, 768, 764, 764, 760, 756, 752, 752, 748, 744, 740, 740, 736, 732,
728, 728, 724, 720, 716, 716, 712, 708, 704, 704, 700, 696
};

/** The Max discount. */
Expand Down
200 changes: 100 additions & 100 deletions evm/src/test/resources/org/hyperledger/besu/evm/precompile/fp2_to_g2.csv

Large diffs are not rendered by default.

200 changes: 100 additions & 100 deletions evm/src/test/resources/org/hyperledger/besu/evm/precompile/fp_to_g1.csv

Large diffs are not rendered by default.

200 changes: 100 additions & 100 deletions evm/src/test/resources/org/hyperledger/besu/evm/precompile/g1_add.csv

Large diffs are not rendered by default.

Large diffs are not rendered by default.

200 changes: 100 additions & 100 deletions evm/src/test/resources/org/hyperledger/besu/evm/precompile/g2_add.csv

Large diffs are not rendered by default.

200 changes: 100 additions & 100 deletions evm/src/test/resources/org/hyperledger/besu/evm/precompile/g2_mul.csv

Large diffs are not rendered by default.

Large diffs are not rendered by default.

196 changes: 98 additions & 98 deletions evm/src/test/resources/org/hyperledger/besu/evm/precompile/pairing.csv

Large diffs are not rendered by default.

0 comments on commit a2df684

Please sign in to comment.