You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For IMA S2S transfers we collect data(endpoints, ports, etc) for all schains on the network. This operation take some time and we have huge amount of calls to mainnet.
Suggestion: To avoid overload validator geth ima and agent, collect data only from connected schain.(isConnected: true)
Instead of collect all data for all schains. You can get all schainHashes for the network then convert each schainHash to name and check is this chain connected and then collect data for current chain.
Steps:
SchainsInternal.getSchains() will return all schainHashes for all schains in the network
schainName = SchainsInternal.getSchainName(schainHash) will convert schainHash to schainName
MessageProxyForSchain.isConnectedChain(schainName) will check is schain connected to current schain
Pseudocode:
async function isSchainHashConnected(schainHash: bytes32) {
const schainName = await SchainsInternal.getSchainName(schainHash);
return await MessageProxyForSchain.isConnectedChain(schainName);
}
async function collectDataForSchain(schainHash: bytes32) {
....
}
async function collectDataForConnectedSchains() {
let allCollectedData;
const allSchainHashes = await SchainsInternal.getSchains();
for schainHash in allSchainHashes {
if (await isSchainHashConnected(schainHash)) {
allCollectedData.add(await collectDataForSchain(schainHash));
}
}
return allCollectedData;
}
Solidity Help:
With this code amount of calls would be 2 * N + 1, where N is number of schains in the network, to get all schainHashes which connected to current schain.
We can add a EnumerableSet of connected schainHashes to the MessageProxyForSchain and it would be necessary to call only one function, but it would require to finalize Upgrade procedure on Schains.
Or we can add events to connectSchain function and update collected data by checking events, but overall it requires upgrade procedure on Schains.
The text was updated successfully, but these errors were encountered:
Accroding to design of SChains/SChainsInternal smart contracts of SKALE Manager we had to get all S-Chains first, and then call isConnectedChain for each of them to find out all S-Chains really connected to one particular S-Chain. I.e. we cannot escape enumerating all S-Chains of SKALE Network.
For IMA S2S transfers we collect data(endpoints, ports, etc) for all schains on the network. This operation take some time and we have huge amount of calls to mainnet.
Suggestion: To avoid overload validator geth ima and agent, collect data only from connected schain.(isConnected: true)
Instead of collect all data for all schains. You can get all schainHashes for the network then convert each schainHash to name and check is this chain connected and then collect data for current chain.
Steps:
SchainsInternal.getSchains()
will return all schainHashes for all schains in the networkschainName = SchainsInternal.getSchainName(schainHash)
will convert schainHash to schainNameMessageProxyForSchain.isConnectedChain(schainName)
will check is schain connected to current schainPseudocode:
Solidity Help:
With this code amount of calls would be
2 * N + 1
, whereN
is number of schains in the network, to get all schainHashes which connected to current schain.We can add a EnumerableSet of connected schainHashes to the MessageProxyForSchain and it would be necessary to call only one function, but it would require to finalize Upgrade procedure on Schains.
Or we can add events to connectSchain function and update collected data by checking events, but overall it requires upgrade procedure on Schains.
The text was updated successfully, but these errors were encountered: