Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Baklava migration config #272

Merged
merged 3 commits into from
Nov 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion cannon/mipsevm/testutil/evm.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,9 @@ func NewEVMEnv(contracts *ContractMetadata) (*vm.EVM, *state.StateDB) {
if err != nil {
panic(fmt.Errorf("failed to create memory state db: %w", err))
}
blockContext := core.NewEVMBlockContext(header, bc, nil, chainCfg, state)

feeCurrencyContext := core.GetFeeCurrencyContext(header, chainCfg, state)
blockContext := core.NewEVMBlockContext(header, bc, nil, chainCfg, state, feeCurrencyContext)
vmCfg := vm.Config{}

env := vm.NewEVM(blockContext, vm.TxContext{}, state, chainCfg, vmCfg)
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ require (
rsc.io/tmplfunc v0.0.3 // indirect
)

replace github.com/ethereum/go-ethereum => github.com/celo-org/op-geth v1.101408.1-0.20241011074051-d8e6791dbc37
replace github.com/ethereum/go-ethereum => github.com/celo-org/op-geth v1.101408.1-0.20241129112120-a102e49b89c3

// replace github.com/ethereum/go-ethereum => ../op-geth

Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ github.com/btcsuite/snappy-go v1.0.0/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg
github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792/go.mod h1:ghJtEyQwv5/p4Mg4C0fgbePVuGr935/5ddU9Z3TmDRY=
github.com/btcsuite/winsvc v1.0.0/go.mod h1:jsenWakMcC0zFBFurPLEAyrnc/teJEM1O46fmI40EZs=
github.com/buger/jsonparser v0.0.0-20181115193947-bf1c66bbce23/go.mod h1:bbYlZJ7hK1yFx9hf58LP0zeX7UjIGs20ufpu3evjr+s=
github.com/celo-org/op-geth v1.101408.1-0.20241011074051-d8e6791dbc37 h1:vOpdVeAT5E+6jfvsTlyFfUwUW7r0gM/EJLi/YzfLPXQ=
github.com/celo-org/op-geth v1.101408.1-0.20241011074051-d8e6791dbc37/go.mod h1:Mk8AhvlqFbjI9oW2ymThSSoqc6kiEH0/tCmHGMEu6ac=
github.com/celo-org/op-geth v1.101408.1-0.20241129112120-a102e49b89c3 h1:B0zdGButiL94J1Sn2hJ23KnEWPoVZgjLL6T801uaCqU=
github.com/celo-org/op-geth v1.101408.1-0.20241129112120-a102e49b89c3/go.mod h1:Mk8AhvlqFbjI9oW2ymThSSoqc6kiEH0/tCmHGMEu6ac=
github.com/cespare/cp v0.1.0 h1:SE+dxFebS7Iik5LK0tsi1k9ZCxEaFX4AjQmoyA+1dJk=
github.com/cespare/cp v0.1.0/go.mod h1:SOGHArjBr4JWaSDEVpWpo/hNg6RoKrls6Oh40hiwW+s=
github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko=
Expand Down
6 changes: 6 additions & 0 deletions op-chain-ops/cmd/celo-migrate/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,18 @@ var (
// CreateX
common.HexToAddress("0xba5Ed099633D3B313e4D5F7bdc1305d3c28ba5Ed"): false,
},
BaklavaNetworkID: {
// DeterministicDeploymentProxy
common.HexToAddress("0x4e59b44847b379578588920cA78FbF26c0B4956C"): false,
},
Comment on lines +83 to +86
Copy link

Choose a reason for hiding this comment

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

Why do we need only a single entry compared to the many for alfajores?

Copy link
Author

Choose a reason for hiding this comment

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

Processing address: 0xcA11bde05977b3631167028862bE2a173976CA11
Code mismatch for address: 0xcA11bde05977b3631167028862bE2a173976CA11
Codesize on https://baklava-forno.celo-testnet.org: 0
Nonce on https://baklava-forno.celo-testnet.org: 0

From the output we see that 0xcA11bde05977b3631167028862bE2a173976CA11 doesn't have any code or nonce on Baklava, so that account will be overwritten by default.

The same is true for all accounts besides the one listed.

}
unreleasedTreasuryAddressMap = map[uint64]common.Address{
AlfajoresNetworkID: common.HexToAddress("0x07bf0b2461A0cb608D5CF9a82ba97dAbA850F79F"),
BaklavaNetworkID: common.HexToAddress("0x022c5d5837E177B6d145761feb4C5574e5b48F5e"),
}
celoTokenAddressMap = map[uint64]common.Address{
AlfajoresNetworkID: addresses.CeloTokenAlfajoresAddress,
BaklavaNetworkID: addresses.CeloTokenBaklavaAddress,
MainnetNetworkID: addresses.CeloTokenAddress,
}
)
Expand Down
3 changes: 2 additions & 1 deletion op-chain-ops/cmd/op-simulate/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,8 @@ func simulate(ctx context.Context, logger log.Logger, conf *params.ChainConfig,

// run the transaction
start := time.Now()
receipt, err := core.ApplyTransaction(conf, cCtx, &sender, &gp, state, header, tx, &usedGas, vmConfig)
feeCurrencyContext := core.GetFeeCurrencyContext(header, conf, state)
receipt, err := core.ApplyTransaction(conf, cCtx, &sender, &gp, state, header, tx, &usedGas, vmConfig, feeCurrencyContext)
if err != nil {
return fmt.Errorf("failed to apply tx: %w", err)
}
Expand Down
6 changes: 4 additions & 2 deletions op-e2e/actions/helpers/l1_miner.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,8 @@ func (s *L1Miner) ActL1StartBlock(timeDelta uint64) Action {
// TODO(client-pod#826)
// Unfortunately this is not part of any Geth environment setup,
// we just have to apply it, like how the Geth block-builder worker does.
context := core.NewEVMBlockContext(header, s.l1Chain, nil, s.l1Chain.Config(), statedb)
feeCurrencyContext := core.GetFeeCurrencyContext(header, s.l1Chain.Config(), statedb)
context := core.NewEVMBlockContext(header, s.l1Chain, nil, s.l1Chain.Config(), statedb, feeCurrencyContext)
// NOTE: Unlikely to be needed for the beacon block root, but we setup any precompile overrides anyways for forwards-compatibility
var precompileOverrides vm.PrecompileOverrides
if vmConfig := s.l1Chain.GetVMConfig(); vmConfig != nil && vmConfig.PrecompileOverrides != nil {
Expand Down Expand Up @@ -176,8 +177,9 @@ func (s *L1Miner) IncludeTx(t Testing, tx *types.Transaction) {
return
}
s.l1BuildingState.SetTxContext(tx.Hash(), len(s.L1Transactions))
feeCurrencyContext := core.GetFeeCurrencyContext(s.l1BuildingHeader, s.l1Cfg.Config, s.l1BuildingState)
receipt, err := core.ApplyTransaction(s.l1Cfg.Config, s.l1Chain, &s.l1BuildingHeader.Coinbase,
s.L1GasPool, s.l1BuildingState, s.l1BuildingHeader, tx.WithoutBlobTxSidecar(), &s.l1BuildingHeader.GasUsed, *s.l1Chain.GetVMConfig())
s.L1GasPool, s.l1BuildingState, s.l1BuildingHeader, tx.WithoutBlobTxSidecar(), &s.l1BuildingHeader.GasUsed, *s.l1Chain.GetVMConfig(), feeCurrencyContext)
if err != nil {
s.l1TxFailed = append(s.l1TxFailed, tx)
t.Fatalf("failed to apply transaction to L1 block (tx %d): %v", len(s.L1Transactions), err)
Expand Down
6 changes: 4 additions & 2 deletions op-program/client/l2/engineapi/block_processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ func NewBlockProcessorFromHeader(provider BlockDataProvider, h *types.Header) (*
if h.ParentBeaconRoot != nil {
// Unfortunately this is not part of any Geth environment setup,
// we just have to apply it, like how the Geth block-builder worker does.
context := core.NewEVMBlockContext(header, provider, nil, provider.Config(), statedb)
feeCurrencyContext := core.GetFeeCurrencyContext(header, provider.Config(), statedb)
context := core.NewEVMBlockContext(header, provider, nil, provider.Config(), statedb, feeCurrencyContext)
// NOTE: Unlikely to be needed for the beacon block root, but we setup any precompile overrides anyways for forwards-compatibility
var precompileOverrides vm.PrecompileOverrides
if vmConfig := provider.GetVMConfig(); vmConfig != nil && vmConfig.PrecompileOverrides != nil {
Expand Down Expand Up @@ -113,8 +114,9 @@ func (b *BlockProcessor) CheckTxWithinGasLimit(tx *types.Transaction) error {
func (b *BlockProcessor) AddTx(tx *types.Transaction) error {
txIndex := len(b.transactions)
b.state.SetTxContext(tx.Hash(), txIndex)
feeCurrencyContext := core.GetFeeCurrencyContext(b.header, b.dataProvider.Config(), b.state)
receipt, err := core.ApplyTransaction(b.dataProvider.Config(), b.dataProvider, &b.header.Coinbase,
b.gasPool, b.state, b.header, tx, &b.header.GasUsed, *b.dataProvider.GetVMConfig())
b.gasPool, b.state, b.header, tx, &b.header.GasUsed, *b.dataProvider.GetVMConfig(), feeCurrencyContext)
if err != nil {
return fmt.Errorf("failed to apply transaction to L2 block (tx %d): %w", txIndex, err)
}
Expand Down
Loading