@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.
- package/CHANGELOG.md +12 -0
- package/build/AllStorages.compiled.json +1 -1
- package/build/BaseContract.test.compiled.json +1 -1
- package/build/Channel.compiled.json +1 -1
- package/build/Channel.permissions.test.compiled.json +1 -1
- package/build/ChannelBurn.test.compiled.json +1 -1
- package/build/ChannelCommitPacket.test.compiled.json +1 -1
- package/build/ChannelConfig.test.compiled.json +1 -1
- package/build/ChannelInitialize.test.compiled.json +1 -1
- package/build/ChannelMsglibIntegration.test.compiled.json +1 -1
- package/build/ChannelMsglibSendCallback.test.compiled.json +1 -1
- package/build/ChannelNilify.test.compiled.json +1 -1
- package/build/ChannelReceive.test.compiled.json +1 -1
- package/build/ChannelReceiveCallback.test.compiled.json +1 -1
- package/build/ChannelReceiveView.test.compiled.json +1 -1
- package/build/ChannelSend.test.compiled.json +1 -1
- package/build/ChannelSerde.test.compiled.json +1 -1
- package/build/Classlib.test.compiled.json +1 -1
- package/build/Connection.compiled.json +1 -1
- package/build/Controller.assertions.test.compiled.json +1 -1
- package/build/Controller.permissions.test.compiled.json +1 -1
- package/build/Controller.test.compiled.json +1 -1
- package/build/Counter.permissions.test.compiled.json +1 -1
- package/build/Counter.setters.test.compiled.json +1 -1
- package/build/Counter.test.compiled.json +1 -1
- package/build/Dvn.compiled.json +1 -1
- package/build/Dvn.test.compiled.json +1 -1
- package/build/DvnFeeLibSerde.test.compiled.json +1 -1
- package/build/DvnPermissions.test.compiled.json +1 -1
- package/build/DvnSerde.test.compiled.json +1 -1
- package/build/Endpoint.permissions.test.compiled.json +1 -1
- package/build/Endpoint.test.compiled.json +1 -1
- package/build/EndpointSerde.test.compiled.json +1 -1
- package/build/EndpointSetEpConfigDefaults.test.compiled.json +1 -1
- package/build/Executor.compiled.json +1 -1
- package/build/Executor.test.compiled.json +1 -1
- package/build/ExecutorFeeLibSerde.test.compiled.json +1 -1
- package/build/ExecutorPermissions.test.compiled.json +1 -1
- package/build/ExecutorSerde.test.compiled.json +1 -1
- package/build/LzClasses.test.compiled.json +1 -1
- package/build/LzClassesSerde.test.compiled.json +1 -1
- package/build/LzUtil.test.compiled.json +1 -1
- package/build/MsgData.test.compiled.json +1 -1
- package/build/MsgDataSerde.test.compiled.json +1 -1
- package/build/MsglibPacketCodec.test.compiled.json +1 -1
- package/build/PipelinedOutOfOrderSerde.test.compiled.json +1 -1
- package/build/PriceFeedCache.compiled.json +1 -1
- package/build/PriceFeedCache.test.compiled.json +1 -1
- package/build/PriceFeedCache.test.permissions.compiled.json +1 -1
- package/build/PriceFeedCacheSerde.test.compiled.json +1 -1
- package/build/PriceFeedFeeLibArbitrum.test.compiled.json +1 -1
- package/build/PriceFeedFeeLibDefault.test.compiled.json +1 -1
- package/build/PriceFeedFeeLibOptimism.test.compiled.json +1 -1
- package/build/PriceFeedFeeLibSerde.test.compiled.json +1 -1
- package/build/Proxy.compiled.json +1 -1
- package/build/Proxy.permissions.test.compiled.json +1 -1
- package/build/Proxy.test.compiled.json +1 -1
- package/build/SmlConnection.permissions.test.compiled.json +1 -1
- package/build/SmlConnection.test.compiled.json +1 -1
- package/build/SmlManager.permissions.test.compiled.json +1 -1
- package/build/SmlManager.test.compiled.json +1 -1
- package/build/TxnContext.test.compiled.json +1 -1
- package/build/Uln.compiled.json +1 -1
- package/build/Uln.test.compiled.json +1 -1
- package/build/UlnConnection.compiled.json +1 -1
- package/build/UlnConnection.test.compiled.json +1 -1
- package/build/UlnConnectionPermissions.test.compiled.json +1 -1
- package/build/UlnConnectionSerde.test.compiled.json +1 -1
- package/build/UlnManagement.test.compiled.json +1 -1
- package/build/UlnManager.compiled.json +1 -1
- package/build/UlnManager.test.compiled.json +1 -1
- package/build/UlnManagerPermissions.test.compiled.json +1 -1
- package/build/UlnManagerUtil.test.compiled.json +1 -1
- package/build/UlnMsgDataSerde.test.compiled.json +1 -1
- package/build/UlnPermissions.test.compiled.json +1 -1
- package/build/UlnReceiveConfig.test.compiled.json +1 -1
- package/build/UlnSend.test.compiled.json +1 -1
- package/build/UlnSendConfig.test.compiled.json +1 -1
- package/build/UlnSendWithArbDvnFeeLib.test.compiled.json +1 -1
- package/build/UlnSendWithArbExecFeeLib.test.compiled.json +1 -1
- package/build/UlnSendWithDefaultDvnFeeLib.test.compiled.json +1 -1
- package/build/UlnSendWithDefaultExecFeeLib.test.compiled.json +1 -1
- package/build/UlnSendWithOpDvnFeeLib.test.compiled.json +1 -1
- package/build/UlnSendWithOpExecFeeLib.test.compiled.json +1 -1
- package/build/UlnSendWorkerFactory.test.compiled.json +1 -1
- package/build/UlnSerde.test.compiled.json +1 -1
- package/build/UlnUtil.test.compiled.json +1 -1
- package/build/WorkerCore.test.compiled.json +1 -1
- package/build/WorkerCoreMsgDataSerde.test.compiled.json +1 -1
- package/build/WorkerCoreSerde.test.compiled.json +1 -1
- package/build/badFeeLib1.test.compiled.json +1 -1
- package/build/badFeeLib10.test.compiled.json +1 -1
- package/build/badFeeLib11.test.compiled.json +1 -1
- package/build/badFeeLib12.test.compiled.json +1 -1
- package/build/badFeeLib2.test.compiled.json +1 -1
- package/build/badFeeLib3.test.compiled.json +1 -1
- package/build/badFeeLib4.test.compiled.json +1 -1
- package/build/badFeeLib5.test.compiled.json +1 -1
- package/build/badFeeLib6.test.compiled.json +1 -1
- package/build/badFeeLib7.test.compiled.json +1 -1
- package/build/badFeeLib8.test.compiled.json +1 -1
- package/build/badFeeLib9.test.compiled.json +1 -1
- package/package.json +1 -1
- package/src/funC++/actions/payment.fc +2 -1
- package/src/funC++/contractMain.fc +2 -1
- package/src/funC++/handlerCore.fc +0 -1
- package/src/protocol/channel/handler.fc +38 -28
- package/src/protocol/msglibs/ultralightnode/msgdata/UlnSendConfig.fc +3 -4
- 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 $
|
|
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
|
-
$
|
|
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(
|
|
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
|
-
(
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
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(
|
|
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::
|
|
862
|
-
_assertEqualPaths($receivePath, $
|
|
872
|
+
cell $receivePath = $storage.Channel::getPath().lz::Path::reverse();
|
|
873
|
+
_assertEqualPaths($receivePath, $packetId.cl::get<objRef>(md::PacketId::path));
|
|
863
874
|
|
|
864
|
-
int incomingNonce = $
|
|
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($
|
|
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 =
|
|
902
|
-
_assertEqualPaths($receivePath, $
|
|
911
|
+
cell $receivePath = $storage.Channel::getPath().lz::Path::reverse();
|
|
912
|
+
_assertEqualPaths($receivePath, $packetId.cl::get<objRef>(md::PacketId::path));
|
|
903
913
|
|
|
904
|
-
int 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 $
|
|
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
|
-
$
|
|
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
|
-
$
|
|
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
|
-
|
|
66
|
-
|
|
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
|
-
|
|
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
|
|
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
|
|
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 {
|