@@ -256,6 +256,22 @@ pub enum ExecutionError {
256
256
257
257
/// Certificate is canceled because randomness could not be generated this epoch
258
258
ExecutionCanceledDueToRandomnessUnavailable ,
259
+
260
+ /// Move vector element (passed to MakeMoveVec) with size {value_size} is larger \
261
+ /// than the maximum size {max_scaled_size}. Note that this maximum is scaled based on the \
262
+ /// type of the vector element.
263
+ MoveVectorElemTooBig {
264
+ value_size : u64 ,
265
+ max_scaled_size : u64 ,
266
+ } ,
267
+
268
+ /// Move value (possibly an upgrade ticket or a dev-inspect value) with size {value_size} \
269
+ /// is larger than the maximum size {max_scaled_size}. Note that this maximum is scaled based \
270
+ /// on the type of the value.
271
+ MoveRawValueTooBig {
272
+ value_size : u64 ,
273
+ max_scaled_size : u64 ,
274
+ } ,
259
275
}
260
276
261
277
/// Location in move bytecode where an error occurred
@@ -632,6 +648,16 @@ mod serialization {
632
648
} ,
633
649
634
650
ExecutionCanceledDueToRandomnessUnavailable ,
651
+
652
+ MoveVectorElemTooBig {
653
+ value_size : u64 ,
654
+ max_scaled_size : u64 ,
655
+ } ,
656
+
657
+ MoveRawValueTooBig {
658
+ value_size : u64 ,
659
+ max_scaled_size : u64 ,
660
+ } ,
635
661
}
636
662
637
663
#[ derive( serde_derive:: Serialize , serde_derive:: Deserialize ) ]
@@ -715,6 +741,16 @@ mod serialization {
715
741
} ,
716
742
717
743
ExecutionCanceledDueToRandomnessUnavailable ,
744
+
745
+ MoveVectorElemTooBig {
746
+ value_size : u64 ,
747
+ max_scaled_size : u64 ,
748
+ } ,
749
+
750
+ MoveRawValueTooBig {
751
+ value_size : u64 ,
752
+ max_scaled_size : u64 ,
753
+ } ,
718
754
}
719
755
720
756
impl Serialize for ExecutionError {
@@ -833,6 +869,20 @@ mod serialization {
833
869
Self :: ExecutionCanceledDueToRandomnessUnavailable => {
834
870
ReadableExecutionError :: ExecutionCanceledDueToRandomnessUnavailable
835
871
}
872
+ Self :: MoveVectorElemTooBig {
873
+ value_size,
874
+ max_scaled_size,
875
+ } => ReadableExecutionError :: MoveVectorElemTooBig {
876
+ value_size,
877
+ max_scaled_size,
878
+ } ,
879
+ Self :: MoveRawValueTooBig {
880
+ value_size,
881
+ max_scaled_size,
882
+ } => ReadableExecutionError :: MoveRawValueTooBig {
883
+ value_size,
884
+ max_scaled_size,
885
+ } ,
836
886
} ;
837
887
readable. serialize ( serializer)
838
888
} else {
@@ -942,6 +992,20 @@ mod serialization {
942
992
Self :: ExecutionCanceledDueToRandomnessUnavailable => {
943
993
BinaryExecutionError :: ExecutionCanceledDueToRandomnessUnavailable
944
994
}
995
+ Self :: MoveVectorElemTooBig {
996
+ value_size,
997
+ max_scaled_size,
998
+ } => BinaryExecutionError :: MoveVectorElemTooBig {
999
+ value_size,
1000
+ max_scaled_size,
1001
+ } ,
1002
+ Self :: MoveRawValueTooBig {
1003
+ value_size,
1004
+ max_scaled_size,
1005
+ } => BinaryExecutionError :: MoveRawValueTooBig {
1006
+ value_size,
1007
+ max_scaled_size,
1008
+ } ,
945
1009
} ;
946
1010
binary. serialize ( serializer)
947
1011
}
@@ -1062,6 +1126,20 @@ mod serialization {
1062
1126
ReadableExecutionError :: ExecutionCanceledDueToRandomnessUnavailable => {
1063
1127
Self :: ExecutionCanceledDueToRandomnessUnavailable
1064
1128
}
1129
+ ReadableExecutionError :: MoveVectorElemTooBig {
1130
+ value_size,
1131
+ max_scaled_size,
1132
+ } => Self :: MoveVectorElemTooBig {
1133
+ value_size,
1134
+ max_scaled_size,
1135
+ } ,
1136
+ ReadableExecutionError :: MoveRawValueTooBig {
1137
+ value_size,
1138
+ max_scaled_size,
1139
+ } => Self :: MoveRawValueTooBig {
1140
+ value_size,
1141
+ max_scaled_size,
1142
+ } ,
1065
1143
} )
1066
1144
} else {
1067
1145
BinaryExecutionError :: deserialize ( deserializer) . map ( |binary| match binary {
@@ -1168,6 +1246,20 @@ mod serialization {
1168
1246
BinaryExecutionError :: ExecutionCanceledDueToRandomnessUnavailable => {
1169
1247
Self :: ExecutionCanceledDueToRandomnessUnavailable
1170
1248
}
1249
+ BinaryExecutionError :: MoveVectorElemTooBig {
1250
+ value_size,
1251
+ max_scaled_size,
1252
+ } => Self :: MoveVectorElemTooBig {
1253
+ value_size,
1254
+ max_scaled_size,
1255
+ } ,
1256
+ BinaryExecutionError :: MoveRawValueTooBig {
1257
+ value_size,
1258
+ max_scaled_size,
1259
+ } => Self :: MoveRawValueTooBig {
1260
+ value_size,
1261
+ max_scaled_size,
1262
+ } ,
1171
1263
} )
1172
1264
}
1173
1265
}
0 commit comments