Skip to content
This repository has been archived by the owner on Oct 16, 2019. It is now read-only.

Introducing roles! #36

Open
wants to merge 28 commits into
base: master
Choose a base branch
from
Open

Introducing roles! #36

wants to merge 28 commits into from

Conversation

damirka
Copy link
Contributor

@damirka damirka commented Apr 22, 2019

From now on there won't be any differentiation of 'clients'. I introduce you roles!

New roles:

  • delegate
  • block producer
  • bank (this one is PoC only and needed for testing) // it's functionality is still to be implemented in future

Role is:

  • assigned after blockchain sync
  • taken from block state
  • (de|at)tachable

damirka added 11 commits April 17, 2019 01:41
- my suggestion is to create single point of entry for all DBs
- chaindata is replaced with core/db
- now core/db is the only point of access to data
- backward compability is saved, so only few other changes were made
- few bugs in stream pulling were fixed and now allow async writing
- fewer console logs
- now both addProducer and addDelegate can refer to same address
- removed lib/parser as it was only used in tests
- removed console logs in tests
- improved lib/genesis to support multi-role records
- now both addProducer and addDelegate can refer to same address
- removed lib/parser as it was only used in tests
- removed console logs in tests
- mkdir -p after installation, removed state from initial genesis, fixed genesis block state
- added adapter to generate state from genesis block
- role is an assignment for one round defined in start of it
- both delegate and producer are just roles from now on
- index.js is a key file which listens to all the events and plays both roles
- no more /docs directory
@damirka damirka added enhancement New feature or request help wanted Extra attention is needed labels Apr 22, 2019
@damirka damirka requested review from borispovod and romfrolov April 22, 2019 10:49
@damirka damirka self-assigned this Apr 22, 2019
@damirka damirka changed the title Role picking Introducing roles! Apr 22, 2019
damirka added 11 commits April 22, 2019 14:00
- 2 new methods in services/waiter
- constants are now able to define through env setting
- new lib/block-state util for parsing block state
- in genesis and everywhere else 0x-prefixed addresses (yay!)
- few changes around tx handling - we don't want errors
- instead of certificates there's locked in genesis
- we don't issue certificates from now on, we only lock coins
- use block-parser(block.state) for easier access
- started implementing state support and usage in delegates role
- now delegates can know each other addresses from public keys
- finally consensus with N delegates works as expected
- fixed sync bug so new nodes could not connect
- role assignment works from start and as expected
- observer now has function .observe()
- runner prints log directory for each account address
- fixed N delegates bug which led to only 1 response awaiting
@damirka damirka marked this pull request as ready for review May 6, 2019 14:49
- new event NEW_BLOCK_RECEIVED emitted when block is downloaded
- reduced delegate wait time to 1 second instead of 5
- now role is defined on every block, not only first one
damirka added 5 commits May 6, 2019 18:38
- now bp and delegate pull block only once
- started refactoring of delegate block
- block-producer code is more opaque and simple
Leveldown uses first char to define 'last record' so 9th block
was always a last one. From now on we store 'latest' block.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant