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

[BE1][BE2] Add timestamp to rumors #1931

Merged
merged 6 commits into from
Jun 14, 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
2 changes: 1 addition & 1 deletion docs/embedme.sh
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,4 @@ BEGIN {
}

END {
}
}
49 changes: 37 additions & 12 deletions docs/protocol.md
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,9 @@ and its arguments (`params`).
},
{
"$ref": "method/rumor_state.json"
},
{
"$ref": "method/paged_catchup.json"
}
],

Expand Down Expand Up @@ -235,15 +238,15 @@ Notification
```json5
// ../protocol/examples/query/greet_server/greet_server.json

{
"jsonrpc": "2.0",
"method": "greet_server",
"params": {
"public_key": "J9fBzJV70Jk5c-i3277Uq4CmeL4t53WDfUghaK0HpeM=",
"client_address": "wss://popdemo.dedis.ch:9000/client",
"server_address": "wss://popdemo.dedis.ch:9001/server"
}
}
{
"jsonrpc": "2.0",
"method": "greet_server",
"params": {
"public_key": "J9fBzJV70Jk5c-i3277Uq4CmeL4t53WDfUghaK0HpeM=",
"client_address": "wss://popdemo.dedis.ch:9000/client",
"server_address": "wss://popdemo.dedis.ch:9001/server"
}
}

```

