Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Testnet V2 todo #16

Open
9 of 37 tasks
liamzebedee opened this issue Jul 24, 2024 · 0 comments
Open
9 of 37 tasks

Testnet V2 todo #16

liamzebedee opened this issue Jul 24, 2024 · 0 comments

Comments

@liamzebedee
Copy link
Collaborator

liamzebedee commented Jul 24, 2024

tinychain testnet 1 is running, and we've sent a couple txs and mined a bunch of blocks. lots of todo items that are spread out among different areas of the stack, nearly all of these are linearized tasks - ie. small in size, low risk, don't involve a lot of unknowns

https://x.com/liamzebedee/status/1816057946369057070

  • bugs
    • sync panics process after downloader has no more peers for jobs
    • node doesn't sync to full tip yet (need to ingest bodies)
    • test is failing in CI for some reason, can't access logs
  • refactorings
    • getlongestchainhaslist returns the headers tip, should return full tip
    • explorer accounts page returns accounts in random order
    • the explorer is horribly inefficient lol. needs to hot reload too for new blocks from the node
  • security
    • setup txs so they have unique nonces
    • add transaction replay protection / build "seen" index or "nonce" index
  • sync
    • test branches and reorgs (gut: this will be straightforward)
    • upon first start, scan for missing block bodies. add these to wantlist
    • wait until fully synced before mining and spamming the net
    • update full tip
    • interactive bissect with peers to get common ancestor. then sync from that point.
    • when we receive a new block and don't know parent, do "fast path" and ask for most recent 10 headers
  • build mempool ([WIP] Mempool #18)
    • add fee mechanism
    • reingest old txs??
    • add to block body
  • mining
    • restart miner whenever we have a new full tip
    • restart miner whenever we have a new tx bundle from mempool
  • add ability to send transactions
    • design some interface for users / CLI
    • "add transaction" user endpoint
    • gossip transactions, if !seen then add to mempool
    • add "gettxstatus" to check where/if tx was confirmed
  • saving state
    • save the miner public key to database under wallets, load on start
    • save the peers we've seen to database, load from db on start
  • performance improvements
    • verify signatures in parallel (maybe using GPU?)
    • fetch blocks in parallel for syncgetblockdata
    • add proper indexes on sql database for various things
    • add a cache / memoize the longestchainhashlist function
    • add a cache / memoize the reconstructstate function
  • simple block explorer on each node (Block explorer (tinyscan) #19)
    • take the sqlite database
    • get the longest chain hash list
    • then build a simple HTML interface around it
      • homepage - latest block, num transactions
      • /blocks/:hash
      • /txs/:hash
      • /accounts/:pubkey

Stretch:

  • load peers from dns seed? or load peers from bittorrent or ethereum or something.
  • move to using protobufs for rpc Protobufs + gRPC #13

Nice to have:

  • add ecdsa recovery or use schnor signatures to reduce tx/pubkey size by 50%
  • add the state root
  • setup hole punching / NAT stuff
  • size improvements
    • use hash(pubkey) for accounts instead of pubkey. could be smaller ([32] vs. [20]byte).
  • build a simple terminal UI interface
    • list of blocks
    • list of accounts
    • after every update
  • mining algorithm
    • use ethash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant