diff --git a/roles/vega_core/defaults/main.yaml b/roles/vega_core/defaults/main.yaml index f45c808..fa7c58d 100644 --- a/roles/vega_core/defaults/main.yaml +++ b/roles/vega_core/defaults/main.yaml @@ -10,6 +10,7 @@ vega_core_download_binary_version: v0.77.6 vega_core_with_data_node: false vega_core_with_block_explorer: false vega_core_validator_node: false +vega_core_vega_monitoring: false vega_core_number_of_snapshots_to_keep: 240 vega_core_pprof_enabled: false vega_core_with_node_init: true diff --git a/roles/vega_core/handlers/main.yaml b/roles/vega_core/handlers/main.yaml index 221d415..22f234b 100644 --- a/roles/vega_core/handlers/main.yaml +++ b/roles/vega_core/handlers/main.yaml @@ -1,15 +1,16 @@ --- - name: Restart vegavisor ansible.builtin.service: - state: "{{ 'restarted' if vega_core_run_network else 'stopped' }}" + state: "restarted" daemon_reload: true + name: vegavisor listen: "Restart vegavisor" when: not ansible_check_mode - name: Restart blockexplorer ansible.builtin.service: - state: "{{ 'restarted' if vega_core_run_network else 'stopped' }}" + state: "restarted" daemon_reload: true name: blockexplorer listen: "Restart blockexplorer" diff --git a/roles/vega_core/tasks/main.yaml b/roles/vega_core/tasks/main.yaml index b51369d..7ac7ee4 100644 --- a/roles/vega_core/tasks/main.yaml +++ b/roles/vega_core/tasks/main.yaml @@ -25,5 +25,5 @@ ansible.builtin.import_tasks: unsafe-reset-all.yaml when: vega_core_with_unsafe_reset_all -- name: Start network - ansible.builtin.import_tasks: start_network.yaml +- name: Restart network + ansible.builtin.import_tasks: restart_network.yaml diff --git a/roles/vega_core/tasks/start_network.yaml b/roles/vega_core/tasks/restart_network.yaml similarity index 96% rename from roles/vega_core/tasks/start_network.yaml rename to roles/vega_core/tasks/restart_network.yaml index 688b0d7..d622fc8 100644 --- a/roles/vega_core/tasks/start_network.yaml +++ b/roles/vega_core/tasks/restart_network.yaml @@ -9,7 +9,7 @@ mode: "0644" register: visor_state notify: - - "Restart vegavisor" + - "Start vegavisor" - name: Decide whether restart explorer(when the vega_core_run_network flag changed) ansible.builtin.copy: diff --git a/roles/vega_core/templates/home/vega/tendermint_home/config/config.toml.j2 b/roles/vega_core/templates/home/vega/tendermint_home/config/config.toml.j2 index a5d0efd..922b281 100644 --- a/roles/vega_core/templates/home/vega/tendermint_home/config/config.toml.j2 +++ b/roles/vega_core/templates/home/vega/tendermint_home/config/config.toml.j2 @@ -435,7 +435,7 @@ peer_query_maj23_sleep_duration = "2s" # considerable amount of disk space. Set to false to ensure ABCI responses are # persisted. ABCI responses are required for /block_results RPC queries, and to # reindex events in the command-line tool. -discard_abci_responses = true +discard_abci_responses = {{'false' if vega_core_vega_monitoring else 'true'}} ####################################################### ### Transaction Indexer Configuration Options ### diff --git a/roles/vega_core/templates/home/vega/vega_home/config/data-node/config.toml.j2 b/roles/vega_core/templates/home/vega/vega_home/config/data-node/config.toml.j2 index 1327474..0af2294 100644 --- a/roles/vega_core/templates/home/vega/vega_home/config/data-node/config.toml.j2 +++ b/roles/vega_core/templates/home/vega/vega_home/config/data-node/config.toml.j2 @@ -1,6 +1,6 @@ -GatewayEnabled = true AutoInitialiseFromNetworkHistory = false ChainID = "{{- vega_core_chain_id -}}" +GatewayEnabled = true MaxMemoryPercent = 33 [Admin] diff --git a/roles/vega_core/templates/home/vega/vega_home/config/node/config.toml.j2 b/roles/vega_core/templates/home/vega/vega_home/config/node/config.toml.j2 index 02d111f..ed0a9b4 100644 --- a/roles/vega_core/templates/home/vega/vega_home/config/node/config.toml.j2 +++ b/roles/vega_core/templates/home/vega/vega_home/config/node/config.toml.j2 @@ -40,6 +40,7 @@ MaxMemoryPercent = {{ 90 if vega_core_validator_node else 33 }} GenesisFile = "" IP = "localhost" Port = 3101 + SpamProtection = false [Blockchain.Null.Replay] Record = false Replay = false @@ -86,11 +87,10 @@ MaxMemoryPercent = {{ 90 if vega_core_validator_node else 33 }} Level = "Info" RPCEndpoint = "{{ vega_core_primary_evm_endpoint if vega_core_validator_node else '' }}" RetryDelay = "15s" - {% if vega_core_secondary_evm_endpoint | default("") != "" %} [[Ethereum.EVMBridgeConfigs]] - RPCEndpoint = "{{- vega_core_secondary_evm_endpoint -}}" ChainID = "{{- vega_core_secondary_evm_chain_id -}}" + RPCEndpoint = "{{- vega_core_secondary_evm_endpoint -}}" {% endif %} {% for evm_config in vega_core_evm_chain_configs %} @@ -105,6 +105,10 @@ MaxMemoryPercent = {{ 90 if vega_core_validator_node else 33 }} LogOrderAmendDebug = false LogOrderCancelDebug = false KeepCheckpointsMax = 20 + [Processor.SnapshotDebug] + DevEnabled = false + CrashAtHeight = 0 + DebugCrashFile = "/tmp/snapshot.json" [Processor.Ratelimit] Requests = 500 PerNBlocks = 10 @@ -162,22 +166,19 @@ MaxMemoryPercent = {{ 90 if vega_core_validator_node else 33 }} [EvtForward] Level = "Debug" RetryRate = "10s" - BlockchainQueueAllowlist = [ -{% if faucet_pubkey|default('') %} + KeepHashesDurationForTestOnlyDoNotChange = "48h0m0s" + BlockchainQueueAllowlist = [{% if faucet_pubkey|default('') %} # faucet "{{ faucet_pubkey }}" -{% endif %} - ] +{% endif %}] [EvtForward.Ethereum] Level = "Debug" - PollEventRetryDuration = "20s" MaxEthereumBlocks = 10000 + PollEventRetryDuration = "20s" + ChainID = "" SkipClientVerification = true - [EvtForward.EthCall] - Level = "Debug" - PollEvery = "20s" - + HeartbeatIntervalForTestOnlyDoNotChange = "1h0m0s" {% if vega_core_secondary_evm_endpoint | default("") != "" %} [[EvtForward.EVMBridges]] @@ -188,12 +189,19 @@ MaxMemoryPercent = {{ 90 if vega_core_validator_node else 33 }} SkipClientVerification = true {% endif %} + [EvtForward.EthCall] + Level = "Debug" + PollEvery = "20s" + HeartbeatIntervalForTestOnlyDoNotChange = "1h0m0s" [Genesis] Level = "Info" [Validators] Level = "Info" + ApproxEthereumBlockTime = "15s" + NodeVoteResendInterval = "10s" + [Banking] Level = "Info" diff --git a/roles/vega_core/templates/lib/systemd/system/vegavisor.service.j2 b/roles/vega_core/templates/lib/systemd/system/vegavisor.service.j2 index 44393c8..e0d514e 100644 --- a/roles/vega_core/templates/lib/systemd/system/vegavisor.service.j2 +++ b/roles/vega_core/templates/lib/systemd/system/vegavisor.service.j2 @@ -3,6 +3,10 @@ Description=vegavisor Documentation=https://github.com/vegaprotocol/vega After=network.target network-online.target Requires=network-online.target +# Configure unit start rate limiting. Units which are started more than burst times within an interval time span are not permitted to start any more. +# Use StartLimitIntervalSec= to configure the checking interval and StartLimitBurst= to configure how many starts per interval are allowed. +StartLimitIntervalSec=60s +StartLimitBurst=3 [Service] User=vega @@ -14,6 +18,10 @@ LimitNPROC=512 PrivateTmp=false ProtectSystem=full AmbientCapabilities=CAP_NET_BIND_SERVICE +# Configures the time to sleep before restarting a service +RestartSec=30s +# Configures whether the service shall be restarted when the service process exits, is killed, or a timeout is reached +Restart=always [Install] WantedBy=multi-user.target