Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • I Issues without projects yet
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Issues 12
    • Issues 12
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Create a new issue
  • Issue Boards
Collapse sidebar
  • hivehive
  • Issues without projects yet
  • Issues
  • #6
Closed
Open
Issue created Apr 10, 2020 by Dan Notestein@danOwner6 of 8 checklist items completed6/8 checklist items

Update libaries to support chainid swap

Motivation: In the upcoming HF, we will also be changing the chainid.

The chainid is hardcoded into the various libraries such as hive-js. This chainid is hashed into the signature of transactions broadcast to the network. This prevents a transaction from being accepted on a network with a different chainid (note that this probably isn't strictly necessary as such a transaction seemingly couldn't be replayed on a different network anyways due to TAPOS, where the transaction has to reference an existing blockhash in the chain in order to be considered valid).

But since the chainid IS hashed into the transaction signature, the API libraries that generate transactions will need to know when to "switch" from using the current chainid to the new one, in order to broadcast transactions that will be accepted after the HF takes effect that changes the chainid.

The hardfork doesn't necessarily take place at a specific time/block because the hardfork doesn't go into effect until a supermajority of the witnesses vote for the hardfork, but it's known that it will be after the specified hardfork time. So prior to this time, API libraries can use the "old" chainid. After this time, they will need to ask the API node for the current chainid each time before they generate a new transaction, so that they generate the proper signature.

For libraries that maintain persistent state across calls, they can be set to stop asking for the new chain id after they are told that the chain id has changed. For libraries without persistent state, they will need to continue asking for the new chain id, and such libraries should eventually be updated further to eliminate the call to get the chain id, after the chain id swap time.

For this task to be completed, a new issue should be created in each library and a checkbox should be included here for that library (to be checked when the library is updated). Please edit this issue to add any missing libraries that generate transactions.

Data that libraries need to know:

  • chainid: 0xBEEAB0DE + 56 zeros
  • earliest time for the hardfork: To be determined

The earliest time for the hardfork has not yet been set, but library maintainers can use dummy values for testing purposes.

  • hive-js
  • hive-python
  • lighthive
  • Beem
  • dhive
  • steem-js (?)
  • hive-tx
  • others???
Edited Oct 14, 2020 by Dan Notestein
Assignee
Assign to
Time tracking