GithubHelp home page GithubHelp logo

monorepo's Issues

messages: add a resolver method

Imagine having a message

const message = new BlockMessage({transactions: [hash]})

Without resolver

message.decode() // {transactions: [hash]}

With resolver

const resolver = (propertyKey, value) => propertyKey === 'transactions' &&  peernet.get(value)
message.decode(resolver) // {transactions: [{from, to}]}

or

const resolver = (propertyKey, value) => propertyKey === 'transactions' && fs.readfile(value)
message.decode(resolver) // {transactions: [{from, to}]}

chain: statestore needs to include accounts or drop accounts?

Whenever a node connects it will try to update from the state store, meaning accounts should be in the state also or empty nodes will fail getting the account nonce

Solutions

  • drop accounts (easy but means no easy way to check for total transfers)
  • rewrite accounts so that when a state is saved we include the accounts in state and clear the local accountsstore.

last thing before prelaunch (pinky promise) (LIP1)

The problem

Transactions are included in the block, which requires nodes to load those blocks before they can access the transaction count, hashes etc

currently they look like

block.transactions // [{
  hash,
  from,
  to,
  params,
  ...
}]

// load and loop trough all blocks
for (const block of loadedBlocks)  {
  for (const tx of block.transactions) {
    transactionPoolStore.has(tx.hash)
  }
}

this makes things hard/cpu expensive to keep nodes in sync because transactionPool keeps including transactions that are processed already.
meaning we would need to loop trough all blocks and it's transactions.
We could just set a time/blockamount limit on it ofc, but while this would work to reduce the amount of processing this would also result in transactions getting lost (imagine a power outage where a node is disconnected for 10 min and in that time the timeout experises ...)

Solution

Blocks should just hold the transaction hashes while transactions should get their own storage.
This way we can loop trough all transactions in the pool and just check if it

  • exists already locally
  • exists already on another node
  • get the transaction data directly (vs looping trough blocks and searching for it)

how it would look

block.transactions // [transationhash]
// existing hash
await transactionPoolStore.has(transactionhash)

// getting tx data
await transactionStore.get(transactionhash)

performance improvement

x10

chain: TODO for v1.6.0

TODO

  • all native contracts are proxied (less hasle when upgrading a contract
  • proxy manager standard
  • add stateStore (contracts can be loaded using the state) (introduces breaking change, devs need to make the state of their contract exposable ) see #82
  • add snapshotting (recover from state/decide from where to recover)
  • contracts can be upgraded and inited using state (be carefull! once the storage is set to the new contract it's no longer available in the old contract)
  • native voting system
  • validators produce blocks
  • syncs blocks with other nodes
  • double contracts throw and are not added (no cost)
  • transactions that fail are ignored (no cost and less resource usage)
  • native contracts that are internally used by the chain (iow no need for a wrapped token)
  • can add/remove validators
  • add roles standard

edits

  • 17/11/2022 - remove proxies & proxy manager, when stateStore is implemented, proxies are not needed.

chain: add validator selection & timeout

Let validators vote who to handle the incoming transactions

  • validators get rewarded only when voted for
  • timeout whenever a block takes more then 10 seconds to be validated and revote

Add faucet

The thing todo

Introduce a simple faucet (for now)

Why?

Makes life easier for testers (and me) trying to get some LFC coins to checkout the test platform.

How?

A contract should control this, whenever a request happens it checks if the user has less then the max amount they can own to get the coins (let's say 500)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.