Skip to content

Commit 4ac847e

Browse files
authored
Remove semver.yaml files, implementations.yaml and related code (#356)
* remove semver.yaml files, implementations.yaml and related code * more tidy up * remove accidental change * remove superchain-wide versions check * remove unused fns * clean up rust bindings
1 parent 188917d commit 4ac847e

File tree

18 files changed

+6
-1052
lines changed

18 files changed

+6
-1052
lines changed

CONTRIBUTING.md

Lines changed: 2 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ The Superchain Registry repository contains:
77
- a [`validation`](#validation-go-module) module
88
- an [`add-chain`](#add-chain-go-module) module
99
- The modules are tracked by a top level `go.work` file. The associated `go.work.sum` file is gitignored and not important to typical workflows, which should mirror those of the [CI configuration](.circleci/config.yml).
10-
* Automatically generated summary `chainIds.json` file
10+
* Automatically generated summary `chainList.json` and `chainList.toml` files.
1111

1212

1313
## Superchain-wide config data
@@ -45,37 +45,8 @@ EOF
4545
```
4646
Superchain-wide configuration, like the `ProtocolVersions` contract address, should be configured here when available.
4747

48-
### Approved contract versions
49-
Each superchain target should have a `semver.yaml` file in the same directory declaring the approved contract semantic versions for that superchain, e.g:
50-
```yaml
51-
l1_cross_domain_messenger: 1.4.0
52-
l1_erc721_bridge: 1.0.0
53-
l1_standard_bridge: 1.1.0
54-
l2_output_oracle: 1.3.0
55-
optimism_mintable_erc20_factory: 1.1.0
56-
optimism_portal: 1.6.0
57-
system_config: 1.3.0
58-
59-
# superchain-wide contracts
60-
protocol_versions: 1.0.0
61-
superchain_config: 1.1.0
62-
```
63-
It is meant to be used when building transactions that upgrade the implementations set in the proxies. See the `semver.yaml` files in existing superchain targets for the latest set of contracts to specify.
6448

65-
### `implementations`
66-
Per superchain a set of canonical implementation deployments, per semver version, is tracked.
67-
As default, an empty collection of deployments can be set:
68-
```bash
69-
cat > superchain/implementations/networks/$SUPERCHAIN_TARGET.yaml << EOF
70-
l1_cross_domain_messenger:
71-
l1_erc721_bridge:
72-
l1_standard_bridge:
73-
l2_output_oracle:
74-
optimism_mintable_erc20_factory:
75-
optimism_portal:
76-
system_config:
77-
EOF
78-
```
49+
7950

8051
## `superchain` Go Module
8152

bindings/rust-bindings/src/embed.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,3 @@ pub(crate) static CONFIGS_DIR: Dir<'_> = include_dir!("$SUPERCHAIN_CONFIGS");
55

66
/// Directory containing the extra files for the superchain.
77
pub(crate) static EXTRA_DIR: Dir<'_> = include_dir!("$SUPERCHAIN_EXTRA");
8-
9-
/// Directory containing the implementation addresses for the superchain.
10-
pub(crate) static IMPLEMENTATIONS_DIR: Dir<'_> = include_dir!("$SUPERCHAIN_IMPLEMENTATIONS");

bindings/rust-bindings/src/init.rs

Lines changed: 4 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,19 @@ use crate::embed;
44
use alloc::{format, string::ToString, vec::Vec};
55
use hashbrown::HashMap;
66
use superchain_primitives::{
7-
is_config_file, AddressList, Addresses, ChainConfig, ContractImplementations,
8-
GenesisSystemConfigs, Implementations, OPChains, Superchain, SuperchainConfig, Superchains,
9-
SystemConfig,
7+
is_config_file, AddressList, Addresses, ChainConfig, GenesisSystemConfigs, OPChains,
8+
Superchain, SuperchainConfig, Superchains, SystemConfig,
109
};
1110

1211
/// Tuple type holding the various initializers.
13-
pub(crate) type InitTuple = (
14-
Superchains,
15-
OPChains,
16-
Addresses,
17-
GenesisSystemConfigs,
18-
Implementations,
19-
);
12+
pub(crate) type InitTuple = (Superchains, OPChains, Addresses, GenesisSystemConfigs);
2013

2114
/// Initialize the superchain configurations from the embedded filesystem.
2215
pub(crate) fn load_embedded_configs() -> InitTuple {
2316
let mut superchains = HashMap::new();
2417
let mut op_chains = HashMap::new();
2518
let mut addresses = HashMap::new();
2619
let mut genesis_system_configs = HashMap::new();
27-
let mut implementations = HashMap::new();
2820

2921
for target_dir in embed::CONFIGS_DIR.dirs() {
3022
let target_name = target_dir.path().file_name().unwrap().to_str().unwrap();
@@ -90,9 +82,6 @@ pub(crate) fn load_embedded_configs() -> InitTuple {
9082
_ => {}
9183
}
9284

93-
let impls = new_contract_implementations(target_name);
94-
implementations.insert(target_name.to_string(), impls);
95-
9685
superchains.insert(
9786
target_name.to_string(),
9887
Superchain {
@@ -103,38 +92,5 @@ pub(crate) fn load_embedded_configs() -> InitTuple {
10392
);
10493
}
10594

106-
(
107-
superchains,
108-
op_chains,
109-
addresses,
110-
genesis_system_configs,
111-
implementations,
112-
)
113-
}
114-
115-
fn new_contract_implementations(network: &str) -> ContractImplementations {
116-
let implementations_data = embed::IMPLEMENTATIONS_DIR
117-
.get_file("implementations.yaml")
118-
.expect("Failed to find implementations.yaml file")
119-
.contents();
120-
121-
let mut global_implementations: ContractImplementations =
122-
serde_yaml::from_slice(implementations_data)
123-
.expect("Failed to deserialize implementations.yaml file");
124-
125-
if network.is_empty() {
126-
return global_implementations;
127-
}
128-
129-
let network_implementations_data = embed::IMPLEMENTATIONS_DIR
130-
.get_file(format!("networks/{}.yaml", network))
131-
.expect("Failed to find network implementations.yaml file")
132-
.contents();
133-
134-
let network_implementations = serde_yaml::from_slice(network_implementations_data)
135-
.expect("Failed to deserialize network implementations.yaml file");
136-
137-
global_implementations.merge(network_implementations);
138-
139-
global_implementations
95+
(superchains, op_chains, addresses, genesis_system_configs)
14096
}

bindings/rust-bindings/src/lib.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,6 @@ lazy_static::lazy_static! {
3434

3535
/// Genesis system configurations exported from the registry
3636
pub static ref GENESIS_SYSTEM_CONFIGS: GenesisSystemConfigs = _INIT.3.clone();
37-
38-
/// Contract implementations exported from the registry
39-
pub static ref IMPLEMENTATIONS: Implementations = _INIT.4.clone();
4037
}
4138

4239
#[cfg(test)]

superchain/configs/mainnet/semver.yaml

Lines changed: 0 additions & 16 deletions
This file was deleted.

superchain/configs/sepolia-dev-0/semver.yaml

Lines changed: 0 additions & 11 deletions
This file was deleted.

superchain/configs/sepolia/semver.yaml

Lines changed: 0 additions & 17 deletions
This file was deleted.

superchain/go.mod

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ require (
66
github.com/BurntSushi/toml v1.4.0
77
github.com/stretchr/testify v1.8.4
88
golang.org/x/crypto v0.18.0
9-
golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa
109
golang.org/x/mod v0.14.0
1110
gopkg.in/yaml.v3 v3.0.1
1211
)

superchain/go.sum

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcU
2020
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
2121
golang.org/x/crypto v0.18.0 h1:PGVlW0xEltQnzFZ55hkuX5+KLyrMYhHld1YHO4AKcdc=
2222
golang.org/x/crypto v0.18.0/go.mod h1:R0j02AL6hcrfOiy9T4ZYp/rcWeMxM3L6QYxlOuEG1mg=
23-
golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa h1:FRnLl4eNAQl8hwxVVC17teOw8kdjVDVAiFMtgUdTSRQ=
24-
golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa/go.mod h1:zk2irFbV9DP96SEBUUAy67IdHUaZuSnrz1n472HUCLE=
2523
golang.org/x/mod v0.14.0 h1:dGoOF9QVLYng8IHTm7BAyWqCqSheQ5pYWGhzW00YJr0=
2624
golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
2725
golang.org/x/sys v0.16.0 h1:xWw16ngr6ZMtmxDyKyIgsE93KNKz5HKmMa3b8ALHidU=

superchain/implementations/README.md

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)