Skip to content

Initialize by upgrading - #780

Merged
rachel-bousfield merged 12 commits into
masterfrom
initialize-by-upgrading
Jul 20, 2022
Merged

Initialize by upgrading#780
rachel-bousfield merged 12 commits into
masterfrom
initialize-by-upgrading

Conversation

@edfelten

Copy link
Copy Markdown
Contributor

This changes how ArbOS initialization works. Previously we would initialize directly to the desired ArbOS version, as specified in the chain config. This changes the process to initialize to version 1, then run version upgrades progressively until the desired ArbOS version is reached.

This has the advantage that initialization and upgrading use the same code path.

@cla-bot cla-bot Bot added the cla-signed label Jul 12, 2022
@codecov

codecov Bot commented Jul 12, 2022

Copy link
Copy Markdown

Codecov Report

Merging #780 (783b9c6) into master (efd41aa) will increase coverage by 14.21%.
The diff coverage is 56.75%.

❗ Current head 783b9c6 differs from pull request most recent head ccb2da0. Consider uploading reports for the commit ccb2da0 to get more accurate results

@@             Coverage Diff             @@
##           master     #780       +/-   ##
===========================================
+ Coverage   34.56%   48.77%   +14.21%     
===========================================
  Files          58      211      +153     
  Lines        2798    23021    +20223     
  Branches      494      494               
===========================================
+ Hits          967    11228    +10261     
- Misses       1831    10255     +8424     
- Partials        0     1538     +1538     

Comment thread arbos/arbosState/arbosstate.go Outdated
_ = sto.SetByUint64(uint64(networkFeeAccountOffset), common.Hash{}) // the 0 address until an owner sets it
_ = sto.SetByUint64(uint64(chainIdOffset), common.BigToHash(chainConfig.ChainID))
_ = sto.SetUint64ByUint64(uint64(genesisBlockNumOffset), chainConfig.ArbitrumChainParams.GenesisBlockNum)
_ = l1pricing.InitializeL1PricingState(sto.OpenSubStorage(l1PricingSubspace), arbosVersion, initialChainOwner)

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.

Since this now works with actual version (1) rather than the desired one, the version check diverges. I synced a node to confirm the block hashes don't match and am checking if there's somewhere else we do too

Comment thread arbos/arbosState/arbosstate.go Outdated
switch state.arbosVersion {
case 1:
ensure(state.l1PricingState.SetLastSurplus(common.Big0))
if chainConfig != nil {

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.

This check passes on nova, causing a divergence

@rachel-bousfield rachel-bousfield left a comment

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.

Looks great!

@rachel-bousfield
rachel-bousfield merged commit aa28ba7 into master Jul 20, 2022
@rachel-bousfield
rachel-bousfield deleted the initialize-by-upgrading branch July 20, 2022 16:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants