citahub / cita

A high performance blockchain kernel for enterprise users.
https://www.citahub.com/
Apache License 2.0
1.31k stars 210 forks source link

Add timestamp check #919

Closed Pencil-Yao closed 4 years ago

Pencil-Yao commented 4 years ago
Pencil-Yao commented 4 years ago

How to use docker-compose test

test command

cd target/install
docker-compose -f ../../docker/sample/docker-compose-check.yml --project-directory . up

test report

node3 调快10s(MODIFY_TIME=10000)
2020-03-17 - 03:10:12 | cita_bft::core::cita - 1043  | WARN  - proc_proposal Bft { h: 36, r: 0, s: 1 } timestamp error h: 36, r: 0, current timestamp 1584414612427, propoal timestamp 1584414621678, pre-block timestamp 1584414609378, upper limit 3000
2020-03-17 - 03:10:12 | cita_bft::core::cita - 1043  | WARN  - proc_proposal Bft { h: 36, r: 0, s: 1 } timestamp error h: 36, r: 0, current timestamp 1584414612427, propoal timestamp 1584414621678, pre-block timestamp 1584414609378, upper limit 3000

propoal - current = 9251

node3 调慢4s((MODIFY_TIME=-4000))
2020-03-17 - 03:24:12 | cita_bft::core::cita - 1043  | WARN  - proc_proposal Bft { h: 58, r: 0, s: 1 } timestamp error h: 58, r: 0, current timestamp 1584415452198, propoal timestamp 1584415447380, pre-block timestamp 1584415449581, upper limit 3000
2020-03-17 - 03:24:12 | cita_bft::core::cita - 1043  | WARN  - proc_proposal Bft { h: 58, r: 0, s: 1 } timestamp error h: 58, r: 0, current timestamp 1584415452198, propoal timestamp 1584415447380, pre-block timestamp 1584415449581, upper limit 3000

propoal - pre-block = -2201

node3 调快2s(MODIFY_TIME=2000)
2020-03-17 - 03:29:57 | cita_bft::core::cita - 1051  | WARN  - proc_proposal Bft { h: 29, r: 0, s: 1 } timestamp warning h: 29, r: 0, current timestamp 1584415797808, propoal timestamp 1584415799795, proposer b9af3d1cdbb79f5d314fa2539e1177a4e706f5f8

发送warning以及proposer地址