Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
626e35e
feat: store/fetch reduced platform state in drive
ogabrielides Feb 12, 2025
9e4b02c
removed genesis_block_info from ReducedPlatformStateForSavingV0
ogabrielides Feb 23, 2025
17544d6
removed Error in trait ReducedPlatformDeserializable
ogabrielides Feb 23, 2025
7e0aa3d
work
ogabrielides Feb 24, 2025
740c7d4
more work
ogabrielides Feb 25, 2025
2f0d543
ci: use github-hosted arm runner for release workflow (#2452)
shumkov Feb 11, 2025
98c24d8
chore: bump tenderdash-abci and removed finalize_snapshot
ogabrielides Feb 26, 2025
298cad0
chore: updated frequency of snapshots to 5
ogabrielides Feb 26, 2025
234e30f
fix: store_reduced_platform_state_bytes update existing value
ogabrielides Mar 3, 2025
519d39e
chore(dashmate): tenderdash dev image for statesync
lklimek Mar 6, 2025
c6c8961
feat: added last_block_info in state
ogabrielides Mar 6, 2025
99901ff
feat: final work
ogabrielides Mar 7, 2025
1549a63
Merge branch 'v2.0-dev' into feat/reduced+state_sync
ogabrielides Mar 7, 2025
d4574c1
fix: conflict error
ogabrielides Mar 7, 2025
2009ca8
refactor: suggestions
ogabrielides Mar 7, 2025
bfe7210
refactor: fmt
ogabrielides Mar 7, 2025
dcf539a
feat: tx intermediate state sync
ogabrielides Mar 11, 2025
f08584e
Merge branch 'v2.0-dev' into feat/state_sync_intermediate
ogabrielides Mar 11, 2025
c008a29
Merge remote-tracking branch 'origin/v2.0-dev' into feat/reduced+stat…
lklimek Mar 11, 2025
6f71a3a
Merge branch 'feat/state_sync_intermediate' into feat/reduced+state_sync
ogabrielides Mar 11, 2025
3403ec5
fmt
ogabrielides Mar 11, 2025
c401b0e
test: extended_block_info and update_validators
ogabrielides Mar 14, 2025
79e51a9
test: set_next_validator_set_quorum_hash
ogabrielides Mar 14, 2025
56ca2c9
Revert "test: set_next_validator_set_quorum_hash"
ogabrielides Mar 14, 2025
b4bc6b7
test: proposer_pro_tx_hash
ogabrielides Mar 14, 2025
9774a1b
Merge branch 'v2.0-dev' into feat/reduced+state_sync
ogabrielides Mar 18, 2025
7eca088
small cleanup
ogabrielides Mar 18, 2025
2987f80
feat: added last_validator_rotation_core_height
ogabrielides Mar 20, 2025
bd5c3cb
Revert "feat: added last_validator_rotation_core_height"
ogabrielides Mar 20, 2025
f746cc9
Merge remote-tracking branch 'origin/v2.0-dev' into feat/reduced+stat…
lklimek Mar 21, 2025
e6536fc
chore: update cargo.lock
lklimek Mar 21, 2025
3b0d6ab
fmt and added next quorum hash becomes current
QuantumExplorer Mar 21, 2025
46a7858
suggestions
ogabrielides Mar 25, 2025
5e5d1f1
more suggestions
ogabrielides Mar 25, 2025
e88dbe5
more suggestions
ogabrielides Mar 25, 2025
6737313
more suggestions
ogabrielides Mar 26, 2025
126b150
fix: tests
ogabrielides Mar 26, 2025
4039657
chore: removed unused crate
ogabrielides Mar 26, 2025
b7a6e8c
feat: save order of validators to state
lklimek Mar 24, 2025
4ff7104
chore: improve logging
lklimek Mar 24, 2025
9084e2e
fix: next validators hash not set correctly
lklimek Mar 25, 2025
9830063
fix: set last_committed_block.quorum_hash
lklimek Mar 25, 2025
b278fc8
fix: invalid quorum hash when building validator sets
lklimek Mar 27, 2025
54e90e7
fix: don't override current valset with new one
lklimek Mar 27, 2025
c7d30e0
chore(drive-abci): don't log h2 debug
lklimek Mar 27, 2025
84ebb13
chore(Dockerfile): snapshots_enabled = true
lklimek Mar 27, 2025
e429680
fix(drive-abci): configuration doesn't work
lklimek Mar 27, 2025
6ec2f7e
chore: try to get core chain locked height from different place
lklimek Mar 27, 2025
347deca
chore: move next validator hash to current validator hash
lklimek Mar 27, 2025
4386f8a
chore: snapshots frequency 10 on mainnet
lklimek Mar 27, 2025
62bad4b
chore: snapshot freq 3 for mainnet
lklimek Mar 27, 2025
c6a1740
chore: remove copy-paste bug
lklimek Mar 28, 2025
6b79ae3
refactor: use update_core_info() to update validators and masternode …
lklimek Mar 28, 2025
ab01525
chore: some debug
lklimek Mar 28, 2025
fff9e8a
chore: move validators before storing
lklimek Mar 28, 2025
f06152d
docs: add missing docs
lklimek Mar 28, 2025
9d51e0d
chore: comments and clippy
lklimek Mar 28, 2025
92330be
chore: update_core_info start from scratch
lklimek Mar 28, 2025
0753a31
fix: update_core_info ignores is_init_chain aka start_from_scratch
lklimek Mar 28, 2025
cbcb8f0
chore: fix logging
lklimek Mar 28, 2025
4671b55
fix: invalid serialization of reduced platform state
lklimek Mar 28, 2025
668cbda
chore: log app_hash much much often
lklimek Mar 28, 2025
6e1bcd2
feat: update state to next height after state sync
lklimek Mar 28, 2025
b091395
chore: dont save block hash as we don't have it on proposer
lklimek Mar 28, 2025
48f5a67
chore: filter saved state for snapshot to avoid apphash mismatch
lklimek Mar 28, 2025
4d08f00
Merge remote-tracking branch 'origin/v2.0-dev' into fix/state-sync-qu…
lklimek Mar 31, 2025
bfa4651
refactor: try to store current block in last_committed_block_info, no…
lklimek Apr 1, 2025
d8337e8
Merge remote-tracking branch 'origin/v2.0-dev' into feat/reduced+stat…
lklimek Apr 24, 2025
d36184f
chore: some fixes after merge
lklimek Apr 24, 2025
0cba217
Merge branch 'feat/reduced+state_sync' into fix/state-sync-quorums-re…
lklimek Apr 24, 2025
3fdf661
feat(dashmate): add state sync configuration (#2558)
shumkov Apr 24, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/actions/sccache/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ inputs:
default: "true"
version:
description: "sccache version"
default: "0.8.2"
default: "0.9.1"
required: false
outputs:
env_vars:
Expand Down
16 changes: 4 additions & 12 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 11 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ ENV NODE_ENV=${NODE_ENV}
FROM deps-base AS deps-sccache

# SCCACHE_VERSION must be the same as in github actions, to avoid cache incompatibility
ARG SCCHACHE_VERSION=0.8.2
ARG SCCHACHE_VERSION=0.9.1

# Install sccache for caching
RUN if [[ "$TARGETARCH" == "arm64" ]] ; then export SCC_ARCH=aarch64; else export SCC_ARCH=x86_64; fi; \
Expand Down Expand Up @@ -600,19 +600,24 @@ LABEL description="Drive ABCI Rust"
RUN apk add --no-cache libgcc libstdc++

ENV DB_PATH=/var/lib/dash/rs-drive-abci/db
ENV CHECKPOINTS_PATH=/var/lib/dash/rs-drive-abci/db-checkpoints
ENV REJECTIONS_PATH=/var/log/dash/rejected

RUN mkdir -p /var/log/dash \
/var/lib/dash/rs-drive-abci/db \
${REJECTIONS_PATH}
ENV SNAPSHOTS_ENABLED=true

COPY --from=build-drive-abci /artifacts/drive-abci /usr/bin/drive-abci
COPY packages/rs-drive-abci/.env.mainnet /var/lib/dash/rs-drive-abci/.env

# Create a volume
VOLUME /var/lib/dash/rs-drive-abci/db
VOLUME /var/lib/dash/rs-drive-abci/db-checkpoints
VOLUME /var/log/dash

# Ensure required paths do exist
RUN mkdir -p /var/log/dash \
${DB_PATH} \
${CHECKPOINTS_PATH} \
${REJECTIONS_PATH}

# Double-check that we don't have missing deps
RUN ldd /usr/bin/drive-abci

Expand All @@ -622,6 +627,7 @@ RUN ldd /usr/bin/drive-abci
ARG USERNAME=dash
ARG USER_UID=1000
ARG USER_GID=$USER_UID

RUN addgroup -g $USER_GID $USERNAME && \
adduser -D -u $USER_UID -G $USERNAME -h /var/lib/dash/rs-drive-abci $USERNAME && \
chown -R $USER_UID:$USER_GID /var/lib/dash/rs-drive-abci /var/log/dash
Expand Down
3 changes: 1 addition & 2 deletions packages/dapi-grpc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ serde = ["dep:serde", "dep:serde_bytes", "tenderdash-proto/serde"]
mocks = ["serde", "dep:serde_json"]

[dependencies]
tenderdash-proto = { git = "https://github.com/dashpay/rs-tenderdash-abci", version = "1.4.0", tag = "v1.4.0", default-features = false }

prost = { version = "0.13" }
futures-core = "0.3.30"
tonic = { version = "0.13.0", features = [
Expand All @@ -51,6 +49,7 @@ tonic = { version = "0.13.0", features = [
serde = { version = "1.0.219", optional = true, features = ["derive"] }
serde_bytes = { version = "0.11.12", optional = true }
serde_json = { version = "1.0", optional = true }
tenderdash-proto = { git = "https://github.com/dashpay/rs-tenderdash-abci", version = "1.4.0", tag = "v1.4.0", default-features = false }
dapi-grpc-macros = { path = "../rs-dapi-grpc-macros" }
platform-version = { path = "../rs-platform-version" }

Expand Down
17 changes: 16 additions & 1 deletion packages/dashmate/configs/defaults/getBaseConfigFactory.js
Original file line number Diff line number Diff line change
Expand Up @@ -305,11 +305,18 @@ export default function getBaseConfigFactory() {
txProcessingTimeLimit: null,
},
epochTime: 788400,
stateSync: {
snapshots: {
enabled: true,
frequency: 5,
maxLimit: 100,
},
},
},
tenderdash: {
mode: 'full',
docker: {
image: 'dashpay/tenderdash:1',
image: 'dashpay/tenderdash:feat-statesync-improvements',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

update after td is merged

},
p2p: {
host: '0.0.0.0',
Expand Down Expand Up @@ -412,6 +419,14 @@ export default function getBaseConfigFactory() {
},
},
moniker: null,
stateSync: {
enabled: true,
retries: 3,
chunkRequestTimeout: '15s',
fetchersCount: 4,
maxConcurrentListSnapshots: 100,
maxConcurrentSnapshotChunk: 100,
},
},
},
sourcePath: null,
Expand Down
3 changes: 3 additions & 0 deletions packages/dashmate/configs/defaults/getLocalConfigFactory.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ export default function getLocalConfigFactory(getBaseConfig) {
metrics: {
port: 46660,
},
stateSync: {
enabled: false,
},
},
abci: {
epochTime: 1200,
Expand Down
27 changes: 26 additions & 1 deletion packages/dashmate/configs/getConfigFileMigrationsFactory.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
* @typedef {function} getConfigFileMigrations
* @returns {Object}
*/
function getConfigFileMigrations() {

Check failure on line 23 in packages/dashmate/configs/getConfigFileMigrationsFactory.js

View workflow job for this annotation

GitHub Actions / JS packages (dashmate) / Linting

'getConfigFileMigrations' is defined but never used
const base = defaultConfigs.get('base');
const testnet = defaultConfigs.get('testnet');
const mainnet = defaultConfigs.get('mainnet');
Expand Down Expand Up @@ -1096,8 +1096,33 @@
});
return configFile;
},
'2.1.0-dev.1': (configFile) => {
Object.entries(configFile.configs)
.forEach(([, options]) => {
options.platform.drive.tenderdash.stateSync = {
enabled: true,
retries: 3,
chunkRequestTimeout: '15s',
fetchersCount: 4,
maxConcurrentListSnapshots: 100,
maxConcurrentSnapshotChunk: 100,
};

options.platform.drive.abci.stateSync = {
snapshots: {
enabled: true,
frequency: 5,
maxLimit: 100,
},
};
});

configFile.configs.local.platform.drive.abci.stateSync.snapshots.enabled = false;
configFile.configs.local.platform.drive.tenderdash.stateSync.enabled = false;

return configFile;
},
};
}

Check failure on line 1126 in packages/dashmate/configs/getConfigFileMigrationsFactory.js

View workflow job for this annotation

GitHub Actions / JS packages (dashmate) / Linting

Block must not be padded by blank lines

return getConfigFileMigrations;
}
7 changes: 7 additions & 0 deletions packages/dashmate/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ services:
logging: *default-logging
volumes:
- drive_abci_data:/var/lib/dash/rs-drive-abci/db
- drive_abci_checkpoints:/var/lib/dash/rs-drive-abci/db-checkpoints
environment:
- CHAIN_ID=${PLATFORM_DRIVE_TENDERDASH_GENESIS_CHAIN_ID:-devnet}
- CORE_CONSENSUS_JSON_RPC_USERNAME=drive_consensus
Expand All @@ -82,6 +83,7 @@ services:
- INSTANT_LOCK_QUORUM_ACTIVE_SIGNERS=${PLATFORM_DRIVE_ABCI_INSTANT_LOCK_QUORUM_ACTIVE_SIGNERS:?err}
- INSTANT_LOCK_QUORUM_ROTATION=${PLATFORM_DRIVE_ABCI_INSTANT_LOCK_QUORUM_ROTATION:?err}
- DB_PATH=/var/lib/dash/rs-drive-abci/db
- GROVEDB_LATEST_FILE=/var/lib/dash/rs-drive-abci/db/latest_state
- ABCI_CONSENSUS_BIND_ADDRESS=tcp://0.0.0.0:26658
- GRPC_BIND_ADDRESS=0.0.0.0:26670
- PROMETHEUS_BIND_ADDRESS=${PLATFORM_DRIVE_ABCI_METRICS_URL}
Expand All @@ -92,6 +94,10 @@ services:
- GROVEDB_VISUALIZER_ADDRESS=0.0.0.0:${PLATFORM_DRIVE_ABCI_GROVEDB_VISUALIZER_PORT:?err}
- PROPOSER_TX_PROCESSING_TIME_LIMIT=${PLATFORM_DRIVE_ABCI_PROPOSER_TX_PROCESSING_TIME_LIMIT}
- NETWORK=${NETWORK:?err}
- CHECKPOINTS_PATH=/var/lib/dash/rs-drive-abci/db-checkpoints
- SNAPSHOTS_ENABLED=${PLATFORM_DRIVE_ABCI_STATE_SYNC_SNAPSHOTS_ENABLED:?err}
- SNAPSHOTS_FREQUENCY=${PLATFORM_DRIVE_ABCI_STATE_SYNC_SNAPSHOTS_FREQUENCY:?err}
- MAX_NUM_SNAPSHOTS=${PLATFORM_DRIVE_ABCI_STATE_SYNC_SNAPSHOTS_MAX_LIMIT:?err}
stop_grace_period: 30s
expose:
- 26658
Expand Down Expand Up @@ -226,6 +232,7 @@ services:
volumes:
core_data:
drive_abci_data:
drive_abci_checkpoints:
drive_tenderdash:

