Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Duniter Datapod
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
nodes
Duniter Datapod
Commits
9c80db1d
Commit
9c80db1d
authored
6 months ago
by
Hugo Trentesaux
Browse files
Options
Downloads
Patches
Plain Diff
note about profile deletion
parent
8397b73a
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/indexer/database.ts
+8
-2
8 additions, 2 deletions
src/indexer/database.ts
with
8 additions
and
2 deletions
src/indexer/database.ts
+
8
−
2
View file @
9c80db1d
...
@@ -218,8 +218,14 @@ export async function handleInsertRequest(irCID: CID, ir: IndexRequest): Promise
...
@@ -218,8 +218,14 @@ export async function handleInsertRequest(irCID: CID, ir: IndexRequest): Promise
// delete cesium plus profile
// delete cesium plus profile
case
CESIUM_PLUS_PROFILE_DELETE
:
case
CESIUM_PLUS_PROFILE_DELETE
:
// FIXME if delete instruction is received from past, this should be ignored
// NOTE: if delete instruction is received from past, an existing profile can be deleted
// i.e.: database should keep track of deleted profiles with a timestamp to allow items to be inserted in any order
// Cases when it can occur:
// - a profile is deleted, then re-created, then an attacker submits again the deletion message within the MAX_IR_TIME_DIFF delay
// - a node is synchronizing, gets profile creation from pubsub, and then gets old deletion request from peer
// NOTE: the same can happen if create instruction if received from the past
// We could prevent it by:
// - keeping track of deleted profiles with a timestamp
// Not implemented yet because these cases have low probability, but this should be implemented in the future.
await
client
.
query
(
`DELETE FROM profiles WHERE pubkey = $1;`
,
[
ir
.
pubkey
])
await
client
.
query
(
`DELETE FROM profiles WHERE pubkey = $1;`
,
[
ir
.
pubkey
])
return
return
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment