Skip to content

Revert on estimate if destination is not setup#702

Merged
hieronx merged 1 commit intomainfrom
revert-on-estimate
Oct 7, 2025
Merged

Revert on estimate if destination is not setup#702
hieronx merged 1 commit intomainfrom
revert-on-estimate

Conversation

@hieronx
Copy link
Copy Markdown
Contributor

@hieronx hieronx commented Oct 7, 2025

Product requirements

  • If no destination is set up, then the estimate method of adapters should revert

@hieronx hieronx requested a review from lemunozm October 7, 2025 14:33
@github-actions
Copy link
Copy Markdown

github-actions bot commented Oct 7, 2025

Coverage after merging revert-on-estimate into main will be

97.27%

Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
src/adapters
   AxelarAdapter.sol97.67%90%100%100%114
   LayerZeroAdapter.sol98.41%90%100%100%124
   RecoveryAdapter.sol100%100%100%100%
   WormholeAdapter.sol97.67%90%100%100%108
src/admin
   OpsGuardian.sol100%100%100%100%
   ProtocolGuardian.sol100%100%100%100%
   Root.sol100%100%100%100%
   TokenRecoverer.sol100%100%100%100%
src/core
   ContractUpdater.sol100%100%100%100%
src/core/hub
   Accounting.sol94.79%88%100%96.61%132, 134, 137, 141, 144
   Holdings.sol97.67%88.46%100%100%116, 236, 82
   Hub.sol88.51%60%93.02%94.58%272, 290, 308, 342, 346, 377–378, 406, 416, 426, 426, 426, 428, 442, 500–501, 546, 551, 588, 603, 74, 74–76, 76–78, 78, 78–79, 87
   HubHandler.sol98%90.91%100%100%71
   HubRegistry.sol92.13%75%100%100%117, 123, 129, 35, 46, 79, 98
   ShareClassManager.sol100%100%100%100%
src/core/libraries
   PricingLib.sol100%100%100%100%
src/core/messaging
   GasService.sol97.10%100%100%96.92%107, 117
   Gateway.sol100%100%100%100%
   MessageDispatcher.sol99.60%98.55%100%100%721
   MessageProcessor.sol97.34%94.74%100%99.07%235, 86, 89, 93, 97
   MultiAdapter.sol100%100%100%100%
src/core/messaging/libraries
   MessageLib.sol100%100%100%100%
src/core/spoke
   BalanceSheet.sol99.41%96.30%100%100%57
   PoolEscrow.sol100%100%100%100%
   ShareToken.sol93.59%66.67%94.44%98.04%100, 112, 145, 32
   Spoke.sol95.54%86.36%96.88%98.83%108, 116, 131, 131–132, 132, 134, 91, 91–92, 92
   VaultRegistry.sol93.55%87.10%100%96.30%37–38, 54, 60–62
src/core/spoke/factories
   PoolEscrowFactory.sol100%100%100%100%
   TokenFactory.sol92%50%100%94.74%24–25
src/core/utils
   BatchedMulticall.sol87.50%0%100%100%25, 25
src/hooks
   BaseTransferHook.sol89.15%83.33%95.65%89.02%161–162, 164, 164, 164–166, 168–169, 169, 169, 171, 173
   FreelyTransferable.sol100%100%100%100%
   FreezeOnly.sol100%100%100%100%
   FullRestrictions.sol100%100%100%100%
   RedemptionRestrictions.sol100%100%100%100%
src/hooks/libraries
   UpdateRestrictionMessageLib.sol90%50%100%100%40, 61, 82
src/libraries
   UpdateContractMessageLib.sol89.47%50%100%100%112, 134, 157, 42, 64, 88
src/managers/hub
   NAVManager.sol99.23%95%100%100%211
   SimplePriceManager.sol97.14%100%88.89%98.08%140
src/managers/spoke
   MerkleProofManager.sol79.45%61.11%88.89%84.78%109, 116, 135–136, 136, 136, 138–139, 141–142, 45–46, 49, 59
   OnOfframpManager.sol100%100%100%100%
   QueueManager.sol100%100%100%100%
src/managers/spoke/decoders
   BaseDecoder.sol75%100%75%75%43–44
   CircleDecoder.sol0%100%0%0%11, 16, 20, 22
   VaultDecoder.sol0%100%0%0%10, 104, 110, 15–16, 22, 28, 34, 40, 46, 52, 58, 64, 69, 75, 80, 86, 9, 92, 98
src/misc
   Auth.sol100%100%100%100%
   ERC20.sol100%100%100%100%
   Escrow.sol56.25%33.33%100%66.67%17, 19, 23–24, 24, 24, 26
   Multicall.sol83.33%33.33%100%100%19, 19
   Recoverable.sol100%100%100%100%
   ReentrancyProtection.sol90%75%100%100%24
src/misc/libraries
   ArrayLib.sol100%100%100%100%
   BitmapLib.sol100%100%100%100%
   BytesLib.sol90.09%54.17%100%100%109, 120, 131, 14, 142, 153, 16, 164, 175, 186, 87
   CastLib.sol95.24%66.67%100%100%10, 34
   EIP712Lib.sol100%100%100%100%
   MathLib.sol93.40%76.19%100%97.30%35–36, 45, 47, 49, 51, 53
   MerkleProofLib.sol100%100%100%100%
   SafeTransferLib.sol96.97%92.86%100%100%75
   SignatureLib.sol95.24%80%100%100%17
   StringLib.sol100%100%100%100%
   TransientArrayLib.sol100%100%100%100%
   TransientBytesLib.sol100%100%100%100%
   TransientStorageLib.sol100%100%100%100%
