Skip to content

Commit

Permalink
using Pawel's suggested discount table from ethereum/EIPs#9116 (comment)
Browse files Browse the repository at this point in the history


Signed-off-by: garyschulte <[email protected]>
  • Loading branch information
garyschulte committed Dec 19, 2024
1 parent 2d05339 commit 6a2c676
Showing 1 changed file with 18 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,32 +41,32 @@ public abstract class AbstractBLS12PrecompiledContract implements PrecompiledCon
/** The Discount table. */
static final int[] G1_DISCOUNT_TABLE =
new int[] {
-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
-1, 1000, 949, 848, 797, 764, 750, 738, 728, 719, 712, 705, 698, 692, 687, 682, 677, 673,
669, 665, 661, 658, 654, 651, 648, 645, 642, 640, 637, 635, 632, 630, 627, 625, 623, 621,
619, 617, 615, 613, 611, 609, 608, 606, 604, 603, 601, 599, 598, 596, 595, 593, 592, 591,
589, 588, 586, 585, 584, 582, 581, 580, 579, 577, 576, 575, 574, 573, 572, 570, 569, 568,
567, 566, 565, 564, 563, 562, 561, 560, 559, 558, 557, 556, 555, 554, 553, 552, 551, 550,
549, 548, 547, 547, 546, 545, 544, 543, 542, 541, 540, 540, 539, 538, 537, 536, 536, 535,
534, 533, 532, 532, 531, 530, 529, 528, 528, 527, 526, 525, 525, 524, 523, 522, 522, 521,
520, 520, 519
};

static final int[] G2_DISCOUNT_TABLE =
new int[] {
-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
-1, 1000, 1000, 923, 884, 855, 832, 812, 796, 782, 770, 759, 749, 740, 732, 724, 717, 711,
704, 699, 693, 688, 683, 679, 674, 670, 666, 663, 659, 655, 652, 649, 646, 643, 640, 637,
634, 632, 629, 627, 624, 622, 620, 618, 615, 613, 611, 609, 607, 606, 604, 602, 600, 598,
597, 595, 593, 592, 590, 589, 587, 586, 584, 583, 582, 580, 579, 578, 576, 575, 574, 573,
571, 570, 569, 568, 567, 566, 565, 563, 562, 561, 560, 559, 558, 557, 556, 555, 554, 553,
552, 552, 551, 550, 549, 548, 547, 546, 545, 545, 544, 543, 542, 541, 541, 540, 539, 538,
537, 537, 536, 535, 535, 534, 533, 532, 532, 531, 530, 530, 529, 528, 528, 527, 526, 526,
525, 524, 524
};

/** The Max discount. */
static final int G1_MAX_DISCOUNT = 435;
static final int G1_MAX_DISCOUNT = 519;

static final int G2_MAX_DISCOUNT = 696;
static final int G2_MAX_DISCOUNT = 524;

private final String name;
private final byte operationId;
Expand Down

0 comments on commit 6a2c676

Please sign in to comment.