Skip to content

Conversation

@bas-vk
Copy link
Member

@bas-vk bas-vk commented Apr 13, 2015

Stores a blockchain version in the blockchain DB and checks if the version in the database matches a hard coded version number. This hard coded number is the consensus algorithm version number. If the algorithm is changed the number should be bumped. If these number differ the user is forced to run a new introduced upgradedb command. This command:

  1. exports the current blockchain to datadir/blockchain_${currentversion}_${timestamp}.chain
  2. removes the current blockchain db
  3. imports the exported file using the new algorithm
  4. if successful removes the file

It also holds 3 bugfixes for:

  1. nilpointer exception caused by the blockprocesser not set on import
  2. the export commands exports the latest block first, this causes the import command to drop blocks since it points to unknown parents
  3. the databases uses in memory buffering and flushes on particular criteria. When these criteria are not met changes are not persisted. This caused "missing" blocks on import when the program doesn't do an explicit flush.

@obscuren
Copy link
Contributor

Looks good 👍

Next time I'd change the following (juts submit future PR):

func saveBlockchainVersion(db common.Database, bcVersion int) {
// --- snip ---
        db.Put([]byte("BlockchainVersion"), common.NewValue(bcVersion).Bytes())
}

to

bytes, err := rlp.Encode(uint(bcVersion))
db.Put([]byte("BlockChainVersion"), bytes)

common.Value should be removed because it's easy to make mistake and it's bad design (on my part).

obscuren added a commit that referenced this pull request Apr 13, 2015
Added blockchain DB versioning support, closes #650
@obscuren obscuren merged commit 5f9346b into ethereum:develop Apr 13, 2015
@bas-vk bas-vk deleted the issue_650 branch April 22, 2015 10:51
jpeletier pushed a commit to epiclabs-io/go-ethereum that referenced this pull request Jun 11, 2018
…kstore

swarm/storage: do not close rh.chunkstore
ngtuna pushed a commit to ngtuna/tomochain that referenced this pull request Sep 16, 2019
ngtuna pushed a commit to ngtuna/tomochain that referenced this pull request Sep 20, 2019
tony-ricciardi pushed a commit to tony-ricciardi/go-ethereum that referenced this pull request Jan 20, 2022
maoueh pushed a commit to streamingfast/go-ethereum that referenced this pull request Sep 13, 2023
…port EIP-4337 Bundled Transactions (ethereum#945)

* added new api to support conditional transactions (EIP-4337) (ethereum#700)

* Refactored the code and updated the miner to check for the validity of options (ethereum#793)

* refactored the code and updated the miner to check for the validity of options

* added new errors -32003 and -32005

* added unit tests

* addressed comments

* Aa 4337 update generics (ethereum#799)

* poc

* minor bug fix

* use common.Hash

* updated UnmarshalJSON function (reference - tynes)

* fix

* done

* linters

* with test

* undo some unintentional changes

---------

Co-authored-by: Pratik Patil <[email protected]>

* handelling the block range and timestamp range, also made timestamp a pointer

---------

Co-authored-by: Evgeny Danilenko <[email protected]>

* Added filtering of conditional transactions in txpool (ethereum#920)

* added filtering of conditional transactions in txpool

* minor fix in ValidateKnownAccounts

* bug fix

* Supporting nil knownAccounts

* lints

* bundled transactions are not announced/broadcasted to the peers

* fixed after upstream merge

* few fixes

* sentry reject conditional transaction

* Changed the namespace of conditional transaction API from `eth` to `bor` (ethereum#985)

* added conditional transaction to bor namespace

* test comit

* test comit

* added conditional transaction

* namespapce changed to bor

* cleanup

* cleanup

* addressed comments

* reverted changes in ValidateKnownAccounts

* addressed comments and removed unwanted code

* addressed comments

* bug fix

* lint

* removed licence from core/types/transaction_conditional_test.go

---------

Co-authored-by: Evgeny Danilenko <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants