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

feat: change predeploy contract addresses #398

Merged
merged 14 commits into from
Dec 16, 2024
29 changes: 29 additions & 0 deletions op-node/rollup/derive/fuzz_parsers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,35 @@ func FuzzL1InfoEcotoneRoundTrip(f *testing.F) {
})
}

// FuzzL1InfoKromaMPTRoundTrip checks that our Kroma MPT encoder round trips properly
func FuzzL1InfoKromaMPTRoundTrip(f *testing.F) {
f.Fuzz(func(t *testing.T, number, time uint64, baseFee, blobBaseFee, hash []byte, seqNumber uint64, baseFeeScalar, blobBaseFeeScalar uint32, validatorRewardScalar []byte) {
seolaoh marked this conversation as resolved.
Show resolved Hide resolved
in := L1BlockInfo{
Number: number,
Time: time,
BaseFee: BytesToBigInt(baseFee),
BlockHash: common.BytesToHash(hash),
SequenceNumber: seqNumber,
BlobBaseFee: BytesToBigInt(blobBaseFee),
BaseFeeScalar: baseFeeScalar,
BlobBaseFeeScalar: blobBaseFeeScalar,
ValidatorRewardScalar: eth.Bytes32(common.BytesToHash(validatorRewardScalar)),
}
enc, err := in.marshalBinaryKromaMPT()
if err != nil {
t.Fatalf("Failed to marshal binary: %v", err)
}
var out L1BlockInfo
err = out.unmarshalBinaryKromaMPT(enc)
if err != nil {
t.Fatalf("Failed to unmarshal binary: %v", err)
}
if !cmp.Equal(in, out, cmp.Comparer(testutils.BigEqual)) {
t.Fatalf("The data did not round trip correctly. in: %v. out: %v", in, out)
}
})
}

// FuzzL1InfoAgainstContract checks the custom Bedrock L1 Info marshalling functions against the
// setL1BlockValues contract bindings to ensure that our functions are up to date and match the
// bindings. Note that we don't test setL1BlockValuesEcotone since it accepts only custom packed
Expand Down
2 changes: 1 addition & 1 deletion op-node/rollup/derive/kromampt_upgrade_transactions.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func KromaMPTNetworkUpgradeTransactions() ([]hexutil.Bytes, error) {
To: nil,
Mint: big.NewInt(0),
Value: big.NewInt(0),
Gas: 375_000,
Gas: 500_000,
IsSystemTransaction: false,
Data: l1BlockMPTDeploymentBytecode,
}).MarshalBinary()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func TestMPTNetworkTransactions(t *testing.T) {
require.Equal(t, deployL1BlockSender, L1BlockMPTDeployerAddress)
require.Equal(t, deployL1BlockMPTSource.SourceHash(), deployL1Block.SourceHash())
require.Nil(t, deployL1Block.To())
require.Equal(t, uint64(375_000), deployL1Block.Gas())
require.Equal(t, uint64(500_000), deployL1Block.Gas())
require.Equal(t, hexutil.Bytes(l1BlockMPTDeploymentBytecode).String(), hexutil.Bytes(deployL1Block.Data()).String())

deployBaseFeeVaultSender, deployBaseFeeVault := toDepositTxn(t, upgradeTxns[1])
Expand Down
2 changes: 1 addition & 1 deletion op-node/rollup/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ func (c *Config) IsKromaMPT(timestamp uint64) bool {
}

// IsKromaMPTParentBlock returns whether the specified block is the parent block subject to the
// KromaMPT upgrade.
// KromaMPT upgrade. KromaMPT activation at genesis does not count.
func (c *Config) IsKromaMPTParentBlock(l2BlockTime uint64) bool {
return c.KromaMPTTime != nil && l2BlockTime == *c.KromaMPTTime-c.BlockTime
}
Expand Down