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

feat: improve vega_core role #11

Merged
merged 2 commits into from
Oct 21, 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
1 change: 1 addition & 0 deletions roles/vega_core/defaults/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions roles/vega_core/handlers/main.yaml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
4 changes: 2 additions & 2 deletions roles/vega_core/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 ###
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
GatewayEnabled = true
AutoInitialiseFromNetworkHistory = false
ChainID = "{{- vega_core_chain_id -}}"
GatewayEnabled = true
MaxMemoryPercent = 33

[Admin]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 %}
Expand All @@ -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
Expand Down Expand Up @@ -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]]
Expand All @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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