RTradeLtd / TxPB

TemporalX gRPC and Documentation Resources
https://docsx.temporal.cloud
GNU Affero General Public License v3.0
14 stars 1 forks source link

add reference id for idempotent refence counter operations #100

Open xiegeo opened 4 years ago

xiegeo commented 4 years ago

WIP (not stable until one stable server-side and client-side implementation)

The basic design for the protocol, server and client sides to be implemented.

When operating on a reference-counted block store, exact once operation is required to keep the count correct. Although exact once operation is trivial when down locally, it is impossible to guaranty over an unreliable network.

This is worked around by adding a nonce (reference id) to each add operation that can only be removed by calling remove on the same nonce. Not only does this make the operations idempotent (we can safely retry the same operation), it can also prevent users from removing other's user's adds.

For example, the s3x client can implement this nonce by hash(client private key | server public key | bucket name | object name). The use of the private key prevents attackers from guessing the hash (and server key prevents cross-server attacks), while bucket and object names allow repeated counts on the same content. Everything is also generated statically so nothing extra needs to be saved for deletion.

Problems

github-actions[bot] commented 4 years ago

CLA Assistant Lite All Contributors have signed the CLA.

codecov[bot] commented 4 years ago

Codecov Report

Merging #100 (7ee9da6) into master (e4ee4ab) will decrease coverage by 2.48%. The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #100      +/-   ##
==========================================
- Coverage   72.60%   70.12%   -2.47%     
==========================================
  Files           9        9              
  Lines         405      338      -67     
==========================================
- Hits          294      237      -57     
+ Misses         84       74      -10     
  Partials       27       27              
Impacted Files Coverage Δ
go/rep_server_source.go 80.00% <0.00%> (-4.61%) :arrow_down:
go/rep_client.go 53.34% <0.00%> (-3.58%) :arrow_down:
go/rep_addr_info.go 85.00% <0.00%> (-2.75%) :arrow_down:
go/rep_subscription.go 81.42% <0.00%> (-2.28%) :arrow_down:
go/rep_replication.go 87.50% <0.00%> (-1.78%) :arrow_down:
go/rep_proto.go 100.00% <0.00%> (ø)
go/dag_service.go 0.00% <0.00%> (ø)
go/rep_sort_bytes.go 100.00% <0.00%> (ø)
go/xtestutils/testutils.go 100.00% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update e4ee4ab...7ee9da6. Read the comment docs.

RT-nilPointer commented 4 years ago

I have read the CLA Document and I hereby sign the CLA