@@ -11,11 +11,9 @@ library ArbitraryMessage {
1111 * offset 104 : 4 bytes :: uint32 - gasLimit
1212 * offset 108 : 1 bytes :: uint8 - source chain id length (X)
1313 * offset 109 : 1 bytes :: uint8 - destination chain id length (Y)
14- * offset 110 : 1 bytes :: bytes1 - dataType
15- * (optional) 111 : 32 bytes :: uint256 - gasPrice
16- * (optional) 111 : 1 bytes :: bytes1 - gasPriceSpeed
17- * offset 111/143/112 : X bytes :: bytes - source chain id
18- * offset 111/143/112 + X : Y bytes :: bytes - destination chain id
14+ * offset 110 : 1 bytes :: uint8 - dataType
15+ * offset 111 : X bytes :: bytes - source chain id
16+ * offset 111 + X : Y bytes :: bytes - destination chain id
1917
2018 * NOTE: when message structure is changed, make sure that MESSAGE_PACKING_VERSION from VersionableAMB is updated as well
2119 * NOTE: assembly code uses calldatacopy, make sure that message is passed as the first argument in the calldata
@@ -29,9 +27,8 @@ library ArbitraryMessage {
2927 address sender ,
3028 address executor ,
3129 uint32 gasLimit ,
32- bytes1 dataType ,
30+ uint8 dataType ,
3331 uint256 [2 ] chainIds ,
34- uint256 gasPrice ,
3532 bytes memory data
3633 )
3734 {
@@ -50,23 +47,16 @@ library ArbitraryMessage {
5047 executor := shr (96 , blob)
5148 gasLimit := and (shr (64 , blob), 0xffffffff )
5249
50+ dataType := byte (26 , blob)
51+ if gt (dataType, 0 ) {
52+ // for now, only 0 datatype is supported - regular AMB calls
53+ // other dataType values are kept reserved for future use
54+ revert (0 , 0 )
55+ }
56+
5357 // load source chain id length
5458 let chainIdLength := byte (24 , blob)
5559
56- dataType := and (shl (208 , blob), 0xFF00000000000000000000000000000000000000000000000000000000000000 )
57- switch dataType
58- case 0x0000000000000000000000000000000000000000000000000000000000000000 {
59- gasPrice := 0
60- }
61- case 0x0100000000000000000000000000000000000000000000000000000000000000 {
62- gasPrice := mload (add (_data, 111 )) // 32
63- srcdataptr := add (srcdataptr, 32 )
64- }
65- case 0x0200000000000000000000000000000000000000000000000000000000000000 {
66- gasPrice := 0
67- srcdataptr := add (srcdataptr, 1 )
68- }
69-
7060 // at this moment srcdataptr points to sourceChainId
7161
7262 // mask for sourceChainId
0 commit comments