Skip to content
This repository has been archived by the owner on May 29, 2024. It is now read-only.

Commit

Permalink
[epociask/unsafe-withdrawal-heuristic] temporarily expose .devnet state
Browse files Browse the repository at this point in the history
  • Loading branch information
Ethen Pociask committed Oct 27, 2023
1 parent 26cdb3e commit 1770f2c
Show file tree
Hide file tree
Showing 9 changed files with 1,056 additions and 7 deletions.
28 changes: 28 additions & 0 deletions .devnet/.devnet/addresses.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"AddressManager": "0xFa1Ee2C5389fCfAa64fc4db474921DcDd16935aD",
"BlockOracle": "0x042deb7f12Dad67215b7dD433f53B50C1C1bcb85",
"DisputeGameFactory": "0x1D76cd1460239F99516F165578b6A80EFb70f3C6",
"DisputeGameFactoryProxy": "0xecFabA3236Af67B64CC15A2008655b70F0f6cE49",
"L1CrossDomainMessenger": "0x8b84AF32666581DF5bA5ED70Faf4bF6547c87081",
"L1CrossDomainMessengerProxy": "0xF63C35E531597284D0D4304B77c799d978230573",
"L1ERC721Bridge": "0xCe68D59B1cC563C9c0CFea6E8C9D2424171a20e8",
"L1ERC721BridgeProxy": "0xb74CE4230E618d5b13932E31D6fEb8DE5840F36c",
"L1StandardBridge": "0xb0227Da95b6cB90441641e6B0d45B6e984c76A7D",
"L1StandardBridgeProxy": "0xbF88970ED1e49Dd147175841d9995c5FA1696703",
"L2OutputOracle": "0x021A0D5b6d54011553969Cc23838746A5297Fb27",
"L2OutputOracleProxy": "0x64F0197caEcC5e791Fb7a06b1169EdCD6aB4c18a",
"Mips": "0xf730b1417f41E295aE7470596845a3F86Fcf07F8",
"OptimismMintableERC20Factory": "0xb06D438Fd30194bA3cC73B139Ae4e06367344F68",
"OptimismMintableERC20FactoryProxy": "0xbA79ce88Edf887BC03e64f937ff27000ad01a6Bd",
"OptimismPortal": "0xD14AA6C7B6D92803F3910Ec1DADCCd0757341862",
"OptimismPortalProxy": "0x7992BCBA71F7A37BE487897F439850af074Cad22",
"PreimageOracle": "0x103007788A710124E93232323019e2d3477462b3",
"ProtocolVersions": "0x42F0bD8313ad456A38061308857b2383fe2c72a0",
"ProtocolVersionsProxy": "0x01fdC14D72Af349AA84d362415a791FDb45bAde7",
"ProxyAdmin": "0x9Bdc45BC60a94aaee18e68815C07Cb92d19f8267",
"SafeProxyFactory": "0x93f09D841bEc92DaEA42Bb3F1a5B10aAcE32b163",
"SafeSingleton": "0x8d18e952ab8EEDAFD1f2b3C6aB4d33eCedE7991d",
"SystemConfig": "0x3b6090d4ba84B94C20a789436B9010F340AaaC70",
"SystemConfigProxy": "0xBd32d803230EE846AC241b74B95a44dd9A77dC94",
"SystemOwnerSafe": "0xe71Dd79ADEa2470C164e12B0e94d5986EDe805fF"
}
473 changes: 473 additions & 0 deletions .devnet/.devnet/allocs-l1.json

Large diffs are not rendered by default.

