@@ -12,6 +12,7 @@ public enum Version {
1212 TRON_V1_1 ,
1313 TRON_V1_2 ,
1414 TRON_V1_3 ,
15+ TRON_V1_4 ,
1516 // add more
1617 // TRON_V2,
1718 // ETH
@@ -24,6 +25,7 @@ public enum Version {
2425 tableMap .put (Version .TRON_V1_1 , newTronV11OperationSet ());
2526 tableMap .put (Version .TRON_V1_2 , newTronV12OperationSet ());
2627 tableMap .put (Version .TRON_V1_3 , newTronV13OperationSet ());
28+ tableMap .put (Version .TRON_V1_4 , newTronV14OperationSet ());
2729 }
2830
2931 public static JumpTable newTronV10OperationSet () {
@@ -55,12 +57,18 @@ public static JumpTable newTronV13OperationSet() {
5557 return table ;
5658 }
5759
60+ public static JumpTable newTronV14OperationSet () {
61+ JumpTable table = newTronV13OperationSet ();
62+ appendCancunOperations (table );
63+ return table ;
64+ }
65+
5866 // Just for warming up class to avoid out_of_time
5967 public static void init () {}
6068
6169 public static JumpTable getTable () {
6270 // always get the table which has the newest version
63- JumpTable table = tableMap .get (Version .TRON_V1_3 );
71+ JumpTable table = tableMap .get (Version .TRON_V1_4 );
6472
6573 // next make the corresponding changes, exclude activating opcode
6674 if (VMConfig .allowHigherLimitForMaxCpuTimeOfOneTx ()) {
@@ -652,4 +660,26 @@ public static void adjustForFairEnergy(JumpTable table) {
652660 EnergyCost ::getSuicideCost2 ,
653661 OperationActions ::suicideAction ));
654662 }
663+
664+ public static void appendCancunOperations (JumpTable table ) {
665+ BooleanSupplier proposal = VMConfig ::allowTvmCancun ;
666+
667+ table .set (new Operation (
668+ Op .TLOAD , 1 , 1 ,
669+ EnergyCost ::getTLoadCost ,
670+ OperationActions ::tLoadAction ,
671+ proposal ));
672+
673+ table .set (new Operation (
674+ Op .TSTORE , 2 , 0 ,
675+ EnergyCost ::getTStoreCost ,
676+ OperationActions ::tStoreAction ,
677+ proposal ));
678+
679+ table .set (new Operation (
680+ Op .MCOPY , 3 , 0 ,
681+ EnergyCost ::getMCopyCost ,
682+ OperationActions ::mCopyAction ,
683+ proposal ));
684+ }
655685}
0 commit comments