From b3ec46462021f1eea41baf7b4f2b6b35fac76f80 Mon Sep 17 00:00:00 2001 From: Diego <105765223+0xfuturistic@users.noreply.github.com> Date: Thu, 16 May 2024 21:52:33 +0200 Subject: [PATCH 1/4] interop: add errors for manipulating dependency set --- specs/interop/predeploys.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/specs/interop/predeploys.md b/specs/interop/predeploys.md index f7baa2703..01d9c5e73 100644 --- a/specs/interop/predeploys.md +++ b/specs/interop/predeploys.md @@ -300,7 +300,10 @@ Calls to `setConfig` MUST originate from `SystemConfig` and are forwarded to `L1 ### Dependency Set `L1Block` is updated to include the set of allowed chains. These chains are added and removed through `setConfig` calls -with `ADD_DEPENDENCY` or `REMOVE_DEPENDENCY`, respectively. +with `ADD_DEPENDENCY` or `REMOVE_DEPENDENCY`, respectively. The maximum size of the dependency is `type(uint256).max`, +and adding a chain id when the dependency set size is at its maximum MUST revert. If a chain id not in the dependency +set is attempted to be removed, the call MUST revert. If the chain's chain id is attempted to be removed, the call also +MUST revert. `L1Block` MUST provide a public getter to check if a particular chain is in the dependency set called `isInDependencySet(uint256)`. This function MUST return true when a chain id in the dependency set, or the chain's chain From 3555b8e759392105ab15bed08402fb420b5e5fb8 Mon Sep 17 00:00:00 2001 From: Diego <105765223+0xfuturistic@users.noreply.github.com> Date: Thu, 16 May 2024 21:57:58 +0200 Subject: [PATCH 2/4] interop: fix lint --- specs/interop/predeploys.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specs/interop/predeploys.md b/specs/interop/predeploys.md index 01d9c5e73..ec30ec141 100644 --- a/specs/interop/predeploys.md +++ b/specs/interop/predeploys.md @@ -300,7 +300,7 @@ Calls to `setConfig` MUST originate from `SystemConfig` and are forwarded to `L1 ### Dependency Set `L1Block` is updated to include the set of allowed chains. These chains are added and removed through `setConfig` calls -with `ADD_DEPENDENCY` or `REMOVE_DEPENDENCY`, respectively. The maximum size of the dependency is `type(uint256).max`, +with `ADD_DEPENDENCY` or `REMOVE_DEPENDENCY`, respectively. The maximum size of the dependency is `type(uint256).max`, and adding a chain id when the dependency set size is at its maximum MUST revert. If a chain id not in the dependency set is attempted to be removed, the call MUST revert. If the chain's chain id is attempted to be removed, the call also MUST revert. From b238117d7e5afb7d7078f2cbd66a1865cf64d132 Mon Sep 17 00:00:00 2001 From: Diego <105765223+0xfuturistic@users.noreply.github.com> Date: Thu, 16 May 2024 22:50:24 +0200 Subject: [PATCH 3/4] interop: add missing word `set` for dependency set max size --- specs/interop/predeploys.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specs/interop/predeploys.md b/specs/interop/predeploys.md index ec30ec141..9481a2f7d 100644 --- a/specs/interop/predeploys.md +++ b/specs/interop/predeploys.md @@ -300,7 +300,7 @@ Calls to `setConfig` MUST originate from `SystemConfig` and are forwarded to `L1 ### Dependency Set `L1Block` is updated to include the set of allowed chains. These chains are added and removed through `setConfig` calls -with `ADD_DEPENDENCY` or `REMOVE_DEPENDENCY`, respectively. The maximum size of the dependency is `type(uint256).max`, +with `ADD_DEPENDENCY` or `REMOVE_DEPENDENCY`, respectively. The maximum size of the dependency set is `type(uint256).max`, and adding a chain id when the dependency set size is at its maximum MUST revert. If a chain id not in the dependency set is attempted to be removed, the call MUST revert. If the chain's chain id is attempted to be removed, the call also MUST revert. From 266b7678ab98fc0336b779374b8c07028c819668 Mon Sep 17 00:00:00 2001 From: Diego <105765223+0xfuturistic@users.noreply.github.com> Date: Thu, 16 May 2024 22:51:06 +0200 Subject: [PATCH 4/4] interop: change dependency set size max to type(uint8).max --- specs/interop/predeploys.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specs/interop/predeploys.md b/specs/interop/predeploys.md index 9481a2f7d..2353fc3ab 100644 --- a/specs/interop/predeploys.md +++ b/specs/interop/predeploys.md @@ -300,7 +300,7 @@ Calls to `setConfig` MUST originate from `SystemConfig` and are forwarded to `L1 ### Dependency Set `L1Block` is updated to include the set of allowed chains. These chains are added and removed through `setConfig` calls -with `ADD_DEPENDENCY` or `REMOVE_DEPENDENCY`, respectively. The maximum size of the dependency set is `type(uint256).max`, +with `ADD_DEPENDENCY` or `REMOVE_DEPENDENCY`, respectively. The maximum size of the dependency set is `type(uint8).max`, and adding a chain id when the dependency set size is at its maximum MUST revert. If a chain id not in the dependency set is attempted to be removed, the call MUST revert. If the chain's chain id is attempted to be removed, the call also MUST revert.