28 changes: 28 additions & 0 deletions .devnet/addresses.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"AddressManager": "0x07F7735fEb88Db1560Cd783e2dC6A08a8fC8a656",
"BlockOracle": "0x042deb7f12Dad67215b7dD433f53B50C1C1bcb85",
"DisputeGameFactory": "0x1D76cd1460239F99516F165578b6A80EFb70f3C6",
"DisputeGameFactoryProxy": "0xF4544d11a7E18B129684212dE25FE4Efaff6eCE9",
"L1CrossDomainMessenger": "0xDa2332D0a7608919Cd331B1304Cd179129a90495",
"L1CrossDomainMessengerProxy": "0xcEc3E8946719ec314496898964e177c56d6dC0c0",
"L1ERC721Bridge": "0x806C2d0d2BDDFf9279CB2A8722F9117f0b0aDE73",
"L1ERC721BridgeProxy": "0x7Cabc92821a83c27122730685e689AE576Dcc003",
"L1StandardBridge": "0xcfBCbA6d9E84A3c4FaE0eda9684cE39a09aa2c8A",
"L1StandardBridgeProxy": "0xC8F10Ed818723152E782FCa54E782aA2C0fbE29f",
"L2OutputOracle": "0x8203dEBE6cD849358473715fD46FE9b1aE44C44D",
"L2OutputOracleProxy": "0x971196d5a89635821Ea8Bddb7345B5B5046Abff4",
"Mips": "0xc5E3069cF714625A6f4339549058ED310B15017E",
"OptimismMintableERC20Factory": "0x373B66bd178cb2716D5A9596B1a42Ed39b87A535",
"OptimismMintableERC20FactoryProxy": "0x8cF55BA8cd44749618d68613577aE51194A72d9E",
"OptimismPortal": "0xD14AA6C7B6D92803F3910Ec1DADCCd0757341862",
"OptimismPortalProxy": "0x98e5D81f309284d009e95774E6CF81dCBF741E86",
"PreimageOracle": "0xC1327F8a7819f4ed1708Afb2e5cE4C810d3B6195",
"ProtocolVersions": "0x42F0bD8313ad456A38061308857b2383fe2c72a0",
"ProtocolVersionsProxy": "0xfa42a44338A39a08482A2B7b068B15988831BB68",
"ProxyAdmin": "0x9c788232CCDD4F0ff3F0e1E17cd874c9edba5932",
"SafeProxyFactory": "0x45d2490cC9EC86342BCa60F34D0cF720AbB0c015",
"SafeSingleton": "0x0628D5cD59439Ff8C39E2ADA97164766DedC60f7",
"SystemConfig": "0x3b6090d4ba84B94C20a789436B9010F340AaaC70",
"SystemConfigProxy": "0x1df7b00Fd625F3BC07afe8f93Ba946DA0cCAE75F",
"SystemOwnerSafe": "0xc97CbC808F98888b47777281534eeE6a0996A464"
}
466 changes: 466 additions & 0 deletions .devnet/allocs-l1.json

Large diffs are not rendered by default.

53 changes: 53 additions & 0 deletions .devnet/devnetL1.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{
"l1ChainID": 900,
"l2ChainID": 901,
"l2BlockTime": 2,
"maxSequencerDrift": 300,
"sequencerWindowSize": 200,
"channelTimeout": 120,
"p2pSequencerAddress": "0x9965507D1a55bcC2695C58ba16FB37d819B0A4dc",
"batchInboxAddress": "0xff00000000000000000000000000000000000901",
"batchSenderAddress": "0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC",
"cliqueSignerAddress": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
"l1UseClique": true,
"l1StartingBlockTag": "earliest",
"l2OutputOracleSubmissionInterval": 10,
"l2OutputOracleStartingTimestamp": 0,
"l2OutputOracleStartingBlockNumber": 0,
"l2OutputOracleProposer": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8",
"l2OutputOracleChallenger": "0x15d34AAf54267DB7D7c367839AAf71A00a2C6A65",
"l2GenesisBlockGasLimit": "0x1c9c380",
"l1BlockTime": 3,
"baseFeeVaultRecipient": "0x14dC79964da2C08b23698B3D3cc7Ca32193d9955",
"l1FeeVaultRecipient": "0x23618e81E3f5cdF7f54C3d65f7FBc0aBf5B21E8f",
"sequencerFeeVaultRecipient": "0xa0Ee7A142d267C1f36714E4a8F75612F20a79720",
"baseFeeVaultMinimumWithdrawalAmount": "0x8ac7230489e80000",
"l1FeeVaultMinimumWithdrawalAmount": "0x8ac7230489e80000",
"sequencerFeeVaultMinimumWithdrawalAmount": "0x8ac7230489e80000",
"baseFeeVaultWithdrawalNetwork": "remote",
"l1FeeVaultWithdrawalNetwork": "remote",
"sequencerFeeVaultWithdrawalNetwork": "remote",
"proxyAdminOwner": "0xa0Ee7A142d267C1f36714E4a8F75612F20a79720",
"finalSystemOwner": "0xa0Ee7A142d267C1f36714E4a8F75612F20a79720",
"portalGuardian": "0xa0Ee7A142d267C1f36714E4a8F75612F20a79720",
"finalizationPeriodSeconds": 2,
"fundDevAccounts": true,
"l2GenesisBlockBaseFeePerGas": "0x1",
"gasPriceOracleOverhead": 2100,
"gasPriceOracleScalar": 1000000,
"enableGovernance": true,
"governanceTokenSymbol": "OP",
"governanceTokenName": "Optimism",
"governanceTokenOwner": "0xa0Ee7A142d267C1f36714E4a8F75612F20a79720",
"eip1559Denominator": 50,
"eip1559Elasticity": 6,
"l1GenesisBlockTimestamp": "0x64c811bf",
"l2GenesisRegolithTimeOffset": "0x0",
"l2GenesisSpanBatchTimeOffset": "0x0",
"faultGameAbsolutePrestate": "0x03c7ae758795765c6664a5d39bf63841c71ff191e9189522bad8ebff5d4eca98",
"faultGameMaxDepth": 30,
"faultGameMaxDuration": 1200,
"systemConfigStartBlock": 0,
"requiredProtocolVersion": "0x0000000000000000000000000000000000000000000000000000000000000000",
"recommendedProtocolVersion": "0x0000000000000000000000000000000000000000000000000000000000000000"
}
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,4 @@ config.env
/.idea
genesis.json
alert-routing.yaml
.devnet
packages/contracts-bedrock/deploy-config/devnetL1.json
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/base-org/pessimism
go 1.21