networks:
Expand Down
56 changes: 55 additions & 1 deletion packages/dashmate/src/config/configJsonSchema.js
Original file line number Diff line number Diff line change
Expand Up @@ -949,6 +949,31 @@ export default {
required: ['txProcessingTimeLimit'],
additionalProperties: false,
},
stateSync: {
type: 'object',
properties: {
snapshots: {
type: 'object',
properties: {
enabled: {
type: 'boolean',
},
frequency: {
type: 'integer',
minimum: 1,
},
maxLimit: {
type: 'integer',
minimum: 1,
},
},
required: ['enabled', 'frequency', 'maxLimit'],
additionalProperties: false,
},
},
required: ['snapshots'],
additionalProperties: false,
},
},
additionalProperties: false,
required: ['docker', 'logs', 'tokioConsole', 'validatorSet', 'chainLock', 'epochTime', 'metrics', 'grovedbVisualizer', 'proposer'],
Expand Down Expand Up @@ -1208,8 +1233,37 @@ export default {
genesis: {
type: 'object',
},
stateSync: {
type: 'object',
properties: {
enabled: {
type: 'boolean',
},
retries: {
type: 'integer',
minimum: 1,
},
chunkRequestTimeout: {
$ref: '#/definitions/duration',
},
fetchersCount: {
type: 'integer',
minimum: 1,
},
maxConcurrentListSnapshots: {
type: 'integer',
minimum: 1,
},
maxConcurrentSnapshotChunk: {
type: 'integer',
minimum: 1,
},
},
required: ['enabled', 'retries', 'chunkRequestTimeout', 'fetchersCount', 'maxConcurrentListSnapshots', 'maxConcurrentSnapshotChunk'],
additionalProperties: false,
},
},
required: ['mode', 'docker', 'p2p', 'mempool', 'consensus', 'log', 'rpc', 'pprof', 'node', 'moniker', 'genesis', 'metrics'],
required: ['mode', 'docker', 'p2p', 'mempool', 'consensus', 'log', 'rpc', 'pprof', 'node', 'moniker', 'genesis', 'metrics', 'stateSync'],
additionalProperties: false,
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ filter-peers = false
# Example for routed multi-app setup:
# abci = "routed"
# address = "Info:socket:unix:///tmp/socket.1,Info:socket:unix:///tmp/socket.2,CheckTx:socket:unix:///tmp/socket.1,*:socket:unix:///tmp/socket.3"
address = "CheckTx:grpc:drive_abci:26670,*:socket:tcp://drive_abci:26658"
address = "ListSnapshots:grpc:drive_abci:26670,LoadSnapshotChunk:grpc:drive_abci:26670,CheckTx:grpc:drive_abci:26670,*:socket:tcp://drive_abci:26658"
# Transport mechanism to connect to the ABCI application: socket | grpc | routed
transport = "routed"
# Maximum number of simultaneous connections to the ABCI application
Expand All @@ -97,6 +97,10 @@ transport = "routed"
#]
grpc-concurrency = [
{ "check_tx" = {{= it.platform.drive.tenderdash.mempool.maxConcurrentCheckTx }} },
{ "list_snapshots" = {{= it.platform.drive.tenderdash.stateSync.maxConcurrentListSnapshots }} },
{ "load_snapshot_chunk" = {{= it.platform.drive.tenderdash.stateSync.maxConcurrentSnapshotChunk }} },
{ "offer_snapshot" = 1 },
{ "apply_snapshot_chunk" = 1 },
]


