@layerzerolabs/layerzero-v2-ton 3.0.31-ton.2 → 3.0.31
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 +7 -0
- package/build/AllStorages.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.compiled.json +1 -1
- package/build/Controller.permissions.test.compiled.json +1 -1
- package/build/Controller.test.compiled.json +1 -1
- package/build/Counter.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.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/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.compiled.json +1 -1
- package/build/SmlConnection.permissions.test.compiled.json +1 -1
- package/build/SmlConnection.test.compiled.json +1 -1
- package/build/SmlManager.compiled.json +1 -1
- package/build/SmlManager.permissions.test.compiled.json +1 -1
- package/build/SmlManager.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/UlnSendWithDvnFeeLib.test.compiled.json +1 -1
- package/build/UlnSendWithExecFeeLib.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/classes/lz/Config.fc +13 -0
- package/src/classes/lz/Packet.fc +4 -0
- package/src/classes/msgdata/LzSend.fc +8 -0
- package/src/classes/msgdata/MdObj.fc +8 -0
- package/src/classes/msgdata/OptionsExtended.fc +12 -0
- package/src/protocol/channel/handler.fc +7 -1
- package/src/protocol/channel/storage.fc +13 -4
- package/src/protocol/controller/handler.fc +27 -8
- package/src/protocol/endpoint/storage.fc +9 -0
- package/tests/baseSerdeTest.fc +1 -1
|
@@ -116,31 +116,50 @@ int _verifyEventSender(int sender, cell $senderStorageInit) impure method_id {
|
|
|
116
116
|
}
|
|
117
117
|
|
|
118
118
|
int storageType = cl::typeof($senderStorageInit);
|
|
119
|
-
int senderOwner =
|
|
120
|
-
.cl::get<objRef>(BASE_STORAGE_INDEX)
|
|
121
|
-
.cl::get<address>(BaseStorage::owner);
|
|
122
|
-
|
|
123
|
-
;; If senderOwner != controller address, then this event sender might be using the correct
|
|
124
|
-
;; bytecode and storage but be part of a different LayerZero protocol deployment owned
|
|
125
|
-
;; by a different signer.
|
|
126
|
-
throw_if(BaseInterface::ERROR::invalidEventSource, senderOwner != getContractAddress());
|
|
119
|
+
int senderOwner = NULLADDRESS;
|
|
127
120
|
|
|
128
121
|
if (storageType == Endpoint::NAME) {
|
|
122
|
+
cell $endpointStorageInit = Endpoint::sanitize($senderStorageInit);
|
|
123
|
+
throw_if(
|
|
124
|
+
BaseInterface::ERROR::invalidEventSource,
|
|
125
|
+
$endpointStorageInit.cl::hash() != $senderStorageInit.cl::hash()
|
|
126
|
+
);
|
|
127
|
+
|
|
129
128
|
cell endpointCode = $storage.cl::get<cellRef>(Controller::endpointCode);
|
|
130
129
|
throw_unless(
|
|
131
130
|
BaseInterface::ERROR::invalidEventSource,
|
|
132
131
|
sender == computeContractAddress($senderStorageInit, endpointCode)
|
|
133
132
|
);
|
|
133
|
+
|
|
134
|
+
senderOwner = $endpointStorageInit
|
|
135
|
+
.cl::get<objRef>(Endpoint::baseStorage)
|
|
136
|
+
.cl::get<address>(BaseStorage::owner);
|
|
137
|
+
|
|
134
138
|
} elseif (storageType == Channel::NAME) {
|
|
139
|
+
cell $channelStorageInit = Channel::sanitize($senderStorageInit);
|
|
140
|
+
throw_if(
|
|
141
|
+
BaseInterface::ERROR::invalidEventSource,
|
|
142
|
+
$channelStorageInit.cl::hash() != $senderStorageInit.cl::hash()
|
|
143
|
+
);
|
|
144
|
+
|
|
135
145
|
cell channelCode = $storage.cl::get<cellRef>(Controller::channelCode);
|
|
136
146
|
throw_unless(
|
|
137
147
|
BaseInterface::ERROR::invalidEventSource,
|
|
138
148
|
sender == computeContractAddress($senderStorageInit, channelCode)
|
|
139
149
|
);
|
|
150
|
+
|
|
151
|
+
senderOwner = $channelStorageInit
|
|
152
|
+
.cl::get<objRef>(Channel::baseStorage)
|
|
153
|
+
.cl::get<address>(BaseStorage::owner);
|
|
140
154
|
} else {
|
|
141
155
|
throw(BaseInterface::ERROR::invalidEventSource);
|
|
142
156
|
}
|
|
143
157
|
|
|
158
|
+
;; If senderOwner != controller address, then this event sender might be using the correct
|
|
159
|
+
;; bytecode and storage but be part of a different LayerZero protocol deployment owned
|
|
160
|
+
;; by a different signer.
|
|
161
|
+
throw_if(BaseInterface::ERROR::invalidEventSource, senderOwner != getContractAddress());
|
|
162
|
+
|
|
144
163
|
return true;
|
|
145
164
|
}
|
|
146
165
|
|
|
@@ -98,4 +98,13 @@ cell Endpoint::getDefaultTimeoutReceiveLibInfo(cell $self) impure inline {
|
|
|
98
98
|
selfSlice.preloadRefAt(2).cellPreloadRefAt(3),
|
|
99
99
|
selfSlice.preloadRefAt(3).cellPreloadRefAt(0)
|
|
100
100
|
);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
cell Endpoint::sanitize(cell $self) impure inline {
|
|
104
|
+
cell $baseStorage = $self.cl::get<cellRef>(Endpoint::baseStorage);
|
|
105
|
+
return Endpoint::New(
|
|
106
|
+
$self.cl::get<uint32>(Endpoint::eid),
|
|
107
|
+
$self.cl::get<uint32>(Endpoint::dstEid),
|
|
108
|
+
$baseStorage.cl::get<address>(BaseStorage::owner)
|
|
109
|
+
);
|
|
101
110
|
}
|
package/tests/baseSerdeTest.fc
CHANGED
|
@@ -82,7 +82,7 @@ cell baseTest::prepare(tuple args) impure {
|
|
|
82
82
|
while (idx < expected.tlen()) {
|
|
83
83
|
if (expected.at(idx).is_cell() & actual.at(idx).is_cell()) {
|
|
84
84
|
if (expected.at(idx).cell_hash() != actual.at(idx).cell_hash()) {
|
|
85
|
-
return (TEST_FAILED, "expected cell != actual cell");
|
|
85
|
+
return (TEST_FAILED, "expected cell at idx ".str::concatInt(idx).str::concat(" != actual cell"));
|
|
86
86
|
}
|
|
87
87
|
} elseif (expected.at(idx).is_int() & actual.at(idx).is_int()) {
|
|
88
88
|
if (expected.at(idx) != actual.at(idx)) {
|