Skip to content

Commit

Permalink
fix: dog behaviour + ntp synchronization
Browse files Browse the repository at this point in the history
  • Loading branch information
BastienFaivre committed Jan 21, 2025
1 parent 76aaffa commit cb74520
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ benchmark/output/output-*
benchmark/output/*.html
benchmark/config/*
!benchmark/config/README.md
!benchmark/config/ntp.conf
target
20 changes: 20 additions & 0 deletions benchmark/config/ntp.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
driftfile /var/lib/ntpsec/ntp.drift
logfile /var/log/ntp.log

restrict default ignore
restrict -6 default ignore

restrict 127.0.0.1
restrict -6 ::1

server ntp1.hetzner.de iburst
restrict 213.239.239.164 nomodify notrap nopeer noquery
restrict -6 2a01:4f8:0:a0a1::2:1 nomodify notrap nopeer noquery

server ntp2.hetzner.de iburst
restrict 213.239.239.165 nomodify notrap nopeer noquery
restrict -6 2a01:4f8:0:a101::2:3 nomodify notrap nopeer noquery

server ntp3.hetzner.de iburst
restrict 213.239.239.166 nomodify notrap nopeer noquery
restrict -6 2a01:4f8:0:a112::2:2 nomodify notrap nopeer noquery
34 changes: 34 additions & 0 deletions benchmark/playbooks/init.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,37 @@
name: bob
groups: docker
append: true

- name: Install NTP and utils
apt:
name: "{{ item }}"
state: present
with_items:
- ntp
- util-linux-extra
- sntp

- name: Upload NTP configuration
copy:
src: "{{ playbook_dir }}/../config/ntp.conf"
dest: /etc/ntpsec/ntp.conf
owner: root
group: root
mode: 0644

- name: Stop NTP service
service:
name: ntp
state: stopped

- name: Synchronize manually
command: sntp ntp1.hetzner.de

- name: Enable and restart NTP service
service:
name: ntp
enabled: true
state: restarted

- name: Update hardware clock
command: hwclock --systohc
2 changes: 1 addition & 1 deletion dog/src/behaviour.rs
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ where
raw_transaction.from,
self.connected_peers
.keys()
.filter(|&peer| peer != propagation_source)
.filter(|&peer| peer != propagation_source && peer != &raw_transaction.from)
.cloned()
.collect::<Vec<_>>(),
);
Expand Down

0 comments on commit cb74520

Please sign in to comment.