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

FullnodeConfigBuilder always create a new full node config, even when it shouldn't #21149

Open
bbarwik opened this issue Feb 9, 2025 · 2 comments
Assignees
Labels
cli Command line tools

Comments

@bbarwik
Copy link

bbarwik commented Feb 9, 2025

Function build in node_config_builder.rs is always generating new validator_config, it's this line:

let validator_config = ValidatorGenesisConfigBuilder::new().build(rng);

Because of this, whenever I run existing node with sui start the new full node with empty database is created and all transactions are being rerun from scratch. It makes it very painful to use sui start with persistent database.

Here's the script I'm using to setup persistent local node, it can reproduce the issue. Whenever you run it it will always create new database in full_node_db because of this issue.

#!/bin/bash

# Check if SUI_WORK_DIR is set
if [ -z "$SUI_WORK_DIR" ]; then
    echo "Error: SUI_WORK_DIR environment variable is not set"
    exit 1
fi

# Create directory if it doesn't exist
mkdir -p "$SUI_WORK_DIR"

# Generate genesis configuration if directory is empty
if [ -z "$(ls -A $SUI_WORK_DIR)" ]; then
    echo "Generating genesis configuration..."
    sui genesis -f --with-faucet --epoch-duration-ms 60000 --working-dir "$SUI_WORK_DIR"
fi

# Set max memory limit to 32GB
echo "Setting max memory limit to 32GB"
ulimit -v 33554432

# if sui.log exist then move it to sui.timestamp.log
if [ -f "./sui.log" ]; then
    echo "Moving sui.log to sui.$(date +%s).log"
    mkdir -p logs
    mv "./sui.log" "./logs/sui.$(date +%s).log"
fi

sui start --network.config "$SUI_WORK_DIR" --with-faucet 2>&1 | tee "./sui.log"
Copy link
Contributor

github-actions bot commented Feb 9, 2025

Thank you for opening this issue, a team member will review it shortly. Until then, please do not interact with any users that claim to be from Sui support and do not click on any links!

@stefan-mysten stefan-mysten self-assigned this Feb 10, 2025
@stefan-mysten stefan-mysten added the cli Command line tools label Feb 10, 2025
@stefan-mysten
Copy link
Contributor

Thanks @bbarwik, I'll try to have a look next week. Please ping me if I don't get back!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cli Command line tools
Projects
None yet
Development

No branches or pull requests

2 participants