Design: GoQuarkChain rearchitecture — without regenesis#139
Open
Design: GoQuarkChain rearchitecture — without regenesis#139
Conversation
Closed
Contributor
|
There’s a lot of overlap with #137. Could you show only the differences so reviewers don’t have to go through the same content again? |
Contributor
Author
GoQuarkChain Redesign: Plan ComparisonTwo redesign plans are under consideration:
Core Differences
xshard DesignThe xshard design is not the main part of the review; the xshard designs in the two plans can be applied to each other. Pros and ConsPlan A — No RegenesisPros
Cons
Plan B — RegenesisPros
Cons
SummaryThe choice reduces to engineering cost vs. community cost:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds the primary design doc for the GoQuarkChain rearchitecture ( Embedded geth — Avoids Regenesis), which drives the upcoming Go / geth upgrade and EVM alignment work.
The document specifies how to replace the vendored go-ethereum v1.8.20 with a QuarkChain fork of upstream geth v1.17.2+ without regenesis, covering the architectural split, hard-fork mechanism, lazy state migration, transaction format migration, xshard redesign, block header mapping, the geth patch set, and the new module layout.
Highlights
go.modusesreplaceto point atQuarkChain/go-ethereum v1.17.2-qkc. Divergence from upstream is collapsed into 6 targeted patches, so future upgrades land viagit merge upstreamwith conflicts confined to those files.ExecutionLayerGo interface boundary is introduced, but the deployment topology (master + N slaves), the master–slave gRPC protocol, and the P2P wire protocol are all unchanged.MinorBlockChain) or ModernEL (embedded upstream geth) based onPrevRootBlockHeight.TokenBalanceMap accounts are decoded on read and rewritten in standard geth format on commit. Non-native tokens migrate via a pre-deployedTokenMigrationRegistry+ per-token ERC-20 contracts, with system mints triggered on first account access — zero overhead at the fork block.XshardSendsystem contract; destination side introduces an OP-style EIP-2718 type0x71XShardDepositTxsystem transaction. Slave-to-slave TCP distribution, the gas model, and execution ordering are all preserved.N-20xshard pause,N-10full tx pause) drain the mempool and xshard queue before cutover. MetaMask users transition transparently viabaseFeeauto-detection.MinorBlockHeaderis kept as the on-chain type so the root block format is unchanged. Two projection helpers (toGethHeader()/gethHeaderToMinorBlockHeader()) bridge to/fromethTypes.Header; post-fork, the canonical minor-block hash is geth'sHeader.Hash().Scope of this PR
L1/goquarkchain-redesign-avoids-regenesis.md(916 lines).shardcl/,shardel/, system contracts (XshardSend,TokenMigrationRegistry), andmetamask_api.goadaptation.Open Questions
Items the doc flags as undecided and worth resolving during review:
QKCForkRootHeight(governance decision).gorocksdbwith pebble, and whether to dropbou.ke/monkey(Go 1.17+ unsafe restrictions).Reviewer Focus
Suggested areas for close review:
N-20/N-10suspension windows plus thesetHead(confirmedHeaderTip)cutover insideAddRootBlock(N)actually guarantee an empty mempool and an empty xshard queue at the fork boundary?journal.dirtyinsideload()for accounts with non-native balances sufficient to prevent the double-mint hazard on read-only access?CoinbaseAmount,MetaHash) post-fork — any consensus implication on the root chain side?