Skip to content

Commit 7d2fbe0

Browse files
authored
Merge pull request #6798 from spacemeshos/node-split-poc-merge-develop
merge develop to node-split-poc
2 parents c42a987 + bd66a8e commit 7d2fbe0

File tree

10 files changed

+30
-8
lines changed

10 files changed

+30
-8
lines changed

CHANGELOG.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,21 @@ pointing to the running `node` service.
1616

1717
* [#6625](https://github.com/spacemeshos/go-spacemesh/pull/6625) Add command for starting services
1818

19+
## v1.8.1
20+
21+
### Highlights
22+
23+
This release will enable syncv2 fully to sync ATXs for all nodes. This should greatly reduce the time it takes to sync
24+
a node from genesis and the amount of data that is needed to be exchanged with the network to keep a node in sync. The
25+
improvements are enabled automatically after upgrading to this version and no user action is needed.
26+
27+
### Improvements
28+
29+
* [6792](https://github.com/spacemeshos/go-spacemesh/pull/6792) Fixed race condition in `FPTree` implementation (sync v2).
30+
31+
* [6794](https://github.com/spacemeshos/go-spacemesh/pull/6794) Increased database connection idle timeout,
32+
which should reduce occurances of `SQLITE_BUSY` errors.
33+
1934
## v1.8.0
2035

2136
### Highlights
@@ -34,6 +49,9 @@ in terms of data size and more easily extendable in the future.
3449
* [#6779](https://github.com/spacemeshos/go-spacemesh/pull/6779) Fixed the malfeasance publisher not emitting events.
3550
This caused the node to miss malfeasance proofs when streaming via the GRPC API.
3651

52+
* [#6784](https://github.com/spacemeshos/go-spacemesh/pull/6784) Fixed possible corruptions of DB transactions
53+
when a context is cancelled mid transaction (sync v2).
54+
3755
## v1.7.17
3856

3957
### Improvements

config/mainnet.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ func MainnetConfig() Config {
9696
DatabaseConnections: 32,
9797
DatabasePruneInterval: 30 * time.Minute,
9898
DatabaseVacuumState: 21,
99-
DatabaseConnIdleTimeout: 10 * time.Millisecond,
99+
DatabaseConnIdleTimeout: 500 * time.Millisecond,
100100
PruneActivesetsFrom: 12, // starting from epoch 13 activesets below 12 will be pruned
101101
NetworkHRP: "sm",
102102

@@ -230,7 +230,7 @@ func MainnetConfig() Config {
230230
MalSync: malsync.DefaultConfig(),
231231
ReconcSync: syncer.ReconcSyncConfig{
232232
Enable: true,
233-
EnableActiveSync: false,
233+
EnableActiveSync: true,
234234
OldAtxSyncCfg: oldAtxSyncCfg,
235235
NewAtxSyncCfg: newAtxSyncCfg,
236236
ParallelLoadLimit: 10,

config/presets/fastnet.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ func fastnet() config.Config {
2323
conf.BaseConfig.OptFilterThreshold = 90
2424
conf.BaseConfig.DatabasePruneInterval = time.Minute
2525
conf.BaseConfig.DatabaseConnections = 16
26+
conf.BaseConfig.DatabaseConnIdleTimeout = 500 * time.Millisecond
2627

2728
// set for systest TestEquivocation
2829
conf.BaseConfig.MinerGoodAtxsPercent = 50

config/presets/standalone.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ func standalone() config.Config {
2626
conf.BaseConfig.AtxVersions = activation.AtxVersions{
2727
types.EpochID(2): types.AtxV2,
2828
}
29+
conf.BaseConfig.DatabaseConnIdleTimeout = 500 * time.Millisecond
2930

3031
conf.TIME.Peersync.Disable = true
3132
conf.Standalone = true

config/presets/testnet.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ func testnet() config.Config {
8585
DatabaseConnections: 32,
8686
DatabaseSizeMeteringInterval: 10 * time.Minute,
8787
DatabasePruneInterval: 30 * time.Minute,
88-
DatabaseConnIdleTimeout: 10 * time.Millisecond,
88+
DatabaseConnIdleTimeout: 500 * time.Millisecond,
8989
NetworkHRP: "stest",
9090

9191
LayerDuration: 5 * time.Minute,

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ require (
3434
github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a
3535
github.com/prometheus/client_golang v1.21.1
3636
github.com/prometheus/client_model v0.6.1
37-
github.com/prometheus/common v0.62.0
37+
github.com/prometheus/common v0.63.0
3838
github.com/quic-go/quic-go v0.50.0
3939
github.com/rqlite/sql v0.0.0-20241111133259-a4122fabb196
4040
github.com/rs/cors v1.11.1

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -547,8 +547,8 @@ github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:
547547
github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E=
548548
github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY=
549549
github.com/prometheus/common v0.0.0-20180801064454-c7de2306084e/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro=
550-
github.com/prometheus/common v0.62.0 h1:xasJaQlnWAeyHdUBeGjXmutelfJHWMRr+Fg4QszZ2Io=
551-
github.com/prometheus/common v0.62.0/go.mod h1:vyBcEuLSvWos9B1+CyL7JZ2up+uFzXhkqml0W5zIY1I=
550+
github.com/prometheus/common v0.63.0 h1:YR/EIY1o3mEFP/kZCD7iDMnLPlGyuU2Gb3HIcXnA98k=
551+
github.com/prometheus/common v0.63.0/go.mod h1:VVFF/fBIoToEnWRVkYoXEkq3R3paCoxG9PXP74SnV18=
552552
github.com/prometheus/procfs v0.0.0-20180725123919-05ee40e3a273/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
553553
github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc=
554554
github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk=

sql/database.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ func WithForceMigrations(force bool) Opt {
162162
}
163163
}
164164

165-
// WithSchema specifies database schema script.
165+
// WithDatabaseSchema specifies database schema script.
166166
func WithDatabaseSchema(schema *Schema) Opt {
167167
return func(c *conf) {
168168
c.schema = schema

sync2/fptree/fptree.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -617,6 +617,8 @@ func (ft *FPTree) storeValues() bool {
617617
// If this function returns true and the tree doesn't store the values, the key may be
618618
// contained in the tree.
619619
func (ft *FPTree) CheckKey(k rangesync.KeyBytes) bool {
620+
ft.np.lockRead()
621+
defer ft.np.unlockRead()
620622
// We're unlikely to be able to find a node with the full prefix, but if we can
621623
// find a leaf node with matching partial prefix, that's good enough except
622624
// that we also need to check the node's fingerprint.

sync2/sqlstore/syncedtable.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ func (st *SyncedTable) loadMaxRowID(db sql.Executor) (maxRowID int64, err error)
163163
return maxRowID, err
164164
}
165165

166-
// Snaptshot creates a snapshot of the table based on its current max rowid value.
166+
// Snapshot creates a snapshot of the table based on its current max rowid value.
167167
func (st *SyncedTable) Snapshot(db sql.Executor) (*SyncedTableSnapshot, error) {
168168
maxRowID, err := st.loadMaxRowID(db)
169169
if err != nil {

0 commit comments

Comments
 (0)