src/valuations
   IdentityValuation.sol66.67%100%66.67%66.67%27–28
   OracleValuation.sol100%100%100%100%
src/vaults
   AsyncRequestManager.sol93.69%82.42%91.30%97.82%195, 214, 220, 227, 230, 233, 236, 247, 259, 264, 283, 290, 323, 357, 471, 476, 515, 517, 73, 90, 92–93
   AsyncVault.sol96.25%83.33%95%98.15%147, 48
   BaseVaults.sol92.50%80.77%95.24%93.94%125, 138, 240, 313–314, 400–401, 86–87, 87, 87–89
   BatchRequestManager.sol100%100%100%100%
   RefundEscrow.sol100%100%100%100%
   SyncDepositVault.sol100%100%100%100%
   SyncManager.sol84.43%72.73%88.24%86.75%110–111, 113, 159, 179–180, 225–226, 63–65, 67, 67, 67, 69, 74, 79
   VaultRouter.sol87.41%52%100%94.25%114, 114, 116–117, 117, 119, 130–131, 150, 150, 162, 205, 77, 80–81, 93–94
src/vaults/factories
   AsyncVaultFactory.sol89.47%50%100%93.33%35, 47
   RefundEscrowFactory.sol100%100%100%100%
   SyncDepositVaultFactory.sol91.30%50%100%94.74%44, 59
src/vaults/libraries
   RequestCallbackMessageLib.sol89.58%50%100%100%106, 141, 38, 57, 77
   RequestMessageLib.sol89.74%50%100%100%37, 55, 72, 89

}

function testEstimate(uint64 gasLimit) public view {
function testEstimate(uint64 gasLimit) public {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NIT, could we add testErrUnknownChainId cases?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's do in followup PR, I think in general the adapter tests can be improved a bit.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking that maybe we can build some generic adapter test that acts over IAdapter and IAdapterWiring. So you only need to mock your specific adapter calls to some generic expected behavior and run this generic adapter tests for your new adapter implementation

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting idea, makes sense to me yes!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hieronx hieronx merged commit a3c7e09 into main Oct 7, 2025
10 of 11 checks passed
@hieronx hieronx deleted the revert-on-estimate branch October 7, 2025 14:49
@hieronx hieronx mentioned this pull request Oct 7, 2025
hieronx added a commit that referenced this pull request Oct 17, 2025
* First try at recovering #678

* deployed sepolia and arbitrum sepolia

* take a stab at wire adapters (still failing)

* Move message related files to core/messages (#698)

* move message files

* fix fmt

* Revert on estimate if destination is not setup (#702)

* ci: add ward check script (#696)

* ci: add ward check script

* fix: script relative dir

* ci: move ward coverage to ci.yml as optional check

* ci: make ward coverage check mandatory

* tests: add missing ward coverage

* Tests: Change `vm.assume` to `bound`s (#705)

* Change vm.assume calls to bounds

* Format

* fix: uninitialized network multiAdapter views

* apply suggestion from code review & fmt

* ref: move _getFirstAdapterDetails to bottom

* chore: update benches

* All contracts for Sepolia networks deployed and verified

* Ensure salt also applied to root contract

* small python deployment fixes

* Add cancelation flow to test data (#709)

* improve batch docs (#706)

* Add cancelation flow to test data

* Fix build

---------

Co-authored-by: Luis Enrique Muñoz Martín <lemunozm@gmail.com>
Co-authored-by: Guillermo Perez <gpmayorga@users.noreply.github.com>

* new wireadapters with some safeguards for asymmetrical adapter configs

* correct Eid for layerzero

* Modular test scripts and cross chain tests

* Fix Hub tests

* address PR comment

* Updated testnets deployment

* latest wireadapters

* fix e2e hub-spoke tests for sepolia testnets

* commit missing test shared methods

* Implement ReleaseManager for orchestrated Sepolia testnet deployments and enhance argument validation in deploy script

* Update .gitignore to exclude .env.back and JSON files in the anvil directory

* cleanup and refactor some var names

* Remove gas buffer percentage in adapters

* Increase base cost to 50k

* Update adapter configurations and deployment scripts for Sepolia. Removed deprecated adapter addresses, added new ones, and introduced a new script for deploying only messaging adapters. Enhanced deployment validation and added support for deploying adapters separately.

* pseudo-random pool index selection with environment variable override, ensuring valid index range (100-999)

* sepolia & base sepolia redeploy

* deployed arbitrum sepolia

* New deployment features (anvil still buggy)

* git ignore anvil files

* Add cross-chain vault deployment functionality

- Introduced `XcAsyncVaultParams` and `XcSyncVaultParams` structs for cross-chain vault configurations.
- Implemented `deployAsyncVaultXc` and `deploySyncDepositVaultXc` functions to handle cross-chain vault deployments.

* fixed import order

* Fix imports unused

* fixed import CI check

* fixed CI checks

* Add readme to test folder and move testdata

* Moved test files

* moved test files under /test/

* Revert anvil.py changes - moved to separate PR

* Update import paths

* Fix TestData script path for anvil deployment

* Format, benchmarks

* Fix

* Move

* Fix typo

* Disable sync vault redemption

* Add whitelisting

* Fix typo

---------

Co-authored-by: Luis Enrique Muñoz Martín <lemunozm@gmail.com>
Co-authored-by: Jeroen <1748621+hieronx@users.noreply.github.com>
Co-authored-by: William Freudenberger <w.freude@icloud.com>
Co-authored-by: Jeroen Offerijns <git@o6ns.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants