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: wrap sendRootToHubSpoke #5149

Merged
merged 3 commits into from
Nov 9, 2023
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
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@
"function finalizeAndPropagate(address[] _connectors, uint256[] _fees, bytes[] _encodedData, bytes32 _proposedAggregateRoot, uint256 _endOfDispute) payable",
"function lastPropagatedRoot(uint32 _domain) view returns (bytes32)",
"function propagate(address[] _connectors, uint256[] _fees, bytes[] _encodedData) payable",
"function proposeAggregateRoot(uint256 _snapshotId, bytes32 _aggregateRoot, bytes32[] _snapshotsRoots, uint32[] _domains)"
"function proposeAggregateRoot(uint256 _snapshotId, bytes32 _aggregateRoot, bytes32[] _snapshotsRoots, uint32[] _domains)",
"function sendRootToHubSpoke()"
]
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
"function renounced() view returns (bool)",
"function rootManager() view returns (address)",
"function send(bytes _encodedData, uint256 _messageFee, uint256 _relayerFee)",
"function sendRootToHubSpoke()",
"function setAutonolas(address _autonolas)",
"function setAutonolasPriority(uint8 _function, uint8 _autonolasPriority)",
"function setConnext(address _connext)",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ interface IRootManager {
) external payable;

function finalize(bytes32 _proposedAggregateRoot, uint256 _endOfDispute) external payable;

function sendRootToHubSpoke() external;
}

