Heliax
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Write
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Help
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Write
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # Shard Scheduler [paper](https://arxiv.org/pdf/2107.07297.pdf) The goal is to have a system that allows for easy migration of accounts on sharded blockchains, resulting in optimization of resources and consequently, better throughput. Cross-shard transactions are more expensive than intra-shard transactions. Sometimes it may more economical to move an account to the target shard and then conduct an intra-shard transation, if the migration results in higher throughput and lower latency. Shard Scheduler (SS) provides a decidedly smart way to actually facilitate such migration, but not before it can to a certain extent analyse their feasibility. Broadly, there are two steps to the operation: 1. Deciding the "main shard" and the placement of new accounts 2. Deciding on migration of accounts with pending transactions The main shard, once decided upon, is the only possible migration destination. ## Data structures Each SS miner possesses a vector $v_i$ associated with an account, $$ v_i = [a_{i1}, a_{i2}, \dots ,a_{in}]$$ where $a_{ij}$ denotes the *alignment* of account $i$ towards shard $j$. When an account is created, this is the zero vector. For a transaction $t$ from $acc_i$ in shard $z_i$ to an account $acc_j$ in shard $z_j$, the vector updates as $$a_{ij}' = a_{ij} + c(t)\\ a_{ji}' = a_{ji} + c(t)$$ where $c(t)$ denotes the cost of transaction $t$ and the prime $'$ denotes the updated value of the variable. Alignment vectors only account for a finite number of previous transactions. Zero vectors are dropped so that alignment vectors of inactive accounts do not take up storage space. As alignment vectors are stored locally, there is no additional storage required on the chain. There is however, some storage needed on the beacon chain that documents the load of each shard, which is the total cost of transactions processed by a shard over the last 100 blocks. This is submitted to the beacon chain by the shards along with block-headers. ## Determining the main shard The *transaction coordinator* is the shard that includes the transaction in its block. "The transaction coordinator obtains a list of accounts to be modified and coordinates other shards involved in the transaction." This step takes input $[l_i, \phi, s_i]$ where $l_i$ is the list of new accounts modified by the transaction, $\phi$ is the shard assignment function and $s_i$ is the last state of the shard. The list includes all internal transactions caused by this external one and is known to the transaction coordinator. Allocation recommendations and main shard assignment are made based on this information. If multiple shards are involved, SS reads the load on each shard from the beacon chain and the minimally loaded shard is designated the main shard (see Algorithm 2 in the paper). All new accounts are assigned to the main shard. ## Deciding migration of existing accounts The second step takes input $[ acc_i,\phi,m]$ where $acc_i$ is an account involved in a cross-shard transaction. This procedure is performed by the shard $z_i$ where $acc_i$ resides, without relying on data from other shards. From the alignment vector of the account $acc_i$, SS evaluates if > $a_{i, current} \times c(t_{cross-shard}) < \underset{k \neq current}\sum a_{ik}$ If true, the account is migrated to the main shard. ## Incentives Proposals by rational miners in a sharded environment tend to include transactions that have the highest fees. Hence, they are greatly incentivized to migrate accounts to their own shard, in order to have more transactions to choose from, thus working against the interests of the network. To tackle this, the writers propose a shard-special deposit, which is collected in the next epoch, after miners have been assigned to different shards. Upon assignment, the miner collects the same percentage of transaction fees accrued by the previous miners. For example, if 10% of the fees of the last transaction in the last shard were allotted to miner $m_1$, then $m_1$ will collect 10% of the fees accrued in the current shard. Such a system results in an increased expected reward for miners which is directly proportional to the total fees collected in the network during the previous epoch, thus incentivizing increasing the network's total capacity.

    Import from clipboard

    Paste your markdown or webpage here...

    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 lose 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?
    Turn this template into a regular note and keep its content, versions, and comments.

    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

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    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 and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    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.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        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
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

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

        Syncing

        Push failed

        Push successfully