Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update trie package and node #253

Merged
merged 109 commits into from
Sep 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
109 commits
Select commit Hold shift + click to select a range
ea01867
more p2p config
rameight Jun 6, 2023
b107cfa
change format of persistent peer config
rameight Jun 6, 2023
3aee829
adjust config for local
rameight Jun 6, 2023
acd1ee6
update new local setup
rameight Jun 6, 2023
41a75a0
change permission
rameight Jun 6, 2023
d933f4d
remove eth client build from docker image
rameight Jun 6, 2023
000f4ac
fix wrong text in log
rameight Jun 6, 2023
3722e2b
update testnet setup
rameight Jun 6, 2023
73cd167
update deployment local setup
rameight Jun 7, 2023
a81e9ca
remove collision of persistent peers and seeds
rameight Jun 7, 2023
7dd28d0
push back blacklist code
rameight Jun 7, 2023
239e334
update
rameight Jun 7, 2023
a5dce58
fix
rameight Jun 7, 2023
ed930c4
clean up peer state when remove peer
rameight Jun 7, 2023
f067dc2
add metrics for state modifications and kvstore
rameight Jun 10, 2023
4cce05b
Revert "change permission"
rameight Jun 11, 2023
ac4d520
update trie package
rameight Jun 11, 2023
220e98a
refactor kvstore to rawdb
rameight Jun 11, 2023
ea30cb7
temp fix import cyclics
rameight Jun 11, 2023
6c63606
adapt changes
rameight Jun 11, 2023
ffecdb1
adapt change of state trie
rameight Jun 11, 2023
1b88b85
add lib lru
rameight Jun 11, 2023
590d9b0
add state snapshot, but not apply it yet, adapt state db
rameight Jun 11, 2023
52b0d02
update go mod
rameight Jun 11, 2023
83aeb54
fix return empty block
rameight Jun 11, 2023
345e8e7
update gomod
rameight Jun 11, 2023
cc176d4
ignore files
rameight Jun 12, 2023
cdc7cab
update gitignore
rameight Jun 12, 2023
aec1137
fix statedb changes
rameight Jun 12, 2023
0b6505d
add chain id
rameight Jun 12, 2023
939754a
add chain id
rameight Jun 12, 2023
b00f3bc
add gcmode
rameight Jun 14, 2023
2f1ae87
fix empty hash of genesis state root
rameight Jun 15, 2023
45d63df
fix empty hash of genesis state root
rameight Jun 15, 2023
a8b238f
add pruner
rameight Jun 15, 2023
3a7257a
Merge branch 'trie/update' of https://github.com/phatngluu/go-kardia …
rameight Jun 15, 2023
d423a00
add back deleted code
rameight Jun 15, 2023
d66e9d9
add schema
rameight Jun 15, 2023
b420919
fix usage of external libs
rameight Jun 15, 2023
95c3680
refactor genesis
rameight Jun 16, 2023
60da8ed
update header chain
rameight Jun 16, 2023
89f0c4b
update new blockchain
rameight Jun 16, 2023
30315b9
adapt changes in genesis
rameight Jun 16, 2023
4b0078b
add genesis schema
rameight Jun 16, 2023
f4fadb5
adapt changes db wrapper
rameight Jun 16, 2023
d28a09a
new backend, deprecating kardiaservice, prepare for stack node
rameight Jun 16, 2023
e4c18b1
add schema db version
rameight Jun 16, 2023
4d5ea43
fix wrong imports
rameight Jun 16, 2023
fcd5e12
fix broken code by changes
rameight Jun 16, 2023
82cb442
remove unused metric config
rameight Jun 17, 2023
aa2a609
fix breaking
rameight Jun 17, 2023
8561208
refactor node to use empty stack
rameight Jun 19, 2023
d4c6e64
fix missing config
rameight Jun 19, 2023
9e922ab
update schema of contracct code
rameight Jun 19, 2023
121c413
rename geth to kaigo
rameight Jun 20, 2023
a722797
remove breaking tests
rameight Jun 20, 2023
159de71
implement gracefully shutdown for blockchain
rameight Jun 20, 2023
bd3febe
Merge branch 'local' into trie/update
rameight Jun 20, 2023
0f01f3c
Merge pull request #1 from phatngluu/trie/update
rameight Jun 20, 2023
91882d1
Merge pull request #2 from phatngluu/cmd/update
rameight Jun 20, 2023
7f29345
revert unwant changes (#3)
rameight Jun 20, 2023
43446ef
rename file headers
rameight Jun 20, 2023
ac0c187
remove dead code
rameight Jun 20, 2023
ee25e78
change order of switch setup
rameight Jun 20, 2023
a4f29c9
fix missing transport in node
rameight Jun 21, 2023
816a55b
Testing (#4)
rameight Jun 21, 2023
f1aa058
put back old deployment file
rameight Jun 21, 2023
a84d1ed
update docker file
rameight Jun 22, 2023
cdcd541
change host
rameight Jun 22, 2023
1401a79
make sync timeout configurable
rameight Jun 22, 2023
7d37fa9
simple fallback
rameight Jun 23, 2023
5fa26b9
move nonsense log to lower log level
rameight Jun 23, 2023
970eadf
add log for blockchain
rameight Jun 23, 2023
2fb1709
edit func description of new header chain
rameight Jun 24, 2023
22ab231
remove redundant func
rameight Jun 24, 2023
8a507fc
split to blockchain reader
rameight Jun 24, 2023
7dfae09
remove apply message function blockchain
rameight Jun 24, 2023
ab6f8f7
simplify genesis to block
rameight Jun 25, 2023
2dad505
sanitize code
rameight Jun 25, 2023
eebeeca
update lib prque
rameight Jun 25, 2023
aa7315f
recover chain after pruning
rameight Jun 27, 2023
302b89c
dont use block.AppHash
rameight Jun 27, 2023
104ecae
fix format printing
rameight Jun 27, 2023
6570973
avoid block.AppHash() but use app hash at block height
rameight Jun 29, 2023
f61e8ff
more detail log
rameight Jun 30, 2023
464c032
add missing node config
rameight Jun 30, 2023
c9b9835
fix load latest state at height
rameight Jun 30, 2023
ef5c848
add log file flag
rameight Jun 30, 2023
e482eed
add consensus state to schema and accessor
rameight Jul 3, 2023
2372091
write consensus state with height
rameight Jul 3, 2023
0aa2b2c
update base blockchain
rameight Jul 3, 2023
a75a332
add schema and accessors for consensus state
rameight Jul 7, 2023
314c24c
simplify consensus state protobuf
rameight Jul 7, 2023
da8ab93
refactor storing consensus state
rameight Jul 7, 2023
a410241
add read me for protobuf generation
rameight Jul 7, 2023
6dd1545
update go mod & go sum
rameight Jul 7, 2023
7130bc1
add flags for log
rameight Jul 7, 2023
67bd977
fix missing staking and validator initialization
rameight Jul 7, 2023
107730a
improve store consensus state
rameight Jul 7, 2023
ea61546
add test for store
rameight Jul 7, 2023
2722fd5
Revert "rename file headers"
rameight Jul 7, 2023
e389fae
add pruning option to consensus state store
rameight Jul 8, 2023
452266d
update mock of store
rameight Jul 8, 2023
0859a16
clean code
rameight Jul 9, 2023
da4ce63
remove duplicated code
rameight Jul 9, 2023
5447412
remove auto consensus prune state
rameight Jul 9, 2023
adbac9d
add error consensus state not found
rameight Jul 9, 2023
da7a77e
mocking new store
rameight Jul 9, 2023
2214661
Merge branch 'master' into trie/update
rameight Aug 15, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ FROM golang:1.19.4-alpine as builder
RUN apk update && apk add build-base cmake gcc git
WORKDIR /go/src/github.com/kardiachain/go-kardia
ADD . .
WORKDIR /go/src/github.com/kardiachain/go-kardia/cmd
WORKDIR /go/src/github.com/kardiachain/go-kardia/cmd/kaigo
RUN go install
WORKDIR /go/bin

Expand All @@ -12,4 +12,4 @@ COPY cmd/cfg/* /go/bin/cfg/
ENV PATH="${PATH}:/go/bin"
WORKDIR /go/bin
COPY --from=builder /go/bin/* .
ENTRYPOINT ["./cmd"]
ENTRYPOINT ["./kaigo"]
19 changes: 8 additions & 11 deletions blockchain/reactor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import (
"github.com/kardiachain/go-kardia/configs"
"github.com/kardiachain/go-kardia/kai/kaidb/memorydb"
"github.com/kardiachain/go-kardia/kai/state/cstate"
"github.com/kardiachain/go-kardia/kai/storage/kvstore"
"github.com/kardiachain/go-kardia/lib/behaviour"
"github.com/kardiachain/go-kardia/lib/common"
"github.com/kardiachain/go-kardia/lib/log"
Expand Down Expand Up @@ -161,15 +160,14 @@ func newTestReactor(p testReactorParams) *BlockchainReactor {
fmt.Println(err)
return nil
}
stateDB := memorydb.New()
kaiDb := kvstore.NewStoreDB(stateDB)
chainConfig, _, genesisErr := genesis.SetupGenesisBlock(logger, kaiDb, p.genDoc, stakingUtil)
db := memorydb.New()
chainConfig, _, genesisErr := genesis.SetupGenesisBlock(db, p.genDoc)
if genesisErr != nil {
fmt.Println(genesisErr)
return nil
}
stateStore := cstate.NewStore(kaiDb.DB())
bc, err := blockchain.NewBlockChain(logger, kaiDb, chainConfig)
stateStore := cstate.NewStore(db)
bc, err := blockchain.NewBlockChain(db, nil, nil)
if err != nil {
fmt.Println(err)
return nil
Expand Down Expand Up @@ -531,15 +529,14 @@ func newReactorStore(
fmt.Println(err)
return nil, cstate.LatestBlockState{}, nil
}
stateDB := memorydb.New()
kaiDb := kvstore.NewStoreDB(stateDB)
chainConfig, _, genesisErr := genesis.SetupGenesisBlock(logger, kaiDb, genDoc, stakingUtil)
db := memorydb.New()
chainConfig, _, genesisErr := genesis.SetupGenesisBlock(db, genDoc)
if genesisErr != nil {
fmt.Println(genesisErr)
return nil, cstate.LatestBlockState{}, nil
}
stateStore := cstate.NewStore(kaiDb.DB())
bc, err := blockchain.NewBlockChain(logger, kaiDb, chainConfig)
stateStore := cstate.NewStore(db)
bc, err := blockchain.NewBlockChain(db, nil, nil)
if err != nil {
fmt.Println(err)
return nil, cstate.LatestBlockState{}, nil
Expand Down
2 changes: 1 addition & 1 deletion blockchain/scheduler.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ func newScheduler(initHeight uint64, startTime time.Time, fastSync *configs.Fast
sc := scheduler{
initHeight: initHeight,
lastAdvance: startTime,
syncTimeout: 60 * time.Second,
syncTimeout: fastSync.SyncTimeout,
height: initHeight,
blockStates: make(map[uint64]blockState),
peers: make(map[p2p.ID]*scPeer),
Expand Down
77 changes: 77 additions & 0 deletions cmd/cfg/node.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
[Kai]
NetworkId = 24
NoPruning = false
NoPrefetch = false
AcceptTxs = true

[Kai.FastSync]
ServiceName = "BCR"
Enable = true
MaxPeers = 10
TargetPending = 10
SyncTimeout = 6000000000000 # 1mins
PeerTimeout = 15000000000
MinRecvRate = 0

[Node]
Name = "kaigo"
Version = "2.1.0-stable-a4f29c9c"
DataDir = "/home/steven/.kardia"
IPCPath = "kaigo.ipc"
HTTPHost = "0.0.0.0"
HTTPPort = 8545
HTTPCors = ["*"]
HTTPVirtualHosts = ["0.0.0.0", "127.0.0.1", "localhost"]
HTTPModules = [
"node",
"kai",
"tx",
"account",
"debug",
"net",
"eth",
"txpool",
"web3",
]
WSHost = "0.0.0.0"
WSPort = 8546
WSOrigins = ["*"]
WSModules = [
"node",
"kai",
"tx",
"account",
"debug",
"net",
"eth",
"txpool",
"web3",
]

[Node.P2P]
PrivateKeyRaw = ""
AddrBookStrict = false
ListenAddress = "tcp://0.0.0.0:3000"
ExternalAddress = ""
SeedMode = false
Seeds = [
"6f6d3aaf5613a255b9215b654b4ee6327b7d6bb9@34.87.172.182:3000",
"8854c90d9a5d5b9f65c9a5b83047421274c431e1@34.87.174.171:3000",
"eec19374e2f7df3bf6b734a319cfd38b1e215b34@34.126.73.34:3000",
"d7acfdf01f4e3d0d535a9c77b568f0bbf2224028@34.87.115.154:3000",
"6e167a36c1fde26ea8867e8bb419cd02c59a8647@35.240.235.48:3000",
"1e54a8d737ea4cbb2797b4d115f527285ebc1960@35.186.149.95:3000",
"61ff9218d3e587e4d40b94a67fea6a1c04497597@34.143.203.90:3000",
"09fe09a87bb88af8c93cd3b3e3affb04a4b156f4@34.126.181.26:3000",
"e8b02ebc2572a5976d33963acf753b917acb40ee@35.247.166.212:3000",
"45162a0dce131b11f278c5351287e8a3ca04f147@34.126.150.138:3000",
"c7a6d21e95be085b6943092cca88d0002d3f9366@35.198.215.9:3000",
"275df9c8270ed0b4535d2e20fd05cb4fb03e5b92@34.126.177.91:3000",
]
PersistentPeers = []
UnconditionalPeerIDs = []
PrivatePeerIDs = []

[Metrics]
HTTP = "0.0.0.0"
Port = 6000
123 changes: 0 additions & 123 deletions cmd/flags.go

This file was deleted.