interface IGnosisHubConnector {
Expand Down Expand Up @@ -567,7 +569,7 @@ contract RelayerProxyHub is RelayerProxy {
function finalize(
bytes32 _proposedAggregateRoot,
uint256 _endOfDispute
) external onlyRelayer onlyFinalizeCooledDown nonReentrant {
) external onlyFinalizeCooledDown nonReentrant {
// Finalized the proposed aggregate root
rootManager.finalize(_proposedAggregateRoot, _endOfDispute);
}
Expand Down Expand Up @@ -597,6 +599,14 @@ contract RelayerProxyHub is RelayerProxy {
_fee = _finalizeAndPropagate(_connectors, _fees, _encodedData, _proposedAggregateRoot, _endOfDispute);
}

/**
* @notice Wraps the `sendRootToHubSpoke` function of RootManager
*/
function sendRootToHubSpoke() external {
// Send aggregate root to MainnetSpokeConnector
rootManager.sendRootToHubSpoke();
}

// ============ Internal Functions ============
function _setRootManager(address _rootManager) internal {
emit RootManagerChanged(_rootManager, address(rootManager));
Expand Down
9 changes: 8 additions & 1 deletion packages/deployments/contracts/deployments.json
Original file line number Diff line number Diff line change
Expand Up @@ -72597,7 +72597,7 @@
]
},
"RelayerProxyHubStaging": {
"address": "0x90C935a5bFBB46dC3642910B3506996d8B90Fce7",
"address": "0x837e94472DcECa564B46C54609051cE7c7660E5E",
"abi": [
{
"inputs": [
Expand Down Expand Up @@ -73990,6 +73990,13 @@
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "sendRootToHubSpoke",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export interface IRootManagerInterface extends utils.Interface {
"lastPropagatedRoot(uint32)": FunctionFragment;
"propagate(address[],uint256[],bytes[])": FunctionFragment;
"proposeAggregateRoot(uint256,bytes32,bytes32[],uint32[])": FunctionFragment;
"sendRootToHubSpoke()": FunctionFragment;
};

getFunction(
Expand All @@ -44,6 +45,7 @@ export interface IRootManagerInterface extends utils.Interface {
| "lastPropagatedRoot"
| "propagate"
| "proposeAggregateRoot"
| "sendRootToHubSpoke"
): FunctionFragment;

encodeFunctionData(
Expand Down Expand Up @@ -86,6 +88,10 @@ export interface IRootManagerInterface extends utils.Interface {
PromiseOrValue<BigNumberish>[]
]
): string;
encodeFunctionData(
functionFragment: "sendRootToHubSpoke",
values?: undefined
): string;

decodeFunctionResult(
functionFragment: "allowlistedProposers",
Expand All @@ -106,6 +112,10 @@ export interface IRootManagerInterface extends utils.Interface {
functionFragment: "proposeAggregateRoot",
data: BytesLike
): Result;
decodeFunctionResult(
functionFragment: "sendRootToHubSpoke",
data: BytesLike
): Result;

events: {};
}
Expand Down Expand Up @@ -180,6 +190,10 @@ export interface IRootManager extends BaseContract {
_domains: PromiseOrValue<BigNumberish>[],
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>;

sendRootToHubSpoke(
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>;
};

allowlistedProposers(
Expand Down Expand Up @@ -226,6 +240,10 @@ export interface IRootManager extends BaseContract {
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>;

sendRootToHubSpoke(
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>;

callStatic: {
allowlistedProposers(
_proposer: PromiseOrValue<string>,
Expand Down Expand Up @@ -268,6 +286,8 @@ export interface IRootManager extends BaseContract {
_domains: PromiseOrValue<BigNumberish>[],
overrides?: CallOverrides
): Promise<void>;

sendRootToHubSpoke(overrides?: CallOverrides): Promise<void>;
};

filters: {};
Expand Down Expand Up @@ -316,6 +336,10 @@ export interface IRootManager extends BaseContract {
_domains: PromiseOrValue<BigNumberish>[],
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<BigNumber>;

sendRootToHubSpoke(
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<BigNumber>;
};

populateTransaction: {
Expand Down Expand Up @@ -362,5 +386,9 @@ export interface IRootManager extends BaseContract {
_domains: PromiseOrValue<BigNumberish>[],
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<PopulatedTransaction>;

sendRootToHubSpoke(
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<PopulatedTransaction>;
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ export interface RelayerProxyHubInterface extends utils.Interface {
"renounced()": FunctionFragment;
"rootManager()": FunctionFragment;
"send(bytes,uint256,uint256)": FunctionFragment;
"sendRootToHubSpoke()": FunctionFragment;
"setAutonolas(address)": FunctionFragment;
"setAutonolasPriority(uint8,uint8)": FunctionFragment;
"setConnext(address)": FunctionFragment;
Expand Down Expand Up @@ -254,6 +255,7 @@ export interface RelayerProxyHubInterface extends utils.Interface {
| "renounced"
| "rootManager"
| "send"
| "sendRootToHubSpoke"
| "setAutonolas"
| "setAutonolasPriority"
| "setConnext"
Expand Down Expand Up @@ -464,6 +466,10 @@ export interface RelayerProxyHubInterface extends utils.Interface {
PromiseOrValue<BigNumberish>
]
): string;
encodeFunctionData(
functionFragment: "sendRootToHubSpoke",
values?: undefined
): string;
encodeFunctionData(
functionFragment: "setAutonolas",
values: [PromiseOrValue<string>]
Expand Down Expand Up @@ -635,6 +641,10 @@ export interface RelayerProxyHubInterface extends utils.Interface {
data: BytesLike
): Result;
decodeFunctionResult(functionFragment: "send", data: BytesLike): Result;
decodeFunctionResult(
functionFragment: "sendRootToHubSpoke",
data: BytesLike
): Result;
decodeFunctionResult(
functionFragment: "setAutonolas",
data: BytesLike
Expand Down Expand Up @@ -1139,6 +1149,10 @@ export interface RelayerProxyHub extends BaseContract {
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>;

sendRootToHubSpoke(
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>;

setAutonolas(
_autonolas: PromiseOrValue<string>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
Expand Down Expand Up @@ -1384,6 +1398,10 @@ export interface RelayerProxyHub extends BaseContract {
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>;

sendRootToHubSpoke(
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>;

setAutonolas(
_autonolas: PromiseOrValue<string>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
Expand Down Expand Up @@ -1625,6 +1643,8 @@ export interface RelayerProxyHub extends BaseContract {
overrides?: CallOverrides
): Promise<void>;

sendRootToHubSpoke(overrides?: CallOverrides): Promise<void>;

setAutonolas(
_autonolas: PromiseOrValue<string>,
overrides?: CallOverrides
Expand Down Expand Up @@ -2011,6 +2031,10 @@ export interface RelayerProxyHub extends BaseContract {
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<BigNumber>;

sendRootToHubSpoke(
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<BigNumber>;

setAutonolas(
_autonolas: PromiseOrValue<string>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
Expand Down Expand Up @@ -2261,6 +2285,10 @@ export interface RelayerProxyHub extends BaseContract {
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<PopulatedTransaction>;

sendRootToHubSpoke(
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<PopulatedTransaction>;

setAutonolas(
_autonolas: PromiseOrValue<string>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,13 @@ const _abi = [
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [],
name: "sendRootToHubSpoke",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
] as const;

export class IRootManager__factory {
Expand Down

Large diffs are not rendered by default.