node: Fix issue where transfers that were loaded from the DB did not add
a flow-cancel transfer on the TargetChain
Flow-canceling is done in the `ProcessMsgForTime` loop when a new
message occurs. However, this was not done when a node restarted and
reloaded transfers from the past 24 hours. As a result it was possible
for the node to calculate a result that showed that the outgoing
transfers for an emitter chain exceeded the daily limit. In effect this
is true but only with the condition that there was incoming flow to
allow this to happen. This appeared to violate an invariant and so the
node did not start properly.
Add unit tests when reloading flow cancel transactions from the
database
* node: add more unit tests for flow cancel
* node: Fix tokenEntry indexing issue in Governor flow cancel logic
- Indexes the tokenEntry for flow cancel tokens properly (using the
token's origin chain and origin address
- Add many more tests to check flow cancel logic in more detail and at
the resolution of the ProcessMsgForTime method.
Big thanks to Max for helping to debug the issue and the unit tests.
* node: add check to ensure the governor usage is not zero
* node: Change flow cancel test so that origin and emitter chain are different
* node: Add unit test for partial flow cancel
Add additional test for flow cancel mechanism where the numbers do not
cleanly cancel out.
* node: fix lint issues in governor test
* Update ChainGovernorResetReleaseTimerRequest protobuf message
* Add numDays argument to governor-reset-release-timer command
* Update governor backend to support numDays argument
* Address review comments
* Add test for resetReleaseTimerForTime()'s numDays parameter
* Address review comments
* Add adminrpc test for ChainGovernorResetReleaseTimer
* Replace hardcoded upper boundaries with maxResetReleaseTimerDays
* Update governor whitepaper to reflect the new argument
* Added default value to governor whitepaper
---------
Co-authored-by: Jason Matthyser <jason@asymmetric.re>
Flow Cancel
A 'flow cancel' transfer occurs when all of the following are true:
An emitter chain is governed by the Governor
A transfer has a TargetChain equal to the emitter
A transfer's Timestamp is within the usual 24 hour window used by the Governor
The asset in the transfer has fields OriginChain and OriginAddress equal to an entry in the allow list
Example scenario
A particular USDC implementation minted on Ethereum. It is allow-listed.
A transfer of $1,000 of this asset is sent from Solana to Sui.
Before the transfer, Sui's usage is $10,000.
Before the transfer, Solana's usage is $0.
After the transfer is processed, Sui's new usage will be $9,000 (flow cancel) and Solana's new usage will be $1,000 (as usual).
* Add instructions for `v2.18.1.1` and `v2.24.2-wormchaind` upgrades. Add halt-height to `v2.14.9.6`.
* Update snapshot sync instructions to latest version
* Fix latest version comment
* Use `halt-height` when syncing with `v2.18.1`
* node: add manual token list for Mantle
* node: add additional mantle tokens
* node: remove incorrect manual token for mantle
* node: Fix mantle token links
Source all token addresses from https://explorer.mantle.xyz/,
cross-referenced with CoinGecko's results for top Mantle tokens by daily
volume
Solana binary releases are pulled from their github regularly, which
breaks any process that needs to download a specific binary (e.g. CI).
Instead of relying on github caching, we use the prebuilt docker image
that's also used in tilt, which has the appropriate solana version built
in.
* wormchain: conditionally enable new guardian set expiration logic
The new code path costs more gas, so it changes the app hash.
By guarding the new code path behind a block height, consensus does not
break (as every validator that upgrades by that block will switch at the
same block height).
* wormchain: update mainnet cutover block height
* wormchain: update cutover to 24 hours later
---------
Co-authored-by: Csongor Kiss <kiss.csongor.kiss@gmail.com>
* node: add x layer tokens to manual_tokens.go
- Coin Gecko IDs left blank here because there is no entry for these
tokens yet
- Prices are taken from the chain explorer directly
* node: Update X Layer manual token list
- Fix Chain ID
- Add more tokens with >50k daily volume
- Add CG IDs for tokens that have them
- Add commented out tokens that have high volume but no CH entries
- Update prices (use CG price where available)
* node: remove tokens without CoinGecko IDs