Skip to content

Commit 68ddf29

Browse files
authored
Refactor openInitializeChainDb for Execution/Consensus split (#4169)
* Refactor openInitializeChainDb for Execution/Consensus split Today openInitializeChainDb has procedures related to both Execution and Consensus components. So we split them into target functions related specifically to either Execution and Consensus. Signed-off-by: Igor Braga <5835477+bragaigor@users.noreply.github.com> * remote TODOs and fix comments Signed-off-by: Igor Braga <5835477+bragaigor@users.noreply.github.com> * Add changelog Signed-off-by: Igor Braga <5835477+bragaigor@users.noreply.github.com> * make lint and tests happy Signed-off-by: Igor Braga <5835477+bragaigor@users.noreply.github.com> * divide responsibilities and detach chainConfig init Signed-off-by: Igor Braga <5835477+bragaigor@users.noreply.github.com> * clean comment and add cacheConfig nil check Signed-off-by: Igor Braga <5835477+bragaigor@users.noreply.github.com> * Improve tests and remove comments Add checkDBDir tests Signed-off-by: Igor Braga <5835477+bragaigor@users.noreply.github.com> * Refactor nitro init and config functionality - Create new config package to expose and organize init and config nitro functionality. - Add new system_tests for openExistingExecutionDB and getConsensusParsedInitMsg Signed-off-by: Igor Braga <5835477+bragaigor@users.noreply.github.com> * make lint happy and move testdata files to correct location Signed-off-by: Igor Braga <5835477+bragaigor@users.noreply.github.com> * Create new init package, remove tests and organize code Signed-off-by: Igor Braga <5835477+bragaigor@users.noreply.github.com> * add GetInit test that skips initDataReader Signed-off-by: Igor Braga <5835477+bragaigor@users.noreply.github.com> * fix ReadBoldAssertionCreationInfo behaviour and update signatures Signed-off-by: Igor Braga <5835477+bragaigor@users.noreply.github.com> * fix GetConsensusParsedInitMsg BoLD test calls Signed-off-by: Igor Braga <5835477+bragaigor@users.noreply.github.com> * add genesis assertion tests Signed-off-by: Igor Braga <5835477+bragaigor@users.noreply.github.com> * fix BoLD tests Signed-off-by: Igor Braga <5835477+bragaigor@users.noreply.github.com> * make lint happy and remove duplicate initReorg Signed-off-by: Igor Braga <5835477+bragaigor@users.noreply.github.com> * Add test to cover chainconfig with TryReadStoredChainConfig Signed-off-by: Igor Braga <5835477+bragaigor@users.noreply.github.com> * cleanup TestGetInitWithChainconfigInDB test And remove error if !isBoldChain Signed-off-by: Igor Braga <5835477+bragaigor@users.noreply.github.com> * make lint happy Signed-off-by: Igor Braga <5835477+bragaigor@users.noreply.github.com> * Update genesis assertion tests to load with empty initData Signed-off-by: Igor Braga <5835477+bragaigor@users.noreply.github.com> * remove unecessary GenesisBlockNum overrides in tests Signed-off-by: Igor Braga <5835477+bragaigor@users.noreply.github.com> --------- Signed-off-by: Igor Braga <5835477+bragaigor@users.noreply.github.com>
1 parent 21f4267 commit 68ddf29

18 files changed

+2032
-1103
lines changed

changelog/bragaigor-nit-4199.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
### Changed
2+
- Refactor openInitializeChainDb for Execution/Consensus split
3+
- Create new config and init package to expose and organize init and config nitro functionality

cmd/nitro/config/config.go

Lines changed: 402 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Copyright 2021-2026, Offchain Labs, Inc.
22
// For license information, see https://github.com/OffchainLabs/nitro/blob/master/LICENSE.md
33

4-
package main
4+
package config
55

66
import (
77
"context"
Lines changed: 392 additions & 230 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)