darwinia-network / darwinia-messages-sol

Darwinia cross-chain messages gateway and protocol for EVM developers 💌
MIT License
30 stars 8 forks source link

Fee market bug fix #287

Closed hujw77 closed 1 year ago

hujw77 commented 1 year ago

Bug Analysis

if (_enough_balance(cur)) {
    array[index] = cur;
    index++;
} else {
    prune(prev, cur);
}
prev = cur;
cur = relayers[cur];
-------------------------------------
after prune(prev, cur)
cur = relayers[cur] is address(0)
so `!valid` error returned

Severity

High

Impact

If there are not_enough_balance relayers in first top location. Contract will return !valid error. We could use prune func to delist the relayers temporarily. Highly recommended to do an upgrade to fix the issue.

Fixed https://github.com/helix-bridge/helix-ui/issues/432

hujw77 commented 1 year ago

Upgraded on darwinia: https://darwinia.subscan.io/extrinsic/0xb21a787f1c4bd5ab2cf0ce5c25d9e6167c6796b99faeac24db4f2ee66cc43429

hujw77 commented 1 year ago

Upgraded on ethereum: https://etherscan.io/tx/0xf35c7a85aca434eb01284d3e1ddab5317a7b38f586192e0212dea616546e9d61#eventlog