HackMD
    • Sharing Link copied
    • /edit
    • View mode
      • Edit mode
      • View mode
      • Book mode
      • Slide mode
      Edit mode View mode Book mode Slide mode
    • Note Permission
    • Read
      • Only me
      • Signed-in users
      • Everyone
      Only me Signed-in users Everyone
    • Write
      • Only me
      • Signed-in users
      • Everyone
      Only me Signed-in users Everyone
    • More (Comment, Invitee)
    • Publishing
    • Commenting Enable
      Disabled Forbidden Owners Signed-in users Everyone
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Invitee
    • No invitee
    • Options
    • Versions and GitHub Sync
    • Transfer ownership
    • Delete this note
    • Template
    • Save as template
    • Insert from template
    • Export
    • Google Drive Export to Google Drive
    • Gist
    • Import
    • Google Drive Import from Google Drive
    • Gist
    • Clipboard
    • Download
    • Markdown
    • HTML
    • Raw HTML
Menu Sharing Help
Menu
Options
Versions and GitHub Sync Transfer ownership Delete this note
Export
Google Drive Export to Google Drive Gist
Import
Google Drive Import from Google Drive Gist Clipboard
Download
Markdown HTML Raw HTML
Back
Sharing
Sharing Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
More (Comment, Invitee)
Publishing
More (Comment, Invitee)
Commenting Enable
Disabled Forbidden Owners Signed-in users Everyone
Permission
Owners
  • Forbidden
  • Owners
  • Signed-in users
  • Everyone
Invitee
No invitee
   owned this note    owned this note      
Published Linked with GitHub
Like BookmarkBookmarked
Subscribed
  • Any changes
    Be notified of any changes
  • Mention me
    Be notified of mention me
  • Unsubscribe
Subscribe
# Relay based data availability sampling * All relays will act as sample providers * They are already strongly incentivised to provide samples for their own blocks, as they want them to be deemed available * As relays are run as public services, it is natural to add data availability sampling for all blobs to them * Some relays can run a full 2d polynomial interpolation algorithm, which would guarantee that data can even be reconstructed if only 1/4 of samples are available Let's say we have $n$ samples from a [2d Danksharding construction](https://notes.ethereum.org/ReasmW86SuKqC2FaX83T1g), of which each node samples $s$ samples, of which $q$ have to be available (example: $q=s=75$). Each relay runs an RPC service which provides two endpoints: * `samplesAvailable`: * Inputs *blockHeight*, *blockHash*, *sampleIds: List[sampleId]* * Returns a bitfield that indicates which of these samples are available for this service * `getSamples`: * Inputs *blockHeight*, *blockHash*, *sampleIds: List[sampleId]* * Returns the samples * `sendSamples`: * Inputs *List[sample]* * Allows any node to upload a list of samples for the current block * `sendBlockAndSamples` * inputs *block*, *List[samples]* * Allows other relays to upload a list of samples to this relay. Block must be a valid signed block for the current height. Can send all or a subset of samples. The block header is extended with four fields: * `IPv4` address of relay sample endpoint * `IPv6` address of relay sample endpoint * `DNS` of relay sample endpoint * `port` of relay sample endpoint This sample endpoint is called the block-provided endpoint. ## Sample endpoint Each node maintains a list of reliable sample endpoints. These are input by the users (defaults can be given by clients), but continuously scored by the node. It queries the 5-10 endpoints with the highest reputation, plus the block-provided endpoint for each block. * Sample endpoints are scored according to the samples they provide. For each sample, a reasonable weight is $1/r$, where $r$ is the number of sample endpoints that have advertised the samples through `samplesAvailable`. ## Sampling Upon receipt of a block, each node selects $s$ random samples to query. It then queries its current list of sample endpoints, plus the block-provided endpoint, using the `samplesAvailable` endpoint for all its $s$ samples. Once it has replies from some or all endpoints, it starts downloading the actual samples using the `getSamples` endpoint. Whenever a sample is received that was not advertised through `samplesAvailable` by another endpoint, it is sent to that endpoint via `sendSamples`. If not enough samples were found through this process, then this process is repeated for the unavailable samples until either * enough samples (at least $q$) are found available * Another block has a heavier weight in the fork choice rule, at which point sampling switches to that block. (In other words, sampling is continuously active for the latest ancestor of the current fork choice head that hasn't been determined as available yet.) ## Initial sample distribution When sending a block, a relay immediately streams the block and the samples to other sample endpoints it knows about, as well as making it available to its own sample endpoint (that it also advertises in its block). * A relay has an incentive to make its samples available to as many sample endpoints as possible. While it may be tempting to make its own endpoint more reliable by initially only providing to it, this would increase the risk of the block being unavailable and is not worth the risk * In particular, quickly distributing to many sample providers mitigates the dangers of a DOS attack ## Sample endpoint scoring * Sample endpoints are scored according to the samples they provide. * For each sample that has been provided through `getSamples`, a positive score of $1/r$, where $r$ is the number of sample endpoints that have advertised the samples through `samplesAvailable` * For each sample that was not adertised thorugh `samplesAvailable` but was available through other sample endpoints, apply a penalty of $-r$ * Any sample that is adertised through `samplesAvailable` but the sample endpoint fails to provide (after a number of repeat queries) is penalized with $-10000$ reputation

Import from clipboard

Advanced permission required

Your current role can only read. Ask the system administrator to acquire write and comment permission.

This team is disabled

Sorry, this team is disabled. You can't edit this note.

This note is locked

Sorry, only owner can edit this note.

Reach the limit

Sorry, you've reached the max length this note can be.
Please reduce the content or divide it to more notes, thank you!

Import from Gist

Import from Snippet

or

Export to Snippet

Are you sure?

Do you really want to delete this note?
All users will lost their connection.

Create a note from template

Create a note from template

Oops...
This template has been removed or transferred.


Upgrade

All
  • All
  • Team
No template.

Create a template


Upgrade

Delete template

Do you really want to delete this template?

This page need refresh

You have an incompatible client version.
Refresh to update.
New version available!
See releases notes here
Refresh to enjoy new features.
Your user state has changed.
Refresh to load new user state.

Sign in

Sign in via SAML

or

Sign in via GitHub

Help

  • English
  • 中文
  • 日本語

Documents

Tutorials

Book Mode Tutorial

Slide Example

YAML Metadata

Resources

Releases

Blog

Policy

Terms

Privacy

Cheatsheet

Syntax Example Reference
# Header Header 基本排版
- Unordered List
  • Unordered List
1. Ordered List
  1. Ordered List
- [ ] Todo List
  • Todo List
> Blockquote
Blockquote
**Bold font** Bold font
*Italics font* Italics font
~~Strikethrough~~ Strikethrough
19^th^ 19th
H~2~O H2O
++Inserted text++ Inserted text
==Marked text== Marked text
[link text](https:// "title") Link
![image alt](https:// "title") Image
`Code` Code 在筆記中貼入程式碼
```javascript
var i = 0;
```
var i = 0;
:smile: :smile: Emoji list
{%youtube youtube_id %} Externals
$L^aT_eX$ LaTeX
:::info
This is a alert area.
:::

This is a alert area.

Versions

Versions and GitHub Sync

Sign in to link this note to GitHub Learn more
This note is not linked with GitHub Learn more
 
Add badge Pull Push GitHub Link Settings
Upgrade now

Version named by    

More Less
  • Edit
  • Delete

Note content is identical to the latest version.
Compare with
    Choose a version
    No search result
    Version not found

Feedback

Submission failed, please try again

Thanks for your support.

On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

Please give us some advice and help us improve HackMD.

 

Thanks for your feedback

Remove version name

Do you want to remove this version name and description?

Transfer ownership

Transfer to
    Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

      Link with GitHub

      Please authorize HackMD on GitHub

      Please sign in to GitHub and install the HackMD app on your GitHub repo. Learn more

       Sign in to GitHub

      HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.

      Push the note to GitHub Push to GitHub Pull a file from GitHub

        Authorize again
       

      Choose which file to push to

      Select repo
      Refresh Authorize more repos
      Select branch
      Select file
      Select branch
      Choose version(s) to push
      • Save a new version and push
      • Choose from existing versions
      Available push count

      Upgrade

      Pull from GitHub

       
      File from GitHub
      File from HackMD

      GitHub Link Settings

      File linked

      Linked by
      File path
      Last synced branch
      Available push count

      Upgrade

      Danger Zone

      Unlink
      You will no longer receive notification when GitHub file changes after unlink.

      Syncing

      Push failed

      Push successfully