Deprecate logtrace tool. (#6643)

* Deprecate logtrace tool.

* Eliminate mentions of logtrace in Makefile and scripts.
This commit is contained in:
Eugene Kabanov 2024-10-15 16:54:07 +03:00 committed by GitHub
parent acad28d05b
commit 0ecd2798e8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 24 additions and 1233 deletions

View File

@ -58,7 +58,6 @@ TOOLS_CORE_CUSTOMCOMPILE := \
TOOLS_CORE := \
deposit_contract \
resttest \
logtrace \
mev_mock \
ncli \
ncli_db \
@ -239,7 +238,6 @@ local-testnet-minimal:
--stop-at-epoch 6 \
--disable-htop \
--enable-payload-builder \
--enable-logtrace \
--base-port $$(( $(MINIMAL_TESTNET_BASE_PORT) + EXECUTOR_NUMBER * 400 + 0 )) \
--base-rest-port $$(( $(MINIMAL_TESTNET_BASE_PORT) + EXECUTOR_NUMBER * 400 + 30 )) \
--base-metrics-port $$(( $(MINIMAL_TESTNET_BASE_PORT) + EXECUTOR_NUMBER * 400 + 60 )) \
@ -267,7 +265,6 @@ local-testnet-mainnet:
--deneb-fork-epoch 0 \
--stop-at-epoch 6 \
--disable-htop \
--enable-logtrace \
--base-port $$(( $(MAINNET_TESTNET_BASE_PORT) + EXECUTOR_NUMBER * 400 + 0 )) \
--base-rest-port $$(( $(MAINNET_TESTNET_BASE_PORT) + EXECUTOR_NUMBER * 400 + 30 )) \
--base-metrics-port $$(( $(MAINNET_TESTNET_BASE_PORT) + EXECUTOR_NUMBER * 400 + 60 )) \

File diff suppressed because it is too large Load Diff

View File

@ -8,7 +8,7 @@
{.push raises: [].}
import
std/[json, options],
std/[json, options, times],
chronos, bearssl/rand, chronicles, confutils, stint, json_serialization,
web3, eth/keys, eth/p2p/discoveryv5/random2,
stew/[io2, byteutils], json_rpc/jsonmarshal,
@ -18,8 +18,7 @@ import
../beacon_chain/spec/eth2_merkleization,
../beacon_chain/spec/datatypes/base,
../beacon_chain/spec/eth2_apis/eth2_rest_serialization,
../beacon_chain/validators/keystore_management,
./logtrace
../beacon_chain/validators/keystore_management
from std/os import changeFileExt, fileExists
from std/times import toUnix
@ -39,7 +38,6 @@ type
createTestnetEnr
run
sendDeposits
analyzeLogs
deployDepositContract
sendEth
@ -227,51 +225,6 @@ type
of StartUpCommand.run:
discard
of StartUpCommand.analyzeLogs:
logFiles* {.
desc: "Specifies one or more log files",
abbr: "f",
name: "log-file" .}: seq[string]
simDir* {.
desc: "Specifies path to eth2_network_simulation directory",
defaultValue: "",
name: "sim-dir" .}: string
netDir* {.
desc: "Specifies path to network build directory",
defaultValue: "",
name: "net-dir" .}: string
logDir* {.
desc: "Specifies path with bunch of logs",
defaultValue: "",
name: "log-dir" .}: string
ignoreSerializationErrors* {.
desc: "Ignore serialization errors while parsing log files",
defaultValue: true,
name: "ignore-errors" .}: bool
dumpSerializationErrors* {.
desc: "Dump full serialization errors while parsing log files",
defaultValue: false ,
name: "dump-errors" .}: bool
nodes* {.
desc: "Specifies node names which logs will be used",
name: "nodes" .}: seq[string]
allowedLag* {.
desc: "Allowed latency lag multiplier",
defaultValue: 2.0,
name: "lag" .}: float
constPreset* {.
desc: "The const preset being used"
defaultValue: "mainnet"
name: "const-preset" .}: string
type
PubKeyBytes = DynamicBytes[48, 48]
WithdrawalCredentialsBytes = DynamicBytes[32, 32]
@ -380,6 +333,26 @@ func createDepositContractSnapshot(
depositContractState: merkleizer.toDepositContractState,
blockHeight: blockHeight)
proc writeValue*(writer: var JsonWriter, value: DateTime) {.
raises: [IOError].} =
writer.writeValue($value)
proc readValue*(reader: var JsonReader, value: var DateTime) {.
raises: [IOError, SerializationError].} =
let s = reader.readValue(string)
try:
value = parse(s, "YYYY-MM-dd HH:mm:ss'.'fffzzz", utc())
except CatchableError:
raiseUnexpectedValue(reader, "Invalid date time")
proc writeValue*(writer: var JsonWriter, value: IoErrorCode) {.
raises: [IOError].} =
writer.writeValue(distinctBase value)
proc readValue*(reader: var JsonReader, value: var IoErrorCode) {.
raises: [IOError, SerializationError].} =
IoErrorCode reader.readValue(distinctBase IoErrorCode)
proc createEnr(rng: var HmacDrbgContext,
dataDir: string,
netKeyFile: string,
@ -725,26 +698,6 @@ when isMainModule:
of StartUpCommand.run:
discard
of StartUpCommand.analyzeLogs:
try:
logtrace.run(LogTraceConf(
cmd: logtrace.StartUpCommand.localSimChecks,
logFiles: conf.logFiles,
simDir: conf.simDir,
netDir: conf.netDir,
logDir: conf.logDir,
ignoreSerializationErrors: conf.ignoreSerializationErrors,
dumpSerializationErrors: conf.dumpSerializationErrors,
nodes: conf.nodes,
allowedLag: conf.allowedLag,
constPreset: conf.constPreset
))
except CatchableError as err:
fatal "Unexpected error in logtrace", err = err.msg
except Exception as exc:
# TODO: Investigate where is this coming from?
fatal "Unexpected exception in logtrace", err = exc.msg
of StartUpCommand.generateDeposits:
# This is handled above before the case statement
discard

View File

@ -52,7 +52,7 @@ CURL_BINARY="$(command -v curl)" || { echo "Curl not installed. Aborting."; exit
JQ_BINARY="$(command -v jq)" || { echo "jq not installed. Aborting."; exit 1; }
OPTS="ht:n:d:g"
LONGOPTS="help,preset:,nodes:,data-dir:,remote-validators-count:,threshold:,signer-nodes:,signer-type:,with-ganache,stop-at-epoch:,disable-htop,use-vc:,disable-vc,enable-payload-builder,enable-logtrace,log-level:,base-port:,base-rest-port:,base-metrics-port:,base-vc-metrics-port:,base-vc-keymanager-port:,base-remote-signer-port:,base-remote-signer-metrics-port:,base-el-net-port:,base-el-rpc-port:,base-el-ws-port:,base-el-auth-rpc-port:,el-port-offset:,reuse-existing-data-dir,reuse-binaries,timeout:,kill-old-processes,eth2-docker-image:,lighthouse-vc-nodes:,run-geth,dl-geth,dl-nimbus-eth1,dl-nimbus-eth2,light-clients:,run-nimbus-eth1,verbose,deneb-fork-epoch:,electra-fork-epoch:"
LONGOPTS="help,preset:,nodes:,data-dir:,remote-validators-count:,threshold:,signer-nodes:,signer-type:,with-ganache,stop-at-epoch:,disable-htop,use-vc:,disable-vc,enable-payload-builder,log-level:,base-port:,base-rest-port:,base-metrics-port:,base-vc-metrics-port:,base-vc-keymanager-port:,base-remote-signer-port:,base-remote-signer-metrics-port:,base-el-net-port:,base-el-rpc-port:,base-el-ws-port:,base-el-auth-rpc-port:,el-port-offset:,reuse-existing-data-dir,reuse-binaries,timeout:,kill-old-processes,eth2-docker-image:,lighthouse-vc-nodes:,run-geth,dl-geth,dl-nimbus-eth1,dl-nimbus-eth2,light-clients:,run-nimbus-eth1,verbose,deneb-fork-epoch:,electra-fork-epoch:"
# default values
BINARIES=""
@ -82,7 +82,6 @@ EL_PORT_OFFSET="10"
: ${NIMFLAGS:=""}
: ${MIN_DEPOSIT_SENDING_DELAY:=1}
: ${MAX_DEPOSIT_SENDING_DELAY:=25}
ENABLE_LOGTRACE="0"
STOP_AT_EPOCH=9999999
STOP_AT_EPOCH_FLAG=""
TIMEOUT_DURATION="0"
@ -149,7 +148,6 @@ CI run: $(basename "$0") --disable-htop -- --verify-finalization
and validator clients, with all beacon nodes being paired up
with a corresponding validator client)
--lighthouse-vc-nodes number of Lighthouse VC nodes (assigned before Nimbus VC nodes, default: ${LIGHTHOUSE_VC_NODES})
--enable-logtrace display logtrace analysis
--log-level set the log level (default: "${LOG_LEVEL}")
--reuse-existing-data-dir instead of deleting and recreating the data dir, keep it and reuse everything we can from it
--reuse-binaries don't (re)build the binaries we need and don't delete them at the end (speeds up testing)
@ -241,10 +239,6 @@ while true; do
USE_PAYLOAD_BUILDER="true"
shift
;;
--enable-logtrace)
ENABLE_LOGTRACE="1"
shift
;;
--log-level)
LOG_LEVEL="$2"
shift 2
@ -961,12 +955,6 @@ dump_logs() {
done
}
dump_logtrace() {
if [[ "$ENABLE_LOGTRACE" == "1" ]]; then
find "${DATA_DIR}/logs" -maxdepth 1 -type f -regex 'nimbus_beacon_node[0-9]+.jsonl' | sed -e"s/${DATA_DIR}\//--nodes=/" | sort | xargs ./build/ncli_testnet analyzeLogs --log-dir="${DATA_DIR}" --const-preset=${CONST_PRESET} || true
fi
}
NODES_WITH_VALIDATORS=${NODES_WITH_VALIDATORS:-$NUM_NODES}
SYSTEM_VALIDATORS=$(( TOTAL_VALIDATORS - USER_VALIDATORS ))
VALIDATORS_PER_NODE=$(( SYSTEM_VALIDATORS / NODES_WITH_VALIDATORS ))
@ -1287,7 +1275,6 @@ fi
if [[ "$BG_JOBS" != "$NUM_JOBS" ]]; then
echo "$(( NUM_JOBS - BG_JOBS )) nimbus_beacon_node/nimbus_validator_client/nimbus_light_client instance(s) exited early. Aborting."
dump_logs
dump_logtrace
exit 1
fi
@ -1306,7 +1293,6 @@ else
if [[ "$FAILED" != "0" ]]; then
echo "${FAILED} child processes had non-zero exit codes (or exited early)."
dump_logs
dump_logtrace
if [[ "${TIMEOUT_DURATION}" != "0" ]]; then
if uname | grep -qiE "mingw|msys"; then
taskkill //F //PID "${WATCHER_PID}"
@ -1318,8 +1304,6 @@ else
fi
fi
dump_logtrace
if [[ "${TIMEOUT_DURATION}" != "0" ]]; then
if uname | grep -qiE "mingw|msys"; then
taskkill //F //PID "${WATCHER_PID}"