|
| 1 | +package validation |
| 2 | + |
| 3 | +import ( |
| 4 | + "regexp" |
| 5 | + "testing" |
| 6 | +) |
| 7 | + |
| 8 | +func skipIfExcluded(t *testing.T, chainID uint64) { |
| 9 | + for pattern := range exclusions { |
| 10 | + matches, err := regexp.Match(pattern, []byte(t.Name())) |
| 11 | + if err != nil { |
| 12 | + panic(err) |
| 13 | + } |
| 14 | + if matches && exclusions[pattern][chainID] { |
| 15 | + t.Skip("Excluded!") |
| 16 | + } |
| 17 | + } |
| 18 | +} |
| 19 | + |
| 20 | +var exclusions = map[string]map[uint64]bool{ |
| 21 | + "ChainID_RPC_Check": { |
| 22 | + 11155421: true, // sepolia-dev-0/oplabs-devnet-0 No Public RPC declared |
| 23 | + 11763072: true, // sepolia-dev-0/base-devnet-0 No Public RPC declared |
| 24 | + }, |
| 25 | + "GPO_Params": { |
| 26 | + 11155421: true, // sepolia-dev-0/oplabs-devnet-0 (no public endpoint) |
| 27 | + 11763072: true, // sepolia-dev-0/base-devnet-0 (no public endpoint) |
| 28 | + }, |
| 29 | + "L2OO_Params": { |
| 30 | + 10: true, // OP mainnet - Upgraded to fault proofs |
| 31 | + 999999999: true, // sepolia/zora Incorrect finalizationPeriodSeconds, 604800 is not within bounds [12 12] |
| 32 | + 1740: true, // sepolia/metal Incorrect finalizationPeriodSeconds, 604800 is not within bounds [12 12] |
| 33 | + 919: true, // sepolia/mode Incorrect finalizationPeriodSeconds, 180 is not within bounds [12 12] |
| 34 | + 11155420: true, // sepolia/op No L2OO because this chain uses Fault Proofs https://github.com/ethereum-optimism/superchain-registry/issues/219 |
| 35 | + 11155421: true, // oplabs-sepolia-devnet-0 No L2OO because this chain uses Fault Proofs https://github.com/ethereum-optimism/superchain-registry/issues/219 |
| 36 | + }, |
| 37 | + "L1_Security_Config": { |
| 38 | + 8453: true, // base (incorrect challenger, incorrect guardian) |
| 39 | + 11763072: true, // base-devnet-0 (incorrect challenger, incorrect guardian) |
| 40 | + 90001: true, // race (incorrect challenger, incorrect guardian) |
| 41 | + 84532: true, // base-sepolia (incorrect challenger) |
| 42 | + 7777777: true, // zora (incorrect challenger) |
| 43 | + 1750: true, // metal (incorrect challenger) |
| 44 | + 919: true, // mode sepolia (incorrect challenger) |
| 45 | + 999999999: true, // zora sepolia (incorrect challenger) |
| 46 | + 34443: true, // mode (incorrect challenger) |
| 47 | + }, |
| 48 | + "L2_Security_Config": { |
| 49 | + 11155421: true, // sepolia-dev-0/oplabs-devnet-0 No Public RPC declared |
| 50 | + 11763072: true, // sepolia-dev-0/base-devnet-0 No Public RPC declared |
| 51 | + }, |
| 52 | + "Genesis_Hash_Check": { |
| 53 | + 10: true, // OP Mainnet |
| 54 | + }, |
| 55 | + "Genesis_RPC_Check": { |
| 56 | + 11155421: true, // sepolia-dev-0/oplabs-devnet-0 No Public RPC declared |
| 57 | + 11763072: true, // sepolia-dev-0/base-devnet-0 No Public RPC declared |
| 58 | + }, |
| 59 | + "Standard_Contract_Versions": { |
| 60 | + 8453: true, // mainnet/base |
| 61 | + 11155421: true, // sepolia-dev-0/oplabs-devnet-0 |
| 62 | + 11763072: true, // sepolia-dev-0/base-devnet-0 |
| 63 | + }, |
| 64 | + "Uniqueness_Check": { |
| 65 | + 11155421: true, // oplabs devnet 0, not in upstream repo |
| 66 | + 11763072: true, // base devnet 0, not in upstream repo} |
| 67 | + }, |
| 68 | +} |
0 commit comments