Expand Down Expand Up @@ -982,6 +985,12 @@ RPC
"params": {
"sender_id": "J9fBzJV70Jk5c-i3277Uq4CmeL4t53WDfUghaK0HpeM=",
"rumor_id": 1,
"timestamp" : {
"J9fBzJV70Jk5c-i3277Uq4CmeL4t53WDfUghaK0HpeM=": 3,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you change "J9fBzJV70Jk5c-i3277Uq4CmeL4t53WDfUghaK0HpeM=": 3, to "J9fBzJV70Jk5c-i3277Uq4CmeL4t53WDfUghaK0HpeM=": 1, same for the other place

"RZOPi59Iy5gkpS2mkpfQJNl44HKc2jVbF0iTGm0RvfU=": 5,
"CfG2ByLhtLJH--T2BL9hZ6eGm11tpkE-5KuvysSCY0I=": 1,
"r8cG9HyJ1FGBke_5IblCdH19mvy39MvLFSArVmY3FpY=": 10
},
"messages": {
"/root/nLghr9_P406lfkMjaNWqyohLxOiGlQee8zad4qAfj18=/social/8qlv4aUT5-tBodKp4RszY284CFYVaoDZK6XKiw9isSw=": [
{
Expand Down Expand Up @@ -1072,6 +1081,10 @@ RPC
"description": "[Integer] ID of the rumor",
"type": "integer"
},
"timestamp" : {
"description": "Rumor state in which this message has been sent",
"$ref": "./rumor_state.json"
},
"messages": {
"description": "Key-value of channels and messages per channel",
"type": "object",
Expand All @@ -1081,7 +1094,8 @@ RPC
"required": [
"sender_id",
"rumor_id",
"messages"
"messages",
"timestamp"
]
}

Expand Down Expand Up @@ -1127,6 +1141,12 @@ Response in case of success
{
"sender_id": "J9fBzJV70Jk5c-i3277Uq4CmeL4t53WDfUghaK0HpeM=",
"rumor_id": 1,
"timestamp" : {
"J9fBzJV70Jk5c-i3277Uq4CmeL4t53WDfUghaK0HpeM=": 3,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same

"RZOPi59Iy5gkpS2mkpfQJNl44HKc2jVbF0iTGm0RvfU=": 5,
"CfG2ByLhtLJH--T2BL9hZ6eGm11tpkE-5KuvysSCY0I=": 1,
"r8cG9HyJ1FGBke_5IblCdH19mvy39MvLFSArVmY3FpY=": 9
},
"messages": {
"/root/nLghr9_P406lfkMjaNWqyohLxOiGlQee8zad4qAfj18=/social/8qlv4aUT5-tBodKp4RszY284CFYVaoDZK6XKiw9isSw=": [
{
Expand All @@ -1142,6 +1162,12 @@ Response in case of success
{
"sender_id": "J9fBzJV70Jk5c-i3277Uq4CmeL4t53WDfUghaK0HpeM=",
"rumor_id": 2,
"timestamp" : {
"J9fBzJV70Jk5c-i3277Uq4CmeL4t53WDfUghaK0HpeM=": 3,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same but change to 2

"RZOPi59Iy5gkpS2mkpfQJNl44HKc2jVbF0iTGm0RvfU=": 5,
"CfG2ByLhtLJH--T2BL9hZ6eGm11tpkE-5KuvysSCY0I=": 1,
"r8cG9HyJ1FGBke_5IblCdH19mvy39MvLFSArVmY3FpY=": 10
},
"messages": {
"/root/nLghr9_P406lfkMjaNWqyohLxOiGlQee8zad4qAfj18=/HnXDyvSSron676Icmvcjk5zXvGLkPJ1fVOaWOxItzBE=": [
{
Expand Down Expand Up @@ -1273,8 +1299,7 @@ Response (in case of success)
"signature": "ONylxgHA9cbsB_lwdfbn3iyzRd4aTpJhBMnvEKhmJF_niE_pUHdmjxDXjEwFyvo5WiH1NZXWyXG27SYEpkasCA==",
"message_id": "2mAAevx61TZJi4groVGqqkeLEQq0e-qM6PGmTWuShyY=",
"witness_signatures": []
},
// ...9 other messages
}
]
}

Expand Down
12 changes: 12 additions & 0 deletions protocol/examples/answer/rumor_state_ans.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@
{
"sender_id": "J9fBzJV70Jk5c-i3277Uq4CmeL4t53WDfUghaK0HpeM=",
"rumor_id": 1,
"timestamp" : {
"J9fBzJV70Jk5c-i3277Uq4CmeL4t53WDfUghaK0HpeM=": 1,
"RZOPi59Iy5gkpS2mkpfQJNl44HKc2jVbF0iTGm0RvfU=": 5,
"CfG2ByLhtLJH--T2BL9hZ6eGm11tpkE-5KuvysSCY0I=": 1,
"r8cG9HyJ1FGBke_5IblCdH19mvy39MvLFSArVmY3FpY=": 9
},
"messages": {
"/root/nLghr9_P406lfkMjaNWqyohLxOiGlQee8zad4qAfj18=/social/8qlv4aUT5-tBodKp4RszY284CFYVaoDZK6XKiw9isSw=": [
{
Expand All @@ -20,6 +26,12 @@
{
"sender_id": "J9fBzJV70Jk5c-i3277Uq4CmeL4t53WDfUghaK0HpeM=",
"rumor_id": 2,
"timestamp" : {
"J9fBzJV70Jk5c-i3277Uq4CmeL4t53WDfUghaK0HpeM=": 2,
"RZOPi59Iy5gkpS2mkpfQJNl44HKc2jVbF0iTGm0RvfU=": 5,
"CfG2ByLhtLJH--T2BL9hZ6eGm11tpkE-5KuvysSCY0I=": 1,
"r8cG9HyJ1FGBke_5IblCdH19mvy39MvLFSArVmY3FpY=": 10
},
"messages": {
"/root/nLghr9_P406lfkMjaNWqyohLxOiGlQee8zad4qAfj18=/HnXDyvSSron676Icmvcjk5zXvGLkPJ1fVOaWOxItzBE=": [
{
Expand Down
6 changes: 6 additions & 0 deletions protocol/examples/query/rumor/rumor.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@
"params": {
"sender_id": "J9fBzJV70Jk5c-i3277Uq4CmeL4t53WDfUghaK0HpeM=",
"rumor_id": 1,
"timestamp" : {
"J9fBzJV70Jk5c-i3277Uq4CmeL4t53WDfUghaK0HpeM=": 1,
"RZOPi59Iy5gkpS2mkpfQJNl44HKc2jVbF0iTGm0RvfU=": 5,
"CfG2ByLhtLJH--T2BL9hZ6eGm11tpkE-5KuvysSCY0I=": 1,
"r8cG9HyJ1FGBke_5IblCdH19mvy39MvLFSArVmY3FpY=": 10
},
"messages": {
"/root/nLghr9_P406lfkMjaNWqyohLxOiGlQee8zad4qAfj18=/social/8qlv4aUT5-tBodKp4RszY284CFYVaoDZK6XKiw9isSw=": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@
"params": {
"sender_id": "J9fBzJV70Jk5c-i3277Uq4CmeL4t53WDfUghaK0HpeM=",
"rumor_id": 1,
"timestamp" : {
"J9fBzJV70Jk5c-i3277Uq4CmeL4t53WDfUghaK0HpeM=": 1,
"RZOPi59Iy5gkpS2mkpfQJNl44HKc2jVbF0iTGm0RvfU=": 5,
"CfG2ByLhtLJH--T2BL9hZ6eGm11tpkE-5KuvysSCY0I=": 1,
"r8cG9HyJ1FGBke_5IblCdH19mvy39MvLFSArVmY3FpY=": 10
},
"messages": {
"/root/nLghr9_P406lfkMjaNWqyohLxOiGlQee8zad4qAfj18=/social/8qlv4aUT5-tBodKp4RszY284CFYVaoDZK6XKiw9isSw=": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@
"params": {
"sender_id": "J9fBzJV70Jk5c-i3277Uq4CmeL4t53WDfUghaK0HpeM=",
"rumor_id": 1,
"timestamp" : {
"J9fBzJV70Jk5c-i3277Uq4CmeL4t53WDfUghaK0HpeM=": 1,
"RZOPi59Iy5gkpS2mkpfQJNl44HKc2jVbF0iTGm0RvfU=": 5,
"CfG2ByLhtLJH--T2BL9hZ6eGm11tpkE-5KuvysSCY0I=": 1,
"r8cG9HyJ1FGBke_5IblCdH19mvy39MvLFSArVmY3FpY=": 10
},
"messages": {
"": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@
"method": "rumor",
"params": {
"sender_id": "J9fBzJV70Jk5c-i3277Uq4CmeL4t53WDfUghaK0HpeM=",
"rumor_id": 1
"rumor_id": 1,
"timestamp" : {
"J9fBzJV70Jk5c-i3277Uq4CmeL4t53WDfUghaK0HpeM=": 1,
"RZOPi59Iy5gkpS2mkpfQJNl44HKc2jVbF0iTGm0RvfU=": 5,
"CfG2ByLhtLJH--T2BL9hZ6eGm11tpkE-5KuvysSCY0I=": 1,
"r8cG9HyJ1FGBke_5IblCdH19mvy39MvLFSArVmY3FpY=": 10
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@
"method": "rumor",
"params": {
"sender_id": "J9fBzJV70Jk5c-i3277Uq4CmeL4t53WDfUghaK0HpeM=",
"timestamp" : {
"J9fBzJV70Jk5c-i3277Uq4CmeL4t53WDfUghaK0HpeM=": 1,
"RZOPi59Iy5gkpS2mkpfQJNl44HKc2jVbF0iTGm0RvfU=": 5,
"CfG2ByLhtLJH--T2BL9hZ6eGm11tpkE-5KuvysSCY0I=": 1,
"r8cG9HyJ1FGBke_5IblCdH19mvy39MvLFSArVmY3FpY=": 10
},
"messages": {
"/root/nLghr9_P406lfkMjaNWqyohLxOiGlQee8zad4qAfj18=/social/8qlv4aUT5-tBodKp4RszY284CFYVaoDZK6XKiw9isSw=": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@
"method": "rumor",
"params": {
"rumor_id": 1,
"timestamp" : {
"J9fBzJV70Jk5c-i3277Uq4CmeL4t53WDfUghaK0HpeM=": 1,
"RZOPi59Iy5gkpS2mkpfQJNl44HKc2jVbF0iTGm0RvfU=": 5,
"CfG2ByLhtLJH--T2BL9hZ6eGm11tpkE-5KuvysSCY0I=": 1,
"r8cG9HyJ1FGBke_5IblCdH19mvy39MvLFSArVmY3FpY=": 10
},
"messages": {
"/root/nLghr9_P406lfkMjaNWqyohLxOiGlQee8zad4qAfj18=/social/8qlv4aUT5-tBodKp4RszY284CFYVaoDZK6XKiw9isSw=": [
{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"jsonrpc": "2.0",
"id": 4,
"method": "rumor",
"params": {
"rumor_id": 1,
"messages": {
"/root/nLghr9_P406lfkMjaNWqyohLxOiGlQee8zad4qAfj18=/social/8qlv4aUT5-tBodKp4RszY284CFYVaoDZK6XKiw9isSw=": [
{
"data": "eyJvYmplY3QiOiJyb2xsX2NhbGwiLCJhY3Rpb24iOiJjcmVhdGUiLCJuYW1lIjoiUm9sbCBDYWxsIiwiY3JlYXRpb24iOjE2MzMwMzYxMjAsInByb3Bvc2VkX3N0YXJ0IjoxNjMzMDM2Mzg4LCJwcm9wb3NlZF9lbmQiOjE2MzMwMzk2ODgsImxvY2F0aW9uIjoiRVBGTCIsImlkIjoial9kSmhZYnpubXZNYnVMc0ZNQ2dzYlB5YjJ6Nm1vZ2VtSmFON1NWaHVVTT0ifQ==",
"sender": "J9fBzJV70Jk5c-i3277Uq4CmeL4t53WDfUghaK0HpeM=",
"signature": "FFqBXhZSaKvBnTvrDNIeEYMpFKI5oIa5SAewquxIBHTTEyTIDnUgmvkwgccV9NrujPwDnRt1f4CIEqzXqhbjCw==",
"message_id": "DCBX48EuNO6q-Sr42ONqsj7opKiNeXyRzrjqTbZ_aMI=",
"witness_signatures": []
}
],
"/root/nLghr9_P406lfkMjaNWqyohLxOiGlQee8zad4qAfj18=/HnXDyvSSron676Icmvcjk5zXvGLkPJ1fVOaWOxItzBE=": [
{
"data": "eyJvYmplY3QiOiJyb2xsX2NhbGwiLCJhY3Rpb24iOiJjcmVhdGUiLCJuYW1lIjoiUm9sbCBDYWxsIiwiY3JlYXRpb24iOjE2MzMwMzYxMjAsInByb3Bvc2VkX3N0YXJ0IjoxNjMzMDM2Mzg4LCJwcm9wb3NlZF9lbmQiOjE2MzMwMzk2ODgsImxvY2F0aW9uIjoiRVBGTCIsImlkIjoial9kSmhZYnpubXZNYnVMc0ZNQ2dzYlB5YjJ6Nm1vZ2VtSmFON1NWaHVVTT0ifQ==",
"sender": "J9fBzJV70Jk5c-i3277Uq4CmeL4t53WDfUghaK0HpeM=",
"signature": "FFqBXhZSaKvBnTvrDNIeEYMpFKI5oIa5SAewquxIBHTTEyTIDnUgmvkwgccV9NrujPwDnRt1f4CIEqzXqhbjCw==",
"message_id": "z6SbjJ0Hw36k8L09-GVRq4PNmi06yQX4e8aZRSbUDwc=",
"witness_signatures": []
},
{
"data": "eyJvYmplY3QiOiJyb2xsX2NhbGwiLCJhY3Rpb24iOiJjcmVhdGUiLCJuYW1lIjoiUm9sbCBDYWxsIiwiY3JlYXRpb24iOjE2MzMwMzYxMjAsInByb3Bvc2VkX3N0YXJ0IjoxNjMzMDM2Mzg4LCJwcm9wb3NlZF9lbmQiOjE2MzMwMzk2ODgsImxvY2F0aW9uIjoiRVBGTCIsImlkIjoial9kSmhZYnpubXZNYnVMc0ZNQ2dzYlB5YjJ6Nm1vZ2VtSmFON1NWaHVVTT0ifQ==",
"sender": "J9fBzJV70Jk5c-i3277Uq4CmeL4t53WDfUghaK0HpeM=",
"signature": "FFqBXhZSaKvBnTvrDNIeEYMpFKI5oIa5SAewquxIBHTTEyTIDnUgmvkwgccV9NrujPwDnRt1f4CIEqzXqhbjCw==",
"message_id": "txbTmVMwCDkZdoaAiEYfAKozVizZzkeMkeOlzq5qMlg=",
"witness_signatures": []
}
]
}
}
}
7 changes: 6 additions & 1 deletion protocol/query/method/object/rumor.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
"description": "[Integer] ID of the rumor",
"type": "integer"
},
"timestamp" : {
"description": "Rumor state in which this message has been sent",
"$ref": "./rumor_state.json"
},
"messages": {
"description": "Key-value of channels and messages per channel",
"type": "object",
Expand All @@ -24,6 +28,7 @@
"required": [
"sender_id",
"rumor_id",
"messages"
"messages",
"timestamp"
]
}
Loading