require (
github.com/ethereum-optimism/optimism v1.1.6-rc.2.0.20231005231252-34f2657719c1
github.com/ethereum-optimism/optimism v1.2.0
github.com/ethereum/go-ethereum v1.13.1
github.com/go-chi/chi v1.5.5
github.com/go-chi/render v1.0.3
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,8 @@ github.com/ethereum-optimism/go-ethereum-hdwallet v0.1.3 h1:RWHKLhCrQThMfch+QJ1Z
github.com/ethereum-optimism/go-ethereum-hdwallet v0.1.3/go.mod h1:QziizLAiF0KqyLdNJYD7O5cpDlaFMNZzlxYNcWsJUxs=
github.com/ethereum-optimism/op-geth v1.101301.0-rc.2.0.20231002141926-1e6910b91798 h1:WRaF/uniRnlxTVlMfFWPtMe9NefzZWg/8Fc93Nao76w=
github.com/ethereum-optimism/op-geth v1.101301.0-rc.2.0.20231002141926-1e6910b91798/go.mod h1:p02vxGt8jcF8pCwkUU5Oy56X8/JsM1Js+KC+fwihVgk=
github.com/ethereum-optimism/optimism v1.1.6-rc.2.0.20231005231252-34f2657719c1 h1:/FRey5JP1sgiZH6cRdkg17mbR6//Gm0PdwuNEuaQKMs=
github.com/ethereum-optimism/optimism v1.1.6-rc.2.0.20231005231252-34f2657719c1/go.mod h1:y1J1a0BkbJ5MTImx1Ayk2syTXZEoFucRAsBpdzbn0Qk=
github.com/ethereum-optimism/optimism v1.2.0 h1:wlVqKHj6+HCMrXRskLM7b45zcdqSHCsVk0Kmg+ViCS8=
github.com/ethereum-optimism/optimism v1.2.0/go.mod h1:y1J1a0BkbJ5MTImx1Ayk2syTXZEoFucRAsBpdzbn0Qk=
github.com/ethereum-optimism/superchain-registry/superchain v0.0.0-20231001123245-7b48d3818686 h1:f57hd8G96c8ORWd4ameFpveSnHcb0hA2D1VatviwoDc=
github.com/ethereum-optimism/superchain-registry/superchain v0.0.0-20231001123245-7b48d3818686/go.mod h1:q0u2UbyOr1q/y94AgMOj/V8b1KO05ZwILTR/qKt7Auo=
github.com/ethereum/c-kzg-4844 v0.3.1 h1:sR65+68+WdnMKxseNWxSJuAv2tsUrihTpVBTfM/U5Zg=
Expand Down
8 changes: 5 additions & 3 deletions internal/engine/registry/withdrawal_safety.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ func NewWithdrawalSafetyHeuristic(ctx context.Context, cfg *UnsafeWithdrawalCfg)
func (wi *WithdrawalSafetyHeuristic) Assess(td core.TransitData) (*heuristic.ActivationSet, error) {
// TODO - Support running from withdrawal initiated or withdrawal proven events

// 1. Validate input
logging.NoContext().Debug("Checking activation for withdrawal enforcement heuristic",
zap.String("data", fmt.Sprintf("%v", td)))

Expand Down Expand Up @@ -141,6 +142,7 @@ func (wi *WithdrawalSafetyHeuristic) Assess(td core.TransitData) (*heuristic.Act
}

// TODO - Update withdrawal decoding to convert to big.Int instead of string
// TODO - Validate that message hash matches the proven withdrawal msg hash
corrWithdrawal := withdrawals[0]

// 4. Fetch the OptimismPortal balance at the time which the withdrawal was proven
Expand Down Expand Up @@ -182,14 +184,14 @@ func (wi *WithdrawalSafetyHeuristic) Assess(td core.TransitData) (*heuristic.Act
return !correlated, uncorrelatedWithdraw
},
// 5.4
// Ensure message_hash != 0x0 (0x0 is the default value for bytes32)
// Ensure message_hash != 0x0 and message_hash != 0xf...f
func() (bool, string) {
if corrWithdrawal.MessageHash == minAddr.String() {
return true, "Withdrawal message hash is 0x0000000000000000000000000000000000000000"
return true, "Withdrawal message hash is 0x0"
}

if corrWithdrawal.MessageHash == maxAddr.String() {
return true, "Withdrawal message hash is 0xffffffffffffffffffffffffffffffffffffffff"
return true, "Withdrawal message hash is 0xf...f"
}

return false, ""
Expand Down

0 comments on commit 1770f2c

Please sign in to comment.