Skip to content

light/availability: reevaluate light availability success condition #2780

Closed
@walldiss

Description

@walldiss

Implementation ideas

Lets evaluate light sampling algorithm for withholding attack case, since there seems to be a confusion how this attack should be simulated. #2697 (comment)

  1. Initial simulation script by @distractedm1nd assumes, that k amount of shares are selected for sampling. If any of selected shares are not available, light node will only those, that it was able to sample from initial selection.

  2. Another simulation made by me assumes, that light nodes stores k amount of shares, regardless if initial selection. In other words it tries to sample new shares until k amount is reached.

Current implementation of light availability is different and do not satisfy either of assumtuions. It select random 16 shares from eds and tries to sample them. It will store all successful samples to blockstore, but If any of samples fails, whole sampling operation will fail. Having some samples unavailable have a high probability in withholding attack case. Failed sampling operation causes to DASer to retry sampling attempt for the same height. New attempt will select new set of 16 random shares regardless of previous results. All successfully sampled shares from subsequent calls will also be stored as an addition to previous attempts. Since subsequent attempts will still have probabilistic nature of success/failures and can result in multiple retries. And on every attempt successfully amount of sampled shares will likely grow beyond initially preset sampling limit k.

Lets check an example. For sake for simplicity some values are lowered from our defaults:

  • sampling amount (k) is set to 4
  • eds size 4 (16 shares)
  • assume shares with index >9 are withheld
Attempt 1 (fail): 
  selected to be sampled: 3,6,8,12
  sampled: 3,6,8
  failed: 12
  in store:  3,6,8 (3)
  
Attempt 2 (fail): 
  selected to be sampled: 1,4,3,15
  sampled: 1,4,3,15
  failed: 15
  in store:  1,3,4,6,8 (5)
  
Attempt 3 (success): 
  selected to be sampled: 2,3,6,9
  sampled: 2,3,6,9
  failed: 
  in store:  1,2,3,4,6,8,9 (7)

In the example you can see, how more than k samples are stored by light node.

Lets evaluate how many shares needs to be sampled in case of withholding attack and modify light availability accordingly if needed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions