@layerzerolabs/layerzero-v2-ton 3.0.44 → 3.0.46

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (109) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/build/AllStorages.compiled.json +1 -1
  3. package/build/BaseContract.test.compiled.json +1 -1
  4. package/build/Channel.compiled.json +1 -1
  5. package/build/Channel.permissions.test.compiled.json +1 -1
  6. package/build/ChannelBurn.test.compiled.json +1 -1
  7. package/build/ChannelCommitPacket.test.compiled.json +1 -1
  8. package/build/ChannelConfig.test.compiled.json +1 -1
  9. package/build/ChannelInitialize.test.compiled.json +1 -1
  10. package/build/ChannelMsglibIntegration.test.compiled.json +1 -1
  11. package/build/ChannelMsglibSendCallback.test.compiled.json +1 -1
  12. package/build/ChannelNilify.test.compiled.json +1 -1
  13. package/build/ChannelReceive.test.compiled.json +1 -1
  14. package/build/ChannelReceiveCallback.test.compiled.json +1 -1
  15. package/build/ChannelReceiveView.test.compiled.json +1 -1
  16. package/build/ChannelSend.test.compiled.json +1 -1
  17. package/build/ChannelSerde.test.compiled.json +1 -1
  18. package/build/Classlib.test.compiled.json +1 -1
  19. package/build/Connection.compiled.json +1 -1
  20. package/build/Controller.assertions.test.compiled.json +1 -1
  21. package/build/Controller.permissions.test.compiled.json +1 -1
  22. package/build/Controller.test.compiled.json +1 -1
  23. package/build/Counter.permissions.test.compiled.json +1 -1
  24. package/build/Counter.setters.test.compiled.json +1 -1
  25. package/build/Counter.test.compiled.json +1 -1
  26. package/build/Dvn.compiled.json +1 -1
  27. package/build/Dvn.test.compiled.json +1 -1
  28. package/build/DvnFeeLibSerde.test.compiled.json +1 -1
  29. package/build/DvnPermissions.test.compiled.json +1 -1
  30. package/build/DvnSerde.test.compiled.json +1 -1
  31. package/build/Endpoint.permissions.test.compiled.json +1 -1
  32. package/build/Endpoint.test.compiled.json +1 -1
  33. package/build/EndpointSerde.test.compiled.json +1 -1
  34. package/build/EndpointSetEpConfigDefaults.test.compiled.json +1 -1
  35. package/build/Executor.compiled.json +1 -1
  36. package/build/Executor.test.compiled.json +1 -1
  37. package/build/ExecutorFeeLibSerde.test.compiled.json +1 -1
  38. package/build/ExecutorPermissions.test.compiled.json +1 -1
  39. package/build/ExecutorSerde.test.compiled.json +1 -1
  40. package/build/LzClasses.test.compiled.json +1 -1
  41. package/build/LzClassesSerde.test.compiled.json +1 -1
  42. package/build/LzUtil.test.compiled.json +1 -1
  43. package/build/MsgData.test.compiled.json +1 -1
  44. package/build/MsgDataSerde.test.compiled.json +1 -1
  45. package/build/MsglibPacketCodec.test.compiled.json +1 -1
  46. package/build/PipelinedOutOfOrderSerde.test.compiled.json +1 -1
  47. package/build/PriceFeedCache.compiled.json +1 -1
  48. package/build/PriceFeedCache.test.compiled.json +1 -1
  49. package/build/PriceFeedCache.test.permissions.compiled.json +1 -1
  50. package/build/PriceFeedCacheSerde.test.compiled.json +1 -1
  51. package/build/PriceFeedFeeLibArbitrum.test.compiled.json +1 -1
  52. package/build/PriceFeedFeeLibDefault.test.compiled.json +1 -1
  53. package/build/PriceFeedFeeLibOptimism.test.compiled.json +1 -1
  54. package/build/PriceFeedFeeLibSerde.test.compiled.json +1 -1
  55. package/build/Proxy.compiled.json +1 -1
  56. package/build/Proxy.permissions.test.compiled.json +1 -1
  57. package/build/Proxy.test.compiled.json +1 -1
  58. package/build/SmlConnection.permissions.test.compiled.json +1 -1
  59. package/build/SmlConnection.test.compiled.json +1 -1
  60. package/build/SmlManager.permissions.test.compiled.json +1 -1
  61. package/build/SmlManager.test.compiled.json +1 -1
  62. package/build/TxnContext.test.compiled.json +1 -1
  63. package/build/Uln.compiled.json +1 -1
  64. package/build/Uln.test.compiled.json +1 -1
  65. package/build/UlnConnection.compiled.json +1 -1
  66. package/build/UlnConnection.test.compiled.json +1 -1
  67. package/build/UlnConnectionPermissions.test.compiled.json +1 -1
  68. package/build/UlnConnectionSerde.test.compiled.json +1 -1
  69. package/build/UlnManagement.test.compiled.json +1 -1
  70. package/build/UlnManager.compiled.json +1 -1
  71. package/build/UlnManager.test.compiled.json +1 -1
  72. package/build/UlnManagerPermissions.test.compiled.json +1 -1
  73. package/build/UlnManagerUtil.test.compiled.json +1 -1
  74. package/build/UlnMsgDataSerde.test.compiled.json +1 -1
  75. package/build/UlnPermissions.test.compiled.json +1 -1
  76. package/build/UlnReceiveConfig.test.compiled.json +1 -1
  77. package/build/UlnSend.test.compiled.json +1 -1
  78. package/build/UlnSendConfig.test.compiled.json +1 -1
  79. package/build/UlnSendWithArbDvnFeeLib.test.compiled.json +1 -1
  80. package/build/UlnSendWithArbExecFeeLib.test.compiled.json +1 -1
  81. package/build/UlnSendWithDefaultDvnFeeLib.test.compiled.json +1 -1
  82. package/build/UlnSendWithDefaultExecFeeLib.test.compiled.json +1 -1
  83. package/build/UlnSendWithOpDvnFeeLib.test.compiled.json +1 -1
  84. package/build/UlnSendWithOpExecFeeLib.test.compiled.json +1 -1
  85. package/build/UlnSendWorkerFactory.test.compiled.json +1 -1
  86. package/build/UlnSerde.test.compiled.json +1 -1
  87. package/build/UlnUtil.test.compiled.json +1 -1
  88. package/build/WorkerCore.test.compiled.json +1 -1
  89. package/build/WorkerCoreMsgDataSerde.test.compiled.json +1 -1
  90. package/build/WorkerCoreSerde.test.compiled.json +1 -1
  91. package/build/badFeeLib1.test.compiled.json +1 -1
  92. package/build/badFeeLib10.test.compiled.json +1 -1
  93. package/build/badFeeLib11.test.compiled.json +1 -1
  94. package/build/badFeeLib12.test.compiled.json +1 -1
  95. package/build/badFeeLib2.test.compiled.json +1 -1
  96. package/build/badFeeLib3.test.compiled.json +1 -1
  97. package/build/badFeeLib4.test.compiled.json +1 -1
  98. package/build/badFeeLib5.test.compiled.json +1 -1
  99. package/build/badFeeLib6.test.compiled.json +1 -1
  100. package/build/badFeeLib7.test.compiled.json +1 -1
  101. package/build/badFeeLib8.test.compiled.json +1 -1
  102. package/build/badFeeLib9.test.compiled.json +1 -1
  103. package/package.json +1 -1
  104. package/src/funC++/actions/payment.fc +2 -1
  105. package/src/funC++/contractMain.fc +2 -1
  106. package/src/funC++/handlerCore.fc +0 -1
  107. package/src/protocol/channel/handler.fc +38 -28
  108. package/src/protocol/msglibs/ultralightnode/msgdata/UlnSendConfig.fc +3 -4
  109. package/src/protocol/msglibs/ultralightnode/ulnManager/handler.fc +2 -2
@@ -341,7 +341,7 @@ tuple channelSend(cell $mdObj) impure inline method_id {
341
341
 
342
342
  if ((sendMsglibManager == NULLADDRESS) | (sendMsglib == NULLADDRESS) | (sendMsglibConnection == NULLADDRESS)) {
343
343
  actions~pushAction<call>(
344
- $sendPath.lz::Path::getSrcOApp(),
344
+ $sendPath.lz::Path::getSrcOApp(), ;; the OApp on this chain
345
345
  Layerzero::OP::CHANNEL_SEND_CALLBACK,
346
346
  md::MdObj::New(
347
347
  md::MessagingReceipt::New(
@@ -392,7 +392,7 @@ tuple channelSend(cell $mdObj) impure inline method_id {
392
392
  ;; callback to the oApp with a failure and emit an event
393
393
  actions~pushAction<event>(Channel::ERROR::sendQueueCongested, $lzSend);
394
394
  actions~pushAction<call>(
395
- $sendPath.lz::Path::getSrcOApp(),
395
+ $sendPath.lz::Path::getSrcOApp(), ;; the OApp on this chain
396
396
  Layerzero::OP::CHANNEL_SEND_CALLBACK,
397
397
  md::MdObj::New(
398
398
  md::MessagingReceipt::New($lzSend, 0, 0, Channel::ERROR::sendQueueCongested),
@@ -555,7 +555,7 @@ tuple msglibSendCallback(cell $mdMsglibSendCallback) impure inline method_id {
555
555
  setContractStorage($storage);
556
556
 
557
557
  actions~pushAction<call>(
558
- $sendPath.lz::Path::getSrcOApp(),
558
+ $sendPath.lz::Path::getSrcOApp(), ;; the OApp on this chain
559
559
  Layerzero::OP::CHANNEL_SEND_CALLBACK,
560
560
  md::MdObj::build(
561
561
  md::MessagingReceipt::build(
@@ -685,7 +685,7 @@ tuple lzReceivePrepare(cell $lzReceivePrepareMd) impure inline method_id {
685
685
 
686
686
  ;; extract oApp from path
687
687
  actions~pushAction<dispatch>(
688
- $storage.Channel::getPath().lz::Path::getSrcOApp(),
688
+ $storage.Channel::getPath().lz::Path::getSrcOApp(), ;; the OApp on this chain
689
689
  Layerzero::OP::LZ_RECEIVE_PREPARE,
690
690
  ;; Throws if the Packet is not executable
691
691
  _getExecutablePacket(nonce),
@@ -711,7 +711,7 @@ tuple lzReceiveLock(cell $nonceMd) impure inline method_id {
711
711
  (
712
712
  cell executionQueue,
713
713
  cell $commitPOOO,
714
- cell $path
714
+ cell $sendPath
715
715
  ) = $storage.Channel::getLzReceiveLockInformation();
716
716
 
717
717
  (int actualKey, cell $packet, int status, _) = DeterministicInsertionCircularQueue::get(
@@ -740,14 +740,17 @@ tuple lzReceiveLock(cell $nonceMd) impure inline method_id {
740
740
  );
741
741
 
742
742
  actions~pushAction<call>(
743
- $path.lz::Path::getSrcOApp(),
743
+ $sendPath.lz::Path::getSrcOApp(), ;; the OApp on this chain
744
744
  Layerzero::OP::LZ_RECEIVE_EXECUTE,
745
745
  md::MdObj::build($packet, getInitialStorage())
746
746
  );
747
747
  } else {
748
748
  actions~pushAction<event>(
749
749
  Channel::event::NOT_EXECUTABLE,
750
- md::PacketId::New($storage.Channel::getPath(), incomingNonce)
750
+ md::PacketId::New(
751
+ $sendPath.lz::Path::reverse(), ;; emit the receive path
752
+ incomingNonce
753
+ )
751
754
  );
752
755
  }
753
756
 
@@ -766,10 +769,16 @@ tuple lzReceiveLock(cell $nonceMd) impure inline method_id {
766
769
  tuple lzReceiveExecuteCallback(cell $lzReceiveStatus) impure inline method_id {
767
770
  (cell $storage, tuple actions) = preamble();
768
771
 
769
- (int lzReceiveSuccess, int packetNonce) = $lzReceiveStatus
770
- .md::LzReceiveStatus::getSuccessAndNonce();
771
- (cell $executePOOO, cell executionQueue, cell $path) = $storage
772
- .Channel::getExecutePOOOAndExecutionQueueAndPath();
772
+ (
773
+ int lzReceiveSuccess,
774
+ int packetNonce
775
+ ) = $lzReceiveStatus.md::LzReceiveStatus::getSuccessAndNonce();
776
+
777
+ (
778
+ cell $executePOOO,
779
+ cell executionQueue,
780
+ cell $sendPath
781
+ ) = $storage.Channel::getExecutePOOOAndExecutionQueueAndPath();
773
782
 
774
783
  (int actualKey, cell $packet, int status, _) = DeterministicInsertionCircularQueue::get(
775
784
  executionQueue,
@@ -792,7 +801,10 @@ tuple lzReceiveExecuteCallback(cell $lzReceiveStatus) impure inline method_id {
792
801
  ;; emit Packet in the manager
793
802
  actions~pushAction<event>(
794
803
  Channel::event::DELIVERED,
795
- md::PacketId::build($path, packetNonce)
804
+ md::PacketId::build(
805
+ $sendPath.lz::Path::optimizedReverse(), ;; emit the receive path
806
+ packetNonce
807
+ )
796
808
  );
797
809
  } else {
798
810
  executionQueue = DeterministicInsertionCircularQueue::set(
@@ -854,14 +866,13 @@ tuple lzReceiveExecuteCallback(cell $lzReceiveStatus) impure inline method_id {
854
866
  ;; @permissions only-oApp
855
867
  tuple nilify(cell $packetId) impure inline method_id {
856
868
  (cell $storage, tuple actions) = preamble();
857
-
858
- cell $sanitizedPacketId = $packetId.md::PacketId::sanitize();
869
+ $packetId = $packetId.md::PacketId::sanitize();
859
870
 
860
871
  ;; reverse the path because this is from a receive perspective
861
- cell $receivePath = $storage.Channel::getPath().lz::Path::optimizedReverse();
862
- _assertEqualPaths($receivePath, $sanitizedPacketId.cl::get<objRef>(md::PacketId::path));
872
+ cell $receivePath = $storage.Channel::getPath().lz::Path::reverse();
873
+ _assertEqualPaths($receivePath, $packetId.cl::get<objRef>(md::PacketId::path));
863
874
 
864
- int incomingNonce = $sanitizedPacketId.cl::get<uint64>(md::PacketId::nonce);
875
+ int incomingNonce = $packetId.cl::get<uint64>(md::PacketId::nonce);
865
876
 
866
877
  (int isCommittable, cell $previousPacket) = _nonceCommittable(incomingNonce);
867
878
  throw_unless(Channel::ERROR::notCommittable, isCommittable);
@@ -884,9 +895,9 @@ tuple nilify(cell $packetId) impure inline method_id {
884
895
  actions~pushAction<event>(Channel::event::PACKET_NILIFIED, $previousPacket);
885
896
 
886
897
  actions~pushAction<call>(
887
- $receivePath.cl::get<address>(lz::Path::dstOApp),
898
+ $receivePath.cl::get<address>(lz::Path::dstOApp), ;; the OApp on this chain
888
899
  Layerzero::OP::NILIFY_CALLBACK,
889
- md::MdObj::build($sanitizedPacketId, getInitialStorage())
900
+ md::MdObj::build($packetId, getInitialStorage())
890
901
  );
891
902
 
892
903
  return actions;
@@ -894,14 +905,13 @@ tuple nilify(cell $packetId) impure inline method_id {
894
905
 
895
906
  tuple burn(cell $packetId) impure inline method_id {
896
907
  (cell $storage, tuple actions) = preamble();
897
-
898
- cell $sanitizedPacketId = $packetId.md::PacketId::sanitize();
908
+ cell $packetId = $packetId.md::PacketId::sanitize();
899
909
 
900
910
  ;; reverse the path because this is from a receive perspective
901
- cell $receivePath = lz::Path::reverse($storage.Channel::getPath());
902
- _assertEqualPaths($receivePath, $sanitizedPacketId.cl::get<objRef>(md::PacketId::path));
911
+ cell $receivePath = $storage.Channel::getPath().lz::Path::reverse();
912
+ _assertEqualPaths($receivePath, $packetId.cl::get<objRef>(md::PacketId::path));
903
913
 
904
- int nonce = $sanitizedPacketId.cl::get<uint64>(md::PacketId::nonce);
914
+ int nonce = $packetId.cl::get<uint64>(md::PacketId::nonce);
905
915
 
906
916
  cell $nonceMd = md::Nonce::New(nonce);
907
917
 
@@ -927,7 +937,7 @@ tuple burn(cell $packetId) impure inline method_id {
927
937
  );
928
938
 
929
939
  actions~pushAction<call>(
930
- $receivePath.cl::get<address>(lz::Path::dstOApp),
940
+ $receivePath.cl::get<address>(lz::Path::dstOApp), ;; the OApp on this chain
931
941
  Layerzero::OP::BURN_CALLBACK,
932
942
  md::MdObj::build(
933
943
  md::PacketId::New($receivePath, nonce),
@@ -970,11 +980,11 @@ tuple depositZro(cell $coinsAmount) impure inline method_id {
970
980
  tuple forceAbort(cell $lzSend) impure inline method_id {
971
981
  (cell $storage, tuple actions) = preamble();
972
982
 
973
- cell $path = $storage.cl::get<objRef>(Channel::path);
983
+ cell $sendPath = $storage.cl::get<objRef>(Channel::path);
974
984
  ;; $lzSend does not need to be sanitized, as it must be correct to match
975
985
  ;; the stored hash
976
986
  _assertEqualPaths(
977
- $path,
987
+ $sendPath,
978
988
  $lzSend.md::LzSend::getPath()
979
989
  );
980
990
 
@@ -998,7 +1008,7 @@ tuple forceAbort(cell $lzSend) impure inline method_id {
998
1008
  );
999
1009
 
1000
1010
  actions~pushAction<call>(
1001
- $path.cl::get<address>(lz::Path::srcOApp),
1011
+ $sendPath.cl::get<address>(lz::Path::srcOApp), ;; the OApp on this chain
1002
1012
  Layerzero::OP::CHANNEL_SEND_CALLBACK,
1003
1013
  md::MdObj::New(
1004
1014
  md::MessagingReceipt::New($lzSend, 0, 0, Channel::ERROR::sendAborted),
@@ -59,11 +59,10 @@ cell UlnSendConfig::New(
59
59
  );
60
60
  }
61
61
 
62
- ;; todo update these default values
63
62
  cell UlnSendConfig::NewWithDefaults() impure method_id {
64
63
  return UlnSendConfig::New(
65
- 0,
66
- 0,
64
+ 100 * 1000, ;; Default worker quote gas limit
65
+ 40, ;; Default max message bytes
67
66
  true,
68
67
  NULLADDRESS,
69
68
  true,
@@ -71,7 +70,7 @@ cell UlnSendConfig::NewWithDefaults() impure method_id {
71
70
  true,
72
71
  empty_cell(),
73
72
  true,
74
- 0
73
+ 1 ;; Default confirmations
75
74
  );
76
75
  }
77
76
 
@@ -160,7 +160,7 @@ int _calculateUlnConnectionAddress(cell $storage, cell $path) impure inline meth
160
160
  ;;; ==========================HANDLERS=====================================
161
161
 
162
162
  ;; @in_opcode UlnManager::OP::DEPLOY_ULN
163
- ;; @in_md todo { eid }
163
+ ;; @in_md Deploy
164
164
  ;; @permissions only-owner
165
165
  ;; @out_actions deploy the uln for this particular eid
166
166
  tuple deployUln(cell $deploy) impure inline method_id {
@@ -189,7 +189,7 @@ tuple deployUln(cell $deploy) impure inline method_id {
189
189
  }
190
190
 
191
191
  ;; @in_opcode MsglibManager::OP::DEPLOY_CONNECTION
192
- ;; @in_md todo { oApp_path, shard }
192
+ ;; @in_md md::Deploy
193
193
  ;; @permissions seeded by caller address
194
194
  ;; @out_actions deploy the connection for this particular oApp path
195
195
  tuple deployUlnConnection(cell $deploy) impure inline method_id {