Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add optimal bandwitdh #40

Merged
merged 4 commits into from
Feb 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ BASE_KEY = --private-key ${PRIVATE_KEY}



custom_ethereum := --with-gas-price 1500000000 # 53 gwei
custom_ethereum := --with-gas-price 3000000000 # 53 gwei
#custom_polygon := --with-gas-price 190000000000 # 560 gwei
#custom_avalanche := --with-gas-price 27000000000 # 27 gwei
#custom_metis-testnet := --legacy --verifier-url https://goerli.explorer.metisdevops.link/api/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,14 @@
"0xe3a0d9754aD3452D687cf580Ba3674c2D7D2f7AE": "0x1905fCdDa41241C0871A5eC3f9dcC3E8d247261D"
}
}
},
"optimalBandwidthByChain": {
"146": {
"optimalBandwidth": {
"from": "0",
"to": "2"
}
}
}
}
```
20 changes: 20 additions & 0 deletions src/adapter_payloads/Ethereum_Sonic_Path_Payload.sol
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,24 @@ contract Ethereum_Sonic_Path_Payload is BaseAdaptersUpdate {

return newForwarders;
}

function execute() public override {
executeReceiversUpdate(CROSS_CHAIN_CONTROLLER);

executeForwardersUpdate(CROSS_CHAIN_CONTROLLER);

_updateOptimalBandwidth();
}

function _updateOptimalBandwidth() public {
ICrossChainForwarder.OptimalBandwidthByChain[] memory optimalBandwidthByChain =
new ICrossChainForwarder.OptimalBandwidthByChain[](1);
optimalBandwidthByChain[0] = ICrossChainForwarder.OptimalBandwidthByChain({
chainId: DESTINATION_CHAIN_ID,
optimalBandwidth: 2
});
ICrossChainForwarder(CROSS_CHAIN_CONTROLLER).updateOptimalBandwidthByChain(
optimalBandwidthByChain
);
}
}
6 changes: 3 additions & 3 deletions tests/payloads/ethereum/AddSonicPathTest.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,10 @@ abstract contract BaseAddSonicPathPayloadTest is ADITestBase {

contract EthereumAddSonicPathPayloadTest is
PayloadEthereumScript,
BaseAddSonicPathPayloadTest('ethereum', 21822220)
{ // TODO: add new block number
BaseAddSonicPathPayloadTest('ethereum', 21824382)
{
function _getDeployedPayload() internal pure override returns (address) {
return 0xd16f822737b4e360671B4c2D5cdD811f5Aa6611C;
return 0x41FE455778201FB3AC7E41a7b2B4ffC90F08035e;
}

function _getCurrentNetworkAddresses() internal view override returns (Addresses memory) {
Expand Down
Loading