@@ -11,6 +11,7 @@ public enum Version {
1111 TRON_V1_0 ,
1212 TRON_V1_1 ,
1313 TRON_V1_2 ,
14+ TRON_V1_3 ,
1415 // add more
1516 // TRON_V2,
1617 // ETH
@@ -22,6 +23,7 @@ public enum Version {
2223 tableMap .put (Version .TRON_V1_0 , newTronV10OperationSet ());
2324 tableMap .put (Version .TRON_V1_1 , newTronV11OperationSet ());
2425 tableMap .put (Version .TRON_V1_2 , newTronV12OperationSet ());
26+ tableMap .put (Version .TRON_V1_3 , newTronV13OperationSet ());
2527 }
2628
2729 public static JumpTable newTronV10OperationSet () {
@@ -47,12 +49,18 @@ public static JumpTable newTronV12OperationSet() {
4749 return table ;
4850 }
4951
52+ public static JumpTable newTronV13OperationSet () {
53+ JumpTable table = newTronV12OperationSet ();
54+ appendShangHaiOperations (table );
55+ return table ;
56+ }
57+
5058 // Just for warming up class to avoid out_of_time
5159 public static void init () {}
5260
5361 public static JumpTable getTable () {
5462 // always get the table which has the newest version
55- JumpTable table = tableMap .get (Version .TRON_V1_2 );
63+ JumpTable table = tableMap .get (Version .TRON_V1_3 );
5664
5765 // next make the corresponding changes, exclude activating opcode
5866 if (VMConfig .allowHigherLimitForMaxCpuTimeOfOneTx ()) {
@@ -617,4 +625,14 @@ public static void appendDelegateOperations(JumpTable table) {
617625 OperationActions ::unDelegateResourceAction ,
618626 proposal ));
619627 }
628+
629+ public static void appendShangHaiOperations (JumpTable table ) {
630+ BooleanSupplier proposal = VMConfig ::allowTvmShanghai ;
631+
632+ table .set (new Operation (
633+ Op .PUSH0 , 0 , 1 ,
634+ EnergyCost ::getBaseTierCost ,
635+ OperationActions ::push0Action ,
636+ proposal ));
637+ }
620638}
0 commit comments