Expand Down Expand Up @@ -414,40 +418,37 @@ ttl-num-blocks = {{=it.platform.drive.tenderdash.mempool.ttlNumBlocks}}
# the network to take and serve state machine snapshots. State sync is not attempted if the node
# has any local state (LastBlockHeight > 0). The node will have a truncated block history,
# starting from the height of the snapshot.
enable = false
enable = {{= it.platform.drive.tenderdash.stateSync.enabled.toString() }}

# State sync uses light client verification to verify state. This can be done either through the
# P2P layer or RPC layer. Set this to true to use the P2P layer. If false (default), RPC layer
# will be used.
use-p2p = false
use-p2p = true

# If using RPC, at least two addresses need to be provided. They should be compatible with net.Dial,
# for example: "host.example.com:2125"
rpc-servers = ""

# The hash and height of a trusted block. Must be within the trust-period.
trust-height = 0
trust-hash = ""

# The trust period should be set so that Tendermint can detect and gossip misbehavior before
# it is considered expired. For chains based on the Cosmos SDK, one day less than the unbonding
# period should suffice.
trust-period = "168h0m0s"

# Time to spend discovering snapshots before initiating a restore.
discovery-time = "15s"

# Number of times to retry state sync. When retries are exhausted, the node will
# fall back to the regular block sync. Set to 0 to disable retries. Default is 3.
# Note that in pessimistic case, it will take at least (discovery-time * retries) before
# falling back to block sync.
retries = {{= it.platform.drive.tenderdash.stateSync.retries }}

# Temporary directory for state sync snapshot chunks, defaults to os.TempDir().
# The synchronizer will create a new, randomly named directory within this directory
# and remove it when the sync is complete.
temp-dir = ""

# The timeout duration before re-requesting a chunk, possibly from a different
# peer (default: 15 seconds).
chunk-request-timeout = "15s"
chunk-request-timeout = "{{= it.platform.drive.tenderdash.stateSync.chunkRequestTimeout }}"

# The number of concurrent chunk and block fetchers to run (default: 4).
fetchers = "4"
fetchers = "{{= it.platform.drive.tenderdash.stateSync.fetchersCount }}"

#######################################################
### Consensus Configuration Options ###
Expand Down
1 change: 1 addition & 0 deletions packages/rs-dpp/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ pub mod voting;
pub mod core_types;

pub mod group;
pub mod reduced_platform_state;
pub mod withdrawal;

pub use async_trait;
Expand Down
Loading
Loading