Skip to content

Standard L2 Genesis#12057

Closed
tynes wants to merge 93 commits into
developfrom
feat/holocene-contracts
Closed

Standard L2 Genesis#12057
tynes wants to merge 93 commits into
developfrom
feat/holocene-contracts

Conversation

@tynes

@tynes tynes commented Sep 23, 2024

Copy link
Copy Markdown
Contributor

Description

Moves network specific values into L1Block.sol.

Fixes: #12297, #12349, #12298, #12299, #12300, #12301, #12303, #12304, #12305, #12655

Open items:

  • Debug the failing IL1BlockInterop interface check. It does not behave the same on my machine (I have failures in both IL1Block and IL1BlockInterop). It's related to the constructor afaict, but I can't make it work.
  • Fix the one failing forge test, test_upgrade_correctEvent_succeeds
  • Fix the unused imports check
  • Add feeAdmin to op-deployer
  • Consider if the new SystemConfig.Roles struct should also contain the unsafeBlockSigner
    • There is also a Roles struct in OPCM. This is a bit confusing, can we disambiguate it?
  • Fix the semgrep findings

Cut from scope:

}

/// @notice
function encodeSetRemoteChainId(uint256 _chainId) internal pure returns (bytes memory) {

@semgrep-app semgrep-app Bot Sep 23, 2024

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Named return arguments to functions must be appended with an underscore (_)

Ignore this finding from sol-style-return-arg-fmt.

}

/// @notice
function encodeSetAddress(address _address) internal pure returns (bytes memory) {

@semgrep-app semgrep-app Bot Sep 23, 2024

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Named return arguments to functions must be appended with an underscore (_)

Ignore this finding from sol-style-return-arg-fmt.

}

/// @notice
function encodeSetFeeVaultConfig(address _recipient, uint256 _min, FeeVault.WithdrawalNetwork _network) internal pure returns (bytes memory) {

@semgrep-app semgrep-app Bot Sep 23, 2024

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Named return arguments to functions must be appended with an underscore (_)

Ignore this finding from sol-style-return-arg-fmt.

@semgrep-app

semgrep-app Bot commented Sep 23, 2024

Copy link
Copy Markdown
Contributor

Semgrep found 1 sol-style-return-arg-fmt finding:

  • packages/contracts-bedrock/src/L1/OPStackManager.sol

Named return arguments to functions must be appended with an underscore (_)

Ignore this finding from sol-style-return-arg-fmt.

@tynes tynes force-pushed the feat/holocene-contracts branch from 73c3220 to 1eb9745 Compare September 28, 2024 23:30
@semgrep-app

semgrep-app Bot commented Sep 28, 2024

Copy link
Copy Markdown
Contributor

Semgrep found 2 golang_fmt_errorf_no_params findings:

No fmt.Errorf invocations without fmt arguments allowed

Ignore this finding from golang_fmt_errorf_no_params.

Semgrep found 6 sol-style-return-arg-fmt findings:

Named return arguments to functions must be appended with an underscore (_)

Ignore this finding from sol-style-return-arg-fmt.

Semgrep found 2 sol-style-require-reason findings:

require() must include a reason string

Ignore this finding from sol-style-require-reason.

Semgrep found 12 sol-safety-deployutils-args findings:

_args parameter should be wrapped with DeployUtils.encodeConstructor

Ignore this finding from sol-safety-deployutils-args.

@@ -0,0 +1,9 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.15;

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider refactoring the ProxyAdmin to remove the L1 specific features and make a L1ProxyAdmin

vm.store(Predeploys.PROXY_ADMIN, _ownerSlot, bytes32(uint256(uint160(cfg.proxyAdminOwner()))));
// update the proxy to not be uninitialized (although not standard initialize pattern)
vm.store(impl, _ownerSlot, bytes32(uint256(uint160(cfg.proxyAdminOwner()))));
vm.store(impl, bytes32(0), bytes32(uint256(0xdead)));

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

todo: double check if this is necessary, this adds complexity to the genesis definition

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't think of why it would be necessary... is there something in storage at that slot on OP Mainnet?

@semgrep-app

semgrep-app Bot commented Sep 30, 2024

Copy link
Copy Markdown
Contributor

Semgrep found 6 sol-style-require-reason findings:

require() must include a reason string

Ignore this finding from sol-style-require-reason.

Comment thread packages/contracts-bedrock/src/L2/L1Block.sol Fixed
Comment thread packages/contracts-bedrock/src/L2/L1Block.sol Fixed
Comment thread packages/contracts-bedrock/src/L2/L1Block.sol Fixed
Comment thread packages/contracts-bedrock/src/libraries/StaticConfig.sol Fixed
@tynes tynes force-pushed the feat/holocene-contracts branch from 59db8a6 to 14d10ef Compare October 6, 2024 19:59
@tynes tynes changed the title wip: holocene contracts wip: isthmus contracts Oct 6, 2024
@tynes tynes changed the title wip: isthmus contracts wip: Standard L2 Genesis Oct 6, 2024
Comment thread packages/contracts-bedrock/scripts/L2Genesis.s.sol Outdated
Comment thread packages/contracts-bedrock/src/L1/OptimismPortal2.sol Outdated
Comment thread packages/contracts-bedrock/src/L2/L2ERC721Bridge.sol Outdated
Comment thread packages/contracts-bedrock/scripts/deploy/Deploy.s.sol Outdated
Comment thread packages/contracts-bedrock/src/L1/L1ERC721Bridge.sol Outdated
Comment thread packages/contracts-bedrock/src/L1/L1CrossDomainMessenger.sol Outdated
checkStorageSlot(t, alloc, predeploys.ProxyAdminAddr, ownerSlot, addrAsSlot)
var defaultGovOwner common.Hash
defaultGovOwner.SetBytes(common.HexToAddress("0xDeaDDEaDDeAdDeAdDEAdDEaddeAddEAdDEAdDEad").Bytes())
checkStorageSlot(t, alloc, predeploys.GovernanceTokenAddr, common.Hash{31: 0x0a}, defaultGovOwner)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Restore this check.

Comment thread op-deployer/pkg/deployer/integration_test/apply_test.go
Comment thread packages/contracts-bedrock/scripts/DeployOPChain.s.sol
Comment thread packages/contracts-bedrock/scripts/DeployOPChain.s.sol
Comment thread packages/contracts-bedrock/src/universal/CrossDomainMessenger.sol
This was referenced Oct 30, 2024
@ethereum-optimism ethereum-optimism deleted a comment from semgrep-app Bot Oct 31, 2024
@tynes

tynes commented Nov 18, 2024

Copy link
Copy Markdown
Contributor Author

Going to close this PR due to it being replaced by another

@tynes tynes closed this Nov 18, 2024
@tynes tynes deleted the feat/holocene-contracts branch November 18, 2024 10:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Standard L2 Genesis: Implement FeeVault Modifications

3 participants