Skip to content

Commit

Permalink
Fixed comments for tableMapper
Browse files Browse the repository at this point in the history
  • Loading branch information
oliverbundalo committed Mar 4, 2024
1 parent 63f046b commit 18221b5
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions blockchain/storagev2/leveldb/leveldb.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,20 @@ type levelDB struct {
db *leveldb.DB
}

// DB key = k + mapper
var tableMapper = map[uint8][]byte{
storagev2.BODY: []byte("b"), // DB key = block number + mapper
storagev2.CANONICAL: []byte("c"), // DB key = block number + mapper
storagev2.DIFFICULTY: []byte("d"), // DB key = block number + mapper
storagev2.HEADER: []byte("h"), // DB key = block number + mapper
storagev2.RECEIPTS: []byte("r"), // DB key = block number + mapper
storagev2.FORK: {}, // DB key = FORK_KEY + mapper
storagev2.HEAD_HASH: {}, // DB key = HEAD_HASH_KEY + mapper
storagev2.HEAD_NUMBER: {}, // DB key = HEAD_NUMBER_KEY + mapper
storagev2.BLOCK_LOOKUP: {}, // DB key = block hash + mapper, value = block number
storagev2.TX_LOOKUP: {}, // DB key = tx hash + mapper, value = block number
// Main DB
storagev2.BODY: []byte("b"), // DB key = block number + block hash + mapper, value = block body
storagev2.DIFFICULTY: []byte("d"), // DB key = block number + block hash + mapper, value = block total diffculty
storagev2.HEADER: []byte("h"), // DB key = block number + block hash + mapper, value = block header
storagev2.RECEIPTS: []byte("r"), // DB key = block number + block hash + mapper, value = block receipts
storagev2.CANONICAL: {}, // DB key = block number + mapper, value = block hash

// GidLid DB
storagev2.FORK: {}, // DB key = FORK_KEY + mapper, value = fork hashes
storagev2.HEAD_HASH: {}, // DB key = HEAD_HASH_KEY + mapper, value = head hash
storagev2.HEAD_NUMBER: {}, // DB key = HEAD_NUMBER_KEY + mapper, value = head number
storagev2.BLOCK_LOOKUP: {}, // DB key = block hash + mapper, value = block number
storagev2.TX_LOOKUP: {}, // DB key = tx hash + mapper, value = block number
}

// NewLevelDBStorage creates the new storage reference with leveldb default options
Expand Down

0 comments on commit 18221b5

Please sign in to comment.