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

chore: add listgovs and logevmaccountstates in sync logs #2872

Merged
merged 4 commits into from
Jul 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
10 changes: 8 additions & 2 deletions ci/sync/main.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ setup_vars() {
REF_LOG_PATH="${BASE_PATH}/${BUCKET}/${REF_LOG_DIR}/${REF_LOG}"

# Commands
DEFID_CMD="${DEFID_BIN} -datadir=${DATADIR} -daemon -debug=accountchange -spv -checkpoints=0 -interrupt-block=$((STOP_BLOCK + 1))"
DEFID_CMD="${DEFID_BIN} -datadir=${DATADIR} -daemon -debug=accountchange -ethdebug=1 -spv -checkpoints=0 -interrupt-block=$((STOP_BLOCK + 1))"
DEFI_CLI_CMD="${DEFI_CLI_BIN} -datadir=${DATADIR}"
FETCH="aria2c -x16 -s16"
GREP="grep"
Expand Down Expand Up @@ -71,6 +71,8 @@ print_info() {
${DEFI_CLI_CMD} listvaults '{\"verbose\": true}' '{\"limit\":1000000}'
${DEFI_CLI_CMD} listtokens '{\"limit\":1000000}'
${DEFI_CLI_CMD} getburninfo
${DEFI_CLI_CMD} listgovs
${DEFI_CLI_CMD} logevmaccountstates

- defi.conf:
$(cat "$CONF_FILE")
Expand All @@ -91,6 +93,10 @@ get_full_log() {
$DEFI_CLI_CMD listtokens '{"limit":1000000}'
echo "-- getburninfo --"
$DEFI_CLI_CMD getburninfo
echo "-- listgovs --"
$DEFI_CLI_CMD listgovs
echo "-- logevmaccountstates --"
$DEFI_CLI_CMD logevmaccountstates
}

rollback_and_log() {
Expand All @@ -105,7 +111,7 @@ rollback_and_log() {

create_pre_sync_rollback_log() {
local DATADIR_ROLLBACK="${DATADIR}-rollback"
local DEFID_CMD="${DEFID_BIN} -datadir=${DATADIR_ROLLBACK} -daemon -debug=accountchange -spv -rpcport=9999 -port=9998 -connect=0 -checkpoints=0 -interrupt-block=$((START_BLOCK + 1))"
local DEFID_CMD="${DEFID_BIN} -datadir=${DATADIR_ROLLBACK} -daemon -debug=accountchange -ethdebug=1 -spv -rpcport=9999 -port=9998 -connect=0 -checkpoints=0 -interrupt-block=$((START_BLOCK + 1))"
local DEFI_CLI_CMD="${DEFI_CLI_BIN} -datadir=${DATADIR_ROLLBACK} -rpcport=9999"
local DEBUG_FILE="${DATADIR_ROLLBACK}/debug.log"

Expand Down
6 changes: 6 additions & 0 deletions src/dfi/rpc_evm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -566,6 +566,12 @@ UniValue logevmaccountstates(const JSONRPCRequest &request) {
}
.Check(request);

auto &consensus = Params().GetConsensus();
const CBlockIndex *tip = ::ChainActive().Tip();
if (tip->nHeight < consensus.DF22MetachainHeight) {
return "";
}

CrossBoundaryResult result;
const auto dumpResults = debug_log_account_states(result);
if (!result.ok) {
Expand Down
Loading