Skip to content

Commit

Permalink
merge: evm (#25)
Browse files Browse the repository at this point in the history
* feat: initial EVM integration (#448)

* setup evm package boilerplate

* ensure directory

* add evm transaction type

* tweak build command

* missing license info

* style: resolve style guide violations

---------

Co-authored-by: oXtxNt9U <[email protected]>
Co-authored-by: sebastijankuzner <[email protected]>

* feat: use keccak256 addresses and regenerate genesis block (#447)

* setup evm package boilerplate

* ensure directory

* add evm transaction type

* tweak build command

* missing license info

* use crypto-address-keccak256

* crypto fixes

* update generator

* regenerate genesis block

* fix tests

* style: resolve style guide violations

---------

Co-authored-by: oXtxNt9U <[email protected]>
Co-authored-by: sebastijankuzner <[email protected]>

* feat(evm-developmen): add package (#449)

* implement evm-development package

* remove superfluous log

* ensure validator funds

* deploy from genesis address

* style: resolve style guide violations

* increase amount

* infer recipients from genesis block

* style: resolve style guide violations

* commit Cargo.lock

* style: resolve style guide violations

---------

Co-authored-by: oXtxNt9U <[email protected]>

* feat(crypto-transaction-evm-call): initial transaction implementation  (#455)

* try improve build rerun

* evm call builder

* serde

* update test-framework

* schema tests

* fixes

* make recipient mandatory

* fix circular dependency

* style: resolve style guide violations

---------

Co-authored-by: oXtxNt9U <[email protected]>

* chore: merge develop to evm (#458)

* deps: clean dependendies and add check script (#450)

* Ignore eslint in scripts

* Use async calls

* Ignore tests

* Show testonly dependencies

* Calculate deps

* Add docs

* Implement methods on Package

* Cleanup

* Rename deps to imports

* Fix exceptions

* Pass method

* Go trough all packages

* Improve logs

* Rename file

* Remove old scripts

* Exit with 1 if failing

* Fix validator-set-vote-weighted

* Validator set static

* Fix validator

* Fix utils

* Fix transaction pool

* Fix test-framework

* Fix packages

* Add deps check

* style: resolve style guide violations

* Fix ci

* Fix api

* style: resolve style guide violations

---------

Co-authored-by: sebastijankuzner <[email protected]>

* feat(bootstrap): compare stored genesis block with config (#451)

* Check stored commit

* Empty commit

* refactor(processor): log verification errors (#452)

* Remove console logs

* Remove forger errors

* Remove UnexpectedError

* Remove extra exceptions

* Add ValidatorExceptions

* Handler throws errors

* Improve logs

* style: resolve style guide violations

---------

Co-authored-by: sebastijankuzner <[email protected]>

* chore: change banner format to jpeg (#453)

* Add banner jpeg

* Remove png version

* Update readme

* release: 0.0.1-alpha.8 (#454)

* release: 0.0.1-alpha.8

* style: resolve style guide violations

---------

Co-authored-by: sebastijankuzner <[email protected]>

* Update version

* Update dependencies

* style: resolve style guide violations

---------

Co-authored-by: sebastijankuzner <[email protected]>

* feat: JSON-RPC server skeleton and `api-evm` package (#459)

* Intiail evm-api package

* Include package

* Include in app.json

* Set 2 workers

* Define EVN variables

* Enable EVM api in .env

* Remove unused plugins

* Register base route

* Validation

* Generate RCP errors

* Bind rpc processor

* Extract RPC contracts

* Add getRPCProcessor

* Call RPCServer directly

* Validate schema

* Fix validation

* Add method

* Add call action

* Register action

* Handle methodNotFound

* Validate params & handler error

* Move plugin to api-common

* Use common utils

* Remove console.logs

* Extract prepareRpcError handler

* Enable rate limit

* Reset rate limit

* Add todo

* feat(api-common): use AJV for JONS-RPC calls (#461)

* Add ajv

* Add schema

* Export validation

* Add Validator.hasSchema

* Register schema

* Fix schema

* Verify payload

* Use ajv

* style: resolve style guide violations

* Fix dependencies

* Fix integration tests

* Update pnpm-lock.yaml

* Fix deps

---------

Co-authored-by: sebastijankuzner <[email protected]>

* refactor(crypto-transaction-evm-call): add interface types to break up cyclic dependency on evm (#462)

* evm interfaces

* remove hard dependency

* remove unused dep

* refactor(evm): improve error handling (#463)

* handle errors more gracefully

* setup initial tests

* ci

* add try catch

* style: resolve style guide violations

* fix

---------

Co-authored-by: oXtxNt9U <[email protected]>

* feat(api-evm): support `evm_call` method (#464)

* Call view method

* Add ethers dep

* Add additional evm tests

* Remove only

* Add ethers to api-evm

* Prepare buffer data

* Return success

* Response order

* Custom RPC error

* Handle revert

* Schema uses address

* Use prefixed hex

* style: resolve style guide violations

* Use prefixedHex name

---------

Co-authored-by: sebastijankuzner <[email protected]>

* feat: create transaction handler context that provides EVM instance (#471)

* Add type TransactionHandlerContext

* Fix processor, pool, and transactionHandler

* Fix transaction handlers

* Fix vote tests

* Use interface

* Rename files

* Add mock instance

* Fix tests

* Add evm into context

* Use EVM instance from context

* Remove comment

* Fix deps

* pnpm lock

* chore: merge develop to evm (#541)

* deps: clean dependendies and add check script (#450)

* Ignore eslint in scripts

* Use async calls

* Ignore tests

* Show testonly dependencies

* Calculate deps

* Add docs

* Implement methods on Package

* Cleanup

* Rename deps to imports

* Fix exceptions

* Pass method

* Go trough all packages

* Improve logs

* Rename file

* Remove old scripts

* Exit with 1 if failing

* Fix validator-set-vote-weighted

* Validator set static

* Fix validator

* Fix utils

* Fix transaction pool

* Fix test-framework

* Fix packages

* Add deps check

* style: resolve style guide violations

* Fix ci

* Fix api

* style: resolve style guide violations

---------

Co-authored-by: sebastijankuzner <[email protected]>

* feat(bootstrap): compare stored genesis block with config (#451)

* Check stored commit

* Empty commit

* refactor(processor): log verification errors (#452)

* Remove console logs

* Remove forger errors

* Remove UnexpectedError

* Remove extra exceptions

* Add ValidatorExceptions

* Handler throws errors

* Improve logs

* style: resolve style guide violations

---------

Co-authored-by: sebastijankuzner <[email protected]>

* chore: change banner format to jpeg (#453)

* Add banner jpeg

* Remove png version

* Update readme

* release: 0.0.1-alpha.8 (#454)

* release: 0.0.1-alpha.8

* style: resolve style guide violations

---------

Co-authored-by: sebastijankuzner <[email protected]>

* fix(validator-set-vote-weighted): active validators is subset of registered validators (#466)

* Mak method private

* Build validators

* Local variable

* Use for of loop

* Check active validators

* Fix tests

* fix(processor): `validatorVoteBalance` calculation (#467)

* Add pg:reset

* Decrease vote balance

* Include fee

* Remove unused line

* style: resolve style guide violations

---------

Co-authored-by: sebastijankuzner <[email protected]>

* chore: docker validator support (#468)

* release: 0.0.1-alpha.9 (#469)

* release: 0.0.1-alpha.9

* style: resolve style guide violations

---------

Co-authored-by: sebastijankuzner <[email protected]>

* chore: fix publish GitHub workflow (#470)

* Run on pull request

* No git checks

* set token

* Revert to original build conditions

---------

Co-authored-by: oXtxNt9U <[email protected]>

* refactor(transactions): move amount deduction into transaction handlers (#472)

* refactor transfer amount deduction

* cleanup

* update schema tests

* feat: add `env:paths:clear` commands (#473)

* Clear plugins & exports

* Clear data

* Remove variables

* Add paths to contracts

* Remove config paths

* Cache cache, log, temp

* Cleanup

* Add command to api

* Add clear all

* Fix case

* release: 0.0.1-alpha.10 (#474)

* release: 0.0.1-alpha.10

* style: resolve style guide violations

---------

Co-authored-by: sebastijankuzner <[email protected]>

* feat(crypto-transaction-username-registration): limit one transaction by sender in pool (#475)

* Rename variable

* Fix text

* Check transaction already in the pool

* feat(validator): log loaded validators (#477)

* Inject

* Print method

* Print on bootstrap

* Rename method

* Execute after state check

* Improve text

* Log 0 validators

* Determine activa & standby

* Wallet to string

* chore: fix typo in transaction fee errors (#476)

* feat(state): implements `sizeOfIndex` on WalletRepository (#479)

* Add sizeOfIndex

* Add initial implementation

* Wallet repository clone

* Implement on wallet repo clone

* Add missing attribute

* FIx validator resignation

* release: 0.0.1-alpha.11 (#480)

* release: 0.0.1-alpha.11

* style: resolve style guide violations

---------

Co-authored-by: sebastijankuzner <[email protected]>

* feat: port to ES modules (#478)

* initial browser support

* add package link script

* port api-common

* port api-database

* port api-development

* port api-http

* port api-sync

* port api-transaction-pool

* port api

* port bootstrap

* port cli

* port configuration-generator

* port consensus

* port webhooks

* port validator

* port validator-set-vote-weighted

* port validator-set-static

* port validation

* port utils

* port transactions

* port transaction-pool

* port test-framework

* port state

* port serializer

* port proposer

* port processor

* port p2p

* port networking-ntp

* port networking-dns

* port logger-winston

* port logger-pino

* port kernel

* port fees

* port fees-static

* port fees-managed

* port fees-burn

* port database

* port crypto-worker

* port crypto-wif

* port crypto-validation

* port crypto-transaction

* port crypto-transaction-vote

* port crypto-transaction-validator-resignation

* port crypto-transaction-validator-registration

* port crypto-transaction-username-resignation

* port crypto-transaction-username-registration

* port crypto-transaction-transfer

* port crypto-transaction-multi-signature-registration

* port crypto-transaction-multi-payment

* port crypto-signature-schnorr

* port crypto-signature-schnorr-secp256k1

* port crypto-signature-ed25519

* port crypto-signature-ecdsa

* port crypto-signature-bls12-381

* port crypto-messages

* port crypto-key-pair-schnorr

* port crypto-key-pair-ed25519

* port crypto-key-pair-ecdsa

* port crypto-key-pair-bls12-381

* port crypto-hash-wasm

* port crypto-hash-noble

* port crypto-hash-bcrypto

* port crypto-consensus-bls12-381

* port crypto-config

* port crypto-commit

* port crypto-block

* port crypto-address-ss58

* port crypto-address-keccak256

* port crypto-address-bech32m

* port crypto-address-bech32

* port crypto-address-base58

* port core

* port contracts

* port container

* update tsconfig to nodenext

* fix kleur/color

* update core/bin/run.js

* command fixes

* lmdb import fixes

* p2p fixes

* ajv fix

* get __dirname

* update pnpm-lock.yaml

* remove unused @pm2/io dependency

* replace fileURLToPath

* use filesystem service inside kernel

* cleanup

* update TypeScript to 5.4.2

* move __dirname into local scope

* replace fast-memoize with memoizee

* test-runner packacge

* re-export test-runner

* tests: utils

* tests: validation

* tests: crypto-config

* tests: container

* tests: kernel

* tests: transactions

* style: resolve style guide violations

* fix more tests

* fix transaction dependency lookup

* fix p2p tests

* more fixes

* fix cli and configuration-generator

* cli fixes

* kernel fixes

* transaction-pool

* all pass

* commit dirty

* style: resolve style guide violations

* fix api-http integration tests

* fix deps:check

* runtime fixes

---------

Co-authored-by: oXtxNt9U <[email protected]>
Co-authored-by: sebastijankuzner <[email protected]>

* fix(api): broken entrypoint (#481)

* fix api entrypoint

* fix more commands

* refactor(transaction-pool): return tx indexes as integers (#483)

* return tx indexes as integers

* fix compile error

* chore: update dependencies (#482)

* update dependencies

* Empyt commit

---------

Co-authored-by: sebastijankuzner <[email protected]>

* fix wallet response (#485)

* fix(configuration-generator): create genesis block script (#484)

* fix create genesis block script

* Empty commit

---------

Co-authored-by: sebastijankuzner <[email protected]>

* resolve conflicts

* refactor(core): rename run script to have explicit file extension (#486)

* ensure run script has explicit file extension

fixes ERR_UNKNOWN_FILE_EXTENSION

* empty commit

* fix: use .js extension in `start` commands (#487)

* Fix start commands

* Fix package.json

* Fix tests

* release: 0.0.1-alpha.12 (#488)

* release: 0.0.1-alpha.12

* style: resolve style guide violations

---------

Co-authored-by: sebastijankuzner <[email protected]>

* fix(core): resolve correct plugin `package.json` path (#489)

* Fix package manifest

* Skip tests

* release: 0.0.1-alpha.13 (#490)

* release: 0.0.1-alpha.13

* style: resolve style guide violations

---------

Co-authored-by: sebastijankuzner <[email protected]>

* feat(cli): determine correct entrypoint paths (#491)

* Add setup class

* Fix setup

* Bind

* Fixes

* Use setup paths

* Use in api

* Remove logs

* Fix tests

* Cleanup tests

* fix(test-framework): list project packages in dependencies (#492)

* Use direct dependencies

* Empty commit

* Fix dependencies

* Fix dependencies

* style: resolve style guide violations

---------

Co-authored-by: sebastijankuzner <[email protected]>

* exclude genesis transactions from fee statistics calculation (#494)

* fix(crypto): manage static fees via milestones (#493)

* add static fees to milestones

* update tests

* style: resolve style guide violations

* initialize static fees only in a single place

---------

Co-authored-by: oXtxNt9U <[email protected]>

* fix(api): sync active milestones on change (#495)

* sync active milestones on change

* fix test

* fix(api-http): add missing fields to transaction resource (#496)

* improve error logging

* populate all transaction fields

* review

* remove type cast

* add comment

* simplify more

* rename block model too and add assert

* fix paths according to the latest paths naming convention (#497)

* refactor(p2p): replace ip with `url` in api nodes (#498)

* api node urls

* update protobuf definitions

* update test fixtures

* cleanup

* style: resolve style guide violations

---------

Co-authored-by: oXtxNt9U <[email protected]>

* fix(transaction-pool): invalid tx error reporting (#500)

* fix tx pool error reporting

* empty commit

* test: use `tsx` TypeScript loader (#499)

* Add tsx

* Fix runner

* Fix test-runner scripts

* Update tsconfig

* Fix tests

* Use test config

* Fix api tests

* api-common

* Api-database

* api-development

* api-http

* api-sync

* api-transaction-pool

* bootstrap

* cli partial

* Fix cli tests

* Runner extends contracts

* Configuration generator

* Consensus

* Container

* Contracts

* Core

* Crypto address

* Crypto block

* Cypto commit

* Crypto config

* Crypto

* Crypto messages

* Crypto signature

* Crypto transaction

* Crypto

* Database

* Fees

* Kernel

* Logger pino

* Logger winston

* Networking

* Server

* Processor, proposer, serializer

* State

* Transaction pool

* Transactions

* Utils

* Validation

* Validator

* Validator set

* Webhooks

* Remove tsm

* Fix integration tests

* Update lint CI

* Fix dependencies

* Prettier

* Lint

* Perttier

* style: resolve style guide violations

* refactor: remove `__dirname` usage (#501)

* Remove __dirname

* Fix tests

* Factory require config

* test(functional/consensus): add skeleton for functional tests (#503)

* Prepare base structure

* Add test runner

* Base test

* Add base packages

* Register base packages

* Add config

* Add pacakges

* Export bootstrap

* Export individual bootstrappers

* Register bootstrappers

* Extract bootstrapper itnerface

* Test

* Use tsm

* Pass url to PluginManifest

* Register service provider

* Setup up to validator package

* Register all necessary packages

* Add missing packages

* Boot

* Register transactions

* Process genesis

* Run consensus

* Add worker

* Fix worker

* Fix broadcaster

* refactor(consensus-storage): extract storage logic into package (#502)

* Add consensus storage package

* Prepare service provider

* Remove storage from consensus

* Add dependencies

* Move root into consensus storage

* Rename identifier

* Fix identifiers

* Edit contracts

* Fix deps

* Update packages/consensus-storage/README.md

Co-authored-by: oXtxNt9U <[email protected]>

---------

Co-authored-by: oXtxNt9U <[email protected]>

* milestone generator add static fees (#504)

* test(functional/transaction-pool-api): initial boilerplate and tests (#505)

* update gitignore

* add tx pool api boilerplate and basic broadcast

* add signWithKeyPair to tx builder

* update functional consensus milestones

* wait for block and assert committed transaction

* invalid transfer test

* assert invalid transactions are not committed

* test with invalid / malformed signature

* fix(test-runner): rethrow error in runHook (#506)

* bubble up error thrown in runHook

* Empty

---------

Co-authored-by: sebastijankuzner <[email protected]>

* refactor(database): return commits instead blocks (#507)

* getBlock to getCommit

* Fix tests

* getLastBlock -> getLastCommit

* Fix tests

* Implement isEmpty

* Fix tests

* feat(transaction-pool): support `in-memory` database (#510)

* Support im memory database

* Deps

* Test

* style: resolve style guide violations

---------

Co-authored-by: sebastijankuzner <[email protected]>

* test(functional/consensus): prepare package replacements, asserts and p2p layer (#508)

* Bind consensus storage

* Mock database

* Add contracts

* Use relative paths

* Prepare 2 setups

* Run 2 nodes

* Make log protected

* Make MemoryLogger fields protected

* Prepare custom logger

* Prepare p2p layer

* Fix p2p

* MemoryDatabase

* Load crypto

* Read validators

* Prepare validators

* Use common config

* Add snooze for one block

* Stop node

* Snooze for block

* Prepare smaller config

* Asserts

* Fix and check TS code

* Add script for check & test

* Use strict true

* Support plugin options

* Assert validators

* refactor(kernel): create bootstraper for shutdown signals  (#511)

* Register error handler first

* Move listen to shutdown signals into bootstrapper

* test(functional/transaction-pool-api): test all transaction types (#509)

* missing dependency

* transfer

* vote

* username-registration

* username-resignation

* validator-registration

* validator-resignation

* multipayment

* fix default payload

* update utils

* multi signature test plus fixes

* fix compile error

* test transfer with multisig

* rename tests for clarity

* add wallets to context

* tsc strict

* add snapshot based balance checks

* reduce block time

* review

* test(functional/transaction-pool): increase vote coverage (#512)

* votes

* empty commit

* test switch vote and unvote for non voted validator

* test(functional/transaction-pool): increase validator registration coverage (#513)

* votes

* empty commit

* validator registration

* empty commit

* test(functional/transaction-pool): increase validator resignation coverage (#514)

* votes

* empty commit

* validator resignation

* empty commit

* test(functional/transaction-pool): increase username registration coverage (#515)

* votes

* empty commit

* username registration

* empty commit

* test(functional/transaction-pool): increase username resignation coverage (#516)

* votes

* empty commit

* username resignation

* empty commit

* fix(kernel): minority and majority calculation (#520)

* Fix majority, minority

* Tests

* Add extra tests

* fix(api-http): allow 0 nonce in schema (#521)

* Allow nonce 0

* Empty commit

* fix(api-http): implement missing `/transaction/fees` route (#523)

* implement missing route /transaction/fees

* add test

* style: resolve style guide violations

* remove unused query param

---------

Co-authored-by: oXtxNt9U <[email protected]>

* test(functional/transaction-pool): increase multi sig registration coverage  (#517)

* more multi signature tests

* empty commit

* update min participants

* test missing participant signature

* test(functional/transaction-pool): add more misc coverage  (#518)

* more multi signature tests

* empty commit

* add misc tests

* empty commit

* release: 0.0.1-alpha.14 (#522)

* release: 0.0.1-alpha.14

* style: resolve style guide violations

---------

Co-authored-by: sebastijankuzner <[email protected]>

* feat(consensus): emit events (#524)

* Add bootstrapped

* New round

* Add events

* Dispatch events

* Fix tests

* test(functional/transaction-pool): extract transaction builders into separate package (#525)

* introduce test-transaction-builders package

* use test transactions package

* include type when logging rejected tx

* style: resolve style guide violations

* fix deps:check

* style: resolve style guide violations

---------

Co-authored-by: oXtxNt9U <[email protected]>

* test(functional/consensus): test proposal scenarios (#526)

* Add initial test

* Rename base test

* Optional blockId

* Full test

* Bind custom proposer selector

* Check generatorPublic key

* Make consensus methods protected

* Expose boot and bootstrap methods

* Skip error handler registration

* Make consensus methods public

* Assert blockRound

* Implement *Many helpers

* Fix base test

* Force async to p2p

* Test missing propose

* Simulate double propose

* Simulate 50:50 split

* Remove assertCommitValidators

* Record messages

* Asserts

* majority minority split

* SnozeForBlock with height

* Assert next block is fine

* Check multiple rounds

* Check invalid proposer

* Add CI for functional

* Rename tests to proposal

* Rename tests

* fix(api-http): delegate search (#527)

* Fix delegate search in API

* Initial support for sorting on jsonb fields

* Update tests

* style: resolve style guide violations

---------

Co-authored-by: oXtxNt9U <[email protected]>

* refactor(p2p): log route on codec error (#528)

* Log error

* Allow empty

* test(functional/transaction-pool): add .gitkeep (#530)

* add .gitkeep

* empty commit

* test(functional/consensus): test prevote & precommit scenarios (#529)

* Check minority not prevoting

* Test null prevotes

* Extract methods to utils

* Check random block

* Check with multiple prevotes

* Lint

* Fix ts errors

* Disable unicorn/no-useless-undefined

* Check missing precommits

* Test precommits

* Check multiple messages

* fix(configuration-generator): update export paths (#531)

* Update paths

* Empty

* feat(api-development): add `peers/banned` endpoint (#532)

* Disposer returns list of banned peers

* Add endpoint

* Add pagiantion

* Format timeout

* style: resolve style guide violations

---------

Co-authored-by: sebastijankuzner <[email protected]>

* test(functional): update ci workflow (#534)

* run all functional tests in ci

* test

* style: resolve style guide violations

* test

* revert me

* style: resolve style guide violations

* include matrix name

* revert trigger

---------

Co-authored-by: oXtxNt9U <[email protected]>

* test(functional/consensus): test rejection of invalid block proposals (#533)

* custom funded wallet provider

* REVERT ME: debug logs

* export Proposer

* custom block proposal

* emit event on invalid block

* add assertInvalidBlock

* extract custom proposal function

* ensure wallet exists on each node

* invalid proposals

* seed with randomBytes

* log error instance on mismatch

* lint

* Revert "REVERT ME: debug logs"

This reverts commit defdf7eb3b45718e81a0a11f73246ed6ff6c76ed.

* deps: update lmdb (#535)

* Update lmdb

* Log if commit cannot be read

* Await transaction flushed

* Await flush

* test(functional): fix `MaxListenersExceeded` warning (#537)

* fix MaxListenersExceededWarning

* empty commit

* feat(api-http): support sorting on jsonb attributes (#538)

* support sort on wallet attributes

* NULLS LAST

* tests

* style: resolve style guide violations

---------

Co-authored-by: oXtxNt9U <[email protected]>

* fix(p2p): peer ban and validate ip plugin (#539)

* Skip header check if peer is not in repo

* Validate peer ip

* Remove repo check

* Validate ip and data separately

* Fix test

* Update default peer ban time

* feat(cli): add --overwrite flag to `config:publish:custom` (#536)

* expose `skip` callback

* update publish:custom command

* style: resolve style guide violations

* Make fields optional

* Require flags error

---------

Co-authored-by: oXtxNt9U <[email protected]>
Co-authored-by: sebastijankuzner <[email protected]>

* conflict fixes

* style: resolve style guide violations

* fix tests

---------

Co-authored-by: Sebastijan K <[email protected]>
Co-authored-by: sebastijankuzner <[email protected]>
Co-authored-by: Adrian Kerchev <[email protected]>
Co-authored-by: Edgar Goetzendorff <[email protected]>
Co-authored-by: oXtxNt9U <[email protected]>
Co-authored-by: sebastijankuzner <[email protected]>

* chore: merge develop to evm (#559)

* deps: clean dependendies and add check script (#450)

* Ignore eslint in scripts

* Use async calls

* Ignore tests

* Show testonly dependencies

* Calculate deps

* Add docs

* Implement methods on Package

* Cleanup

* Rename deps to imports

* Fix exceptions

* Pass method

* Go trough all packages

* Improve logs

* Rename file

* Remove old scripts

* Exit with 1 if failing

* Fix validator-set-vote-weighted

* Validator set static

* Fix validator

* Fix utils

* Fix transaction pool

* Fix test-framework

* Fix packages

* Add deps check

* style: resolve style guide violations

* Fix ci

* Fix api

* style: resolve style guide violations

---------

Co-authored-by: sebastijankuzner <[email protected]>

* feat(bootstrap): compare stored genesis block with config (#451)

* Check stored commit

* Empty commit

* refactor(processor): log verification errors (#452)

* Remove console logs

* Remove forger errors

* Remove UnexpectedError

* Remove extra exceptions

* Add ValidatorExceptions

* Handler throws errors

* Improve logs

* style: resolve style guide violations

---------

Co-authored-by: sebastijankuzner <[email protected]>

* chore: change banner format to jpeg (#453)

* Add banner jpeg

* Remove png version

* Update readme

* release: 0.0.1-alpha.8 (#454)

* release: 0.0.1-alpha.8

* style: resolve style guide violations

---------

Co-authored-by: sebastijankuzner <[email protected]>

* fix(validator-set-vote-weighted): active validators is subset of registered validators (#466)

* Mak method private

* Build validators

* Local variable

* Use for of loop

* Check active validators

* Fix tests

* fix(processor): `validatorVoteBalance` calculation (#467)

* Add pg:reset

* Decrease vote balance

* Include fee

* Remove unused line

* style: resolve style guide violations

---------

Co-authored-by: sebastijankuzner <[email protected]>

* chore: docker validator support (#468)

* release: 0.0.1-alpha.9 (#469)

* release: 0.0.1-alpha.9

* style: resolve style guide violations

---------

Co-authored-by: sebastijankuzner <[email protected]>

* chore: fix publish GitHub workflow (#470)

* Run on pull request

* No git checks

* set token

* Revert to original build conditions

---------

Co-authored-by: oXtxNt9U <[email protected]>

* refactor(transactions): move amount deduction into transaction handlers (#472)

* refactor transfer amount deduction

* cleanup

* update schema tests

* feat: add `env:paths:clear` commands (#473)

* Clear plugins & exports

* Clear data

* Remove variables

* Add paths to contracts

* Remove config paths

* Cache cache, log, temp

* Cleanup

* Add command to api

* Add clear all

* Fix case

* release: 0.0.1-alpha.10 (#474)

* release: 0.0.1-alpha.10

* style: resolve style guide violations

---------

Co-authored-by: sebastijankuzner <[email protected]>

* feat(crypto-transaction-username-registration): limit one transaction by sender in pool (#475)

* Rename variable

* Fix text

* Check transaction already in the pool

* feat(validator): log loaded validators (#477)

* Inject

* Print method

* Print on bootstrap

* Rename method

* Execute after state check

* Improve text

* Log 0 validators

* Determine activa & standby

* Wallet to string

* chore: fix typo in transaction fee errors (#476)

* feat(state): implements `sizeOfIndex` on WalletRepository (#479)

* Add sizeOfIndex

* Add initial implementation

* Wallet repository clone

* Implement on wallet repo clone

* Add missing attribute

* FIx validator resignation

* release: 0.0.1-alpha.11 (#480)

* release: 0.0.1-alpha.11

* style: resolve style guide violations

---------

Co-authored-by: sebastijankuzner <[email protected]>

* feat: port to ES modules (#478)

* initial browser support

* add package link script

* port api-common

* port api-database

* port api-development

* port api-http

* port api-sync

* port api-transaction-pool

* port api

* port bootstrap

* port cli

* port configuration-generator

* port consensus

* port webhooks

* port validator

* port validator-set-vote-weighted

* port validator-set-static

* port validation

* port utils

* port transactions

* port transaction-pool

* port test-framework

* port state

* port serializer

* port proposer

* port processor

* port p2p

* port networking-ntp

* port networking-dns

* port logger-winston

* port logger-pino

* port kernel

* port fees

* port fees-static

* port fees-managed

* port fees-burn

* port database

* port crypto-worker

* port crypto-wif

* port crypto-validation

* port crypto-transaction

* port crypto-transaction-vote

* port crypto-transaction-validator-resignation

* port crypto-transaction-validator-registration

* port crypto-transaction-username-resignation

* port crypto-transaction-username-registration

* port crypto-transaction-transfer

* port crypto-transaction-multi-signature-registration

* port crypto-transaction-multi-payment

* port crypto-signature-schnorr

* port crypto-signature-schnorr-secp256k1

* port crypto-signature-ed25519

* port crypto-signature-ecdsa

* port crypto-signature-bls12-381

* port crypto-messages

* port crypto-key-pair-schnorr

* port crypto-key-pair-ed25519

* port crypto-key-pair-ecdsa

* port crypto-key-pair-bls12-381

* port crypto-hash-wasm

* port crypto-hash-noble

* port crypto-hash-bcrypto

* port crypto-consensus-bls12-381

* port crypto-config

* port crypto-commit

* port crypto-block

* port crypto-address-ss58

* port crypto-address-keccak256

* port crypto-address-bech32m

* port crypto-address-bech32

* port crypto-address-base58

* port core

* port contracts

* port container

* update tsconfig to nodenext

* fix kleur/color

* update core/bin/run.js

* command fixes

* lmdb import fixes

* p2p fixes

* ajv fix

* get __dirname

* update pnpm-lock.yaml

* remove unused @pm2/io dependency

* replace fileURLToPath

* use filesystem service inside kernel

* cleanup

* update TypeScript to 5.4.2

* move __dirname into local scope

* replace fast-memoize with memoizee

* test-runner packacge

* re-export test-runner

* tests: utils

* tests: validation

* tests: crypto-config

* tests: container

* tests: kernel

* tests: transactions

* style: resolve style guide violations

* fix more tests

* fix transaction dependency lookup

* fix p2p tests

* more fixes

* fix cli and configuration-generator

* cli fixes

* kernel fixes

* transaction-pool

* all pass

* commit dirty

* style: resolve style guide violations

* fix api-http integration tests

* fix deps:check

* runtime fixes

---------

Co-authored-by: oXtxNt9U <[email protected]>
Co-authored-by: sebastijankuzner <[email protected]>

* fix(api): broken entrypoint (#481)

* fix api entrypoint

* fix more commands

* refactor(transaction-pool): return tx indexes as integers (#483)

* return tx indexes as integers

* fix compile error

* chore: update dependencies (#482)

* update dependencies

* Empyt commit

---------

Co-authored-by: sebastijankuzner <[email protected]>

* fix wallet response (#485)

* fix(configuration-generator): create genesis block script (#484)

* fix create genesis block script

* Empty commit

---------

Co-authored-by: sebastijankuzner <[email protected]>

* refactor(core): rename run script to have explicit file extension (#486)

* ensure run script has explicit file extension

fixes ERR_UNKNOWN_FILE_EXTENSION

* empty commit

* fix: use .js extension in `start` commands (#487)

* Fix start commands

* Fix package.json

* Fix tests

* release: 0.0.1-alpha.12 (#488)

* release: 0.0.1-alpha.12

* style: resolve style guide violations

---------

Co-authored-by: sebastijankuzner <[email protected]>

* fix(core): resolve correct plugin `package.json` path (#489)

* Fix package manifest

* Skip tests

* release: 0.0.1-alpha.13 (#490)

* release: 0.0.1-alpha.13

* style: resolve style guide violations

---------

Co-authored-by: sebastijankuzner <[email protected]>

* feat(cli): determine correct entrypoint paths (#491)

* Add setup class

* Fix setup

* Bind

* Fixes

* Use setup paths

* Use in api

* Remove logs

* Fix tests

* Cleanup tests

* fix(test-framework): list project packages in dependencies (#492)

* Use direct dependencies

* Empty commit

* Fix dependencies

* Fix dependencies

* style: resolve style guide violations

---------

Co-authored-by: sebastijankuzner <[email protected]>

* exclude genesis transactions from fee statistics calculation (#494)

* fix(crypto): manage static fees via milestones (#493)

* add static fees to milestones

* update tests

* style: resolve style guide violations

* initialize static fees only in a single place

---------

Co-authored-by: oXtxNt9U <[email protected]>

* fix(api): sync active milestones on change (#495)

* sync active milestones on change

* fix test

* fix(api-http): add missing fields to transaction resource (#496)

* improve error logging

* populate all transaction fields

* review

* remove type cast

* add comment

* simplify more

* rename block model too and add assert

* fix paths according to the latest paths naming convention (#497)

* refactor(p2p): replace ip with `url` in api nodes (#498)

* api node urls

* update protobuf definitions

* update test fixtures

* cleanup

* style: resolve style guide violations

---------

Co-authored-by: oXtxNt9U <[email protected]>

* fix(transaction-pool): invalid tx error reporting (#500)

* fix tx pool error reporting

* empty commit

* test: use `tsx` TypeScript loader (#499)

* Add tsx

* Fix runner

* Fix test-runner scripts

* Update tsconfig

* Fix tests

* Use test config

* Fix api tests

* api-common

* Api-database

* api-development

* api-http

* api-sync

* api-transaction-pool

* bootstrap

* cli partial

* Fix cli tests

* Runner extends contracts

* Configuration generator

* Consensus

* Container

* Contracts

* Core

* Crypto address

* Crypto block

* Cypto commit

* Crypto config

* Crypto

* Crypto messages

* Crypto signature

* Crypto transaction

* Crypto

* Database

* Fees

* Kernel

* Logger pino

* Logger winston

* Networking

* Server

* Processor, proposer, serializer

* State

* Transaction pool

* Transactions

* Utils

* Validation

* Validator

* Validator set

* Webhooks

* Remove tsm

* Fix integration tests

* Update lint CI

* Fix dependencies

* Prettier

* Lint

* Perttier

* style: resolve style guide violations

* refactor: remove `__dirname` usage (#501)

* Remove __dirname

* Fix tests

* Factory require config

* test(functional/consensus): add skeleton for functional tests (#503)

* Prepare base structure

* Add test runner

* Base test

* Add base packages

* Register base packages

* Add config

* Add pacakges

* Export bootstrap

* Export individual bootstrappers

* Register bootstrappers

* Extract bootstrapper itnerface

* Test

* Use tsm

* Pass url to PluginManifest

* Register service provider

* Setup up to validator package

* Register all necessary packages

* Add missing packages

* Boot

* Register transactions

* Process genesis

* Run consensus

* Add worker

* Fix worker

* Fix broadcaster

* refactor(consensus-storage): extract storage logic into package (#502)

* Add consensus storage package

* Prepare service provider

* Remove storage from consensus

* Add dependencies

* Move root into consensus storage

* Rename identifier

* Fix identifiers

* Edit contracts

* Fix deps

* Update packages/consensus-storage/README.md

Co-authored-by: oXtxNt9U <[email protected]>

---------

Co-authored-by: oXtxNt9U <[email protected]>

* milestone generator add static fees (#504)

* test(functional/transaction-pool-api): initial boilerplate and tests (#505)

* update gitignore

* add tx pool api boilerplate and basic broadcast

* add signWithKeyPair to tx builder

* update functional consensus milestones

* wait for block and assert committed transaction

* invalid transfer test

* assert invalid transactions are not committed

* test with invalid / malformed signature

* fix(test-runner): rethrow error in runHook (#506)

* bubble up error thrown in runHook

* Empty

---------

Co-authored-by: sebastijankuzner <[email protected]>

* refactor(database): return commits instead blocks (#507)

* getBlock to getCommit

* Fix tests

* getLastBlock -> getLastCommit

* Fix tests

* Implement isEmpty

* Fix tests

* feat(transaction-pool): support `in-memory` database (#510)

* Support im memory database

* Deps

* Test

* style: resolve style guide violations

---------

Co-authored-by: sebastijankuzner <[email protected]>

* test(functional/consensus): prepare package replacements, asserts and p2p layer (#508)

* Bind consensus storage

* Mock database

* Add contracts

* Use relative paths

* Prepare 2 setups

* Run 2 nodes

* Make log protected

* Make MemoryLogger fields protected

* Prepare custom logger

* Prepare p2p layer

* Fix p2p

* MemoryDatabase

* Load crypto

* Read validators

* Prepare validators

* Use common config

* Add snooze for one block

* Stop node

* Snooze for block

* Prepare smaller config

* Asserts

* Fix and check TS code

* Add script for check & test

* Use strict true

* Support plugin options

* Assert validators

* refactor(kernel): create bootstraper for shutdown signals  (#511)

* Register error handler first

* Move listen to shutdown signals into bootstrapper

* test(functional/transaction-pool-api): test all transaction types (#509)

* missing dependency

* transfer

* vote

* username-registration

* username-resignation

* validator-registration

* validator-resignation

* multipayment

* fix default payload

* update utils

* multi signature test plus fixes

* fix compile error

* test transfer with multisig

* rename tests for clarity

* add wallets to context

* tsc strict

* add snapshot based balance checks

* reduce block time

* review

* test(functional/transaction-pool): increase vote coverage (#512)

* votes

* empty commit

* test switch vote and unvote for non voted validator

* test(functional/transaction-pool): increase validator registration coverage (#513)

* votes

* empty commit

* validator registration

* empty commit

* test(functional/transaction-pool): increase validator resignation coverage (#514)

* votes

* empty commit

* validator resignation

* empty commit

* test(functional/transaction-pool): increase username registration coverage (#515)

* votes

* empty commit

* username registration

* empty commit

* test(functional/transaction-pool): increase username resignation coverage (#516)

* votes

* empty commit

* username resignation

* empty commit

* fix(kernel): minority and majority calculation (#520)

* Fix majority, minority

* Tests

* Add extra tests

* fix(api-http): allow 0 nonce in schema (#521)

* Allow nonce 0

* Empty commit

* fix(api-http): implement missing `/transaction/fees` route (#523)

* implement missing route /transaction/fees

* add test

* style: resolve style guide violations

* remove unused query param

---------

Co-authored-by: oXtxNt9U <[email protected]>

* test(functional/transaction-pool): increase multi sig registration coverage  (#517)

* more multi signature tests

* empty commit

* update min participants

* test missing participant signature

* test(functional/transaction-pool): add more misc coverage  (#518)

* more multi signature tests

* empty commit

* add misc tests

* empty commit

* release: 0.0.1-alpha.14 (#522)

* release: 0.0.1-alpha.14

* style: resolve style guide violations

---------

Co-authored-by: sebastijankuzner <[email protected]>

* feat(consensus): emit events (#524)

* Add bootstrapped

* New round

* Add events

* Dispatch events

* Fix tests

* test(functional/transaction-pool): extract transaction builders into separate package (#525)

* introduce test-transaction-builders package

* use test transactions package

* include type when logging rejected tx

* style: resolve style guide violations

* fix deps:check

* style: resolve style guide violations

---------

Co-authored-by: oXtxNt9U <[email protected]>

* test(functional/consensus): test proposal scenarios (#526)

* Add initial test

* Rename base test

* Optional blockId

* Full test

* Bind custom proposer selector

* Check generatorPublic key

* Make consensus methods protected

* Expose boot and bootstrap methods

* Skip error handler registration

* Make consensus methods public

* Assert blockRound

* Implement *Many helpers

* Fix base test

* Force async to p2p

* Test missing propose

* Simulate double propose

* Simulate 50:50 split

* Remove assertCommitValidators

* Record messages

* Asserts

* majority minority split

* SnozeForBlock with height

* Assert next block is fine

* Check multiple rounds

* Check invalid proposer

* Add CI for functional

* Rename tests to proposal

* Rename tests

* fix(api-http): delegate search (#527)

* Fix delegate search in API

* Initial support for sorting on jsonb fields

* Update tests

* style: resolve style guide violations

---------

Co-authored-by: oXtxNt9U <[email protected]>

* refactor(p2p): log route on codec error (#528)

* Log error

* Allow empty

* test(functional/transaction-pool): add .gitkeep (#530)

* add .gitkeep

* empty commit

* test(functional/consensus): test prevote & precommit scenarios (#529)

* Check minority not prevoting

* Test null prevotes

* Extract methods to utils

* Check random block

* Check with multiple prevotes

* Lint

* Fix ts errors

* Disable unicorn/no-useless-undefined

* Check missing precommits

* Test precommits

* Check multiple messages

* fix(configuration-generator): update export paths (#531)

* Update paths

* Empty

* feat(api-development): add `peers/banned` endpoint (#532)

* Disposer returns list of banned peers

* Add endpoint

* Add pagiantion

* Format timeout

* style: resolve style guide violations

---------

Co-authored-by: sebastijankuzner <[email protected]>

* test(functional): update ci workflow (#534)

* run all functional tests in ci

* test

* style: resolve style guide violations

* test

* revert me

* style: resolve style guide violations

* include matrix name

* revert trigger

---------

Co-authored-by: oXtxNt9U <[email protected]>

* test(functional/consensus): test rejection of invalid block proposals (#533)

* custom funded wallet provider

* REVERT ME: debug logs

* export Proposer

* custom block proposal

* emit event on invalid block

* add assertInvalidBlock

* extract custom proposal function

* ensure wallet exists on each node

* invalid proposals

* seed with randomBytes

* log error instance on mismatch

* lint

* Revert "REVERT ME: debug logs"

This reverts commit defdf7eb3b45718e81a0a11f73246ed6ff6c76ed.

* deps: update lmdb (#535)

* Update lmdb

* Log if commit cannot be read

* Await transaction flushed

* Await flush

* test(functional): fix `MaxListenersExceeded` warning (#537)

* fix MaxListenersExceededWarning

* empty commit

* feat(api-http): support sorting on jsonb attributes (#538)

* support sort on wallet attributes

* NULLS LAST

* tests

* style: resolve style guide violations

---------

Co-authored-by: oXtxNt9U <[email protected]>

* fix(p2p): peer ban and validate ip plugin (#539)

* Skip header check if peer is not in repo

* Validate peer ip

* Remove repo check

* Validate ip and data separately

* Fix test

* Update default peer ban time

* feat(cli): add --overwrite flag to `config:publish:custom` (#536)

* expose `skip` callback

* update publish:custom command

* style: resolve style guide violations

* Make fields optional

* Require flags error

---------

Co-authored-by: oXtxNt9U <[email protected]>
Co-authored-by: sebastijankuzner <[email protected]>

* feat(crypto): add browser support for bls12-381 packages (#540)

* add bls12-381 browser support

* update test

* style: resolve style guide violations

* dep check exception

---------

Co-authored-by: oXtxNt9U <[email protected]>

* release: 0.0.1-alpha.15 (#542)

* release: 0.0.1-alpha.15

* style: resolve style guide violations

---------

Co-authored-by: sebastijankuzner <[email protected]>

* fix(p2p): postTransactions response schema and proto (#543)

* Update proto

* Build proto

* Fix schema

* Fix tests

* refactor(api): show `meta` field in response at top (#545)

* show `meta` field in response at top

* style: resolve style guide violations

* eslint: disable key sort

---------

Co-authored-by: oXtxNt9U <[email protected]>

* fix(api-http): change default sort for `/delegates` (#544)

* sort /delegates by rank by default

* empty commit

* refactor(block-processor): log commit round (#546)

* Log block round

* Empty commit

* perf(consensus): verify proposal signatures on main thread (#548)

* Verify signature on main thread

* Empty commit

* refactor(contracts): remove Consensus prefix from contracts (#549)

* Rename contracts

* Empty commit

* refactor(consensus): remove hasValidBlockGenerator check (#550)

* Remove hasValidBlockGenerator check

* Empty commit

* fix(api-http): sort delegates by rank asc by default (#552)

* sort delegates by rank asc by default

* empty commit

* test(e2e): add e2e tests and workflow (#547)

* network with 3 nodes

* add check for target block height

* workflow

* revert me

* exclude e2e directory

* style: resolve style guide violations

* docker fixes

* test

* add timeout

* test

* wait for checks to finish

* run detached

* show logs

* style: resolve style guide violations

* increase sleep

* increase target height

* revert trigger condition

* revert changes to defaults

* style: resolve style guide violations

* reply with 200

* Update tests/e2e/consensus/checks/index.mjs

Co-authored-by: Sebastijan K. <[email protected]>

* reduce timeout for now

---------

Co-authored-by: oXtxNt9U <[email protected]>
Co-authored-by: Sebastijan K. <[email protected]>

* release: 0.0.1-alpha.16 (#553)

* release: 0.0.1-alpha.16

* style: resolve style guide violations

---------

Co-authored-by: sebastijankuzner <[email protected]>

* feat(validator): support secret encryption (#554)

* remove skipValidation flag

* write validator keystore

* support validator with encrypted passphrase

* update commands

* update tests

* optional keystore

* style: resolve style guide violations

* support --password

* review

* style: resolve style guide violations

---------

Co-authored-by: oXtxNt9U <[email protected]>

* perf: deserialize proposal in steps (#551)

* Rename ProposedBlock to ProposedData

* Remove ProposedBlockJson

* Rename proposal.block to proposal.data

* Fix consensus tests

* Fix crypto-message tests

* Add getData and isDataDeserialized

* Fix consensus tests

* Test proposal

* Rename method

* Make makeProposedDataFromBytes public

* Make proposal injectable

* Fix tests

* Add deserialize to proposal

* Check status before returning data

* Include deserializer

* Fix tests

* Pass only serialized data to proposal

* Deserialize in proposal processor

* Deserialize in handler

* Remove todo

* Fix tests

* Fix header

* Verify lock proof after deserialization

* Fix functional tests

* Fix proposal types

* Fix proposal creation

* perf(consensus): run pending RoundStates only once (#555)

* Set pending jobs

* Remove key

* Reduce complexity

* update test

* style: resolve style guide violations

* fix deps

* register evm

---------

Co-authored-by: Sebastijan K <[email protected]>
Co-authored-by: sebastijankuzner <[email protected]>
Co-authored-by: Adrian Kerchev <[email protected]>
Co-authored-by: Edgar Goetzendorff <[email protected]>
Co-authored-by: oXtxNt9U <[email protected]>
Co-authored-by: sebastijankuzner <[email protected]>

* chore(evm): update deps (#560)

* update deps

* fix compile error

* test(functional/transaction-pool): setup evm call (#561)

* add builder

* update genesis block

* bind evm-development data

* resolve tx pool actions

* add evm call builder and emit event

* tx pool api test

* style: resolve style guide violations

* fix test

* lint

* multi sig fixes

* remove event for now, check committed tx instead

* fix check error

---------

Co-authored-by: oXtxNt9U <[email protected]>

* refactor(evm): split process and commit (#563)

* update napi

* split process and commit

* fix mock

* call commit on evm

* update tests

* add round_key and auto commit

* update interfaces

* enrich evm context

* update tests

* handle missing pending commit gracefully

* remove debug logs, add asserts

* test auto commit

* rename commit key

* commit fixes and add test

* style: resolve style guide violations

* reduce block time in functional tests

* improve tests stability

* keep separate view function

* style: resolve style guide violations

* fix compile error

* style: resolve style guide violations

* remove auto commit feature

---------

Co-authored-by: oXtxNt9U <[email protected]>

* feat(evm): database backend (#570)

* update Cargo.toml

* remove unused code

* add PersistentDB and EpheremalDB implementations

* update process and commit

* inject data path on evm instance creation

* update unit tests

* clean up

* style: resolve style guide violations

* ensure tmp data path

* store commits and make block processing immutable

---------

Co-authored-by: oXtxNt9U <[email protected]>

* chore: merge develop to evm (#578)

* deps: clean dependendies and add check script (#450)

* Ignore eslint in scripts

* Use async calls

* Ignore tests

* Show testonly dependencies

* Calculate deps

* Add docs

* Implement methods on Package

* Cleanup

* Rename deps to imports

* Fix exceptions

* Pass method

* Go trough all packages

* Improve logs

* Rename file

* Remove old scripts

* Exit with 1 if failing

* Fix validator-set-vote-weighted

* Validator set static

* Fix validator

* Fix utils

* Fix transaction pool

* Fix test-framework

* Fix packages

* Add deps check

* style: resolve style guide violations

* Fix ci

* Fix api

* style: resolve style guide violations

---------

Co-authored-by: sebastijankuzner <[email protected]>

* feat(bootstrap): compare stored genesis block with config (#451)

* Check stored commit

* Empty commit

* refactor(processor): log verification errors (#452)

* Remove console logs

* Remove forger errors

* Remove UnexpectedError

* Remove extra exceptions

* Add ValidatorExceptions

* Handler throws errors

* Improve logs

* style: resolve style guide violations

---------

Co-authored-by: sebastijankuzner <[email protected]>

* chore: change banner format to jpeg (#453)

* Add banner jpeg

* Remove png version

* Update readme

* release: 0.0.1-alpha.8 (#454)

* release: 0.0.1-alpha.8

* style: resolve style guide violations

---------

Co-authored-by: sebastijankuzner <[email protected]>

* fix(validator-set-vote-weighted): active validators is subset of registered validators (#466)

* Mak method private

* Build validators

* Local variable

* Use for of loop

* Check active validators

* Fix tests

* fix(processor): `validatorVoteBalance` calculation (#467)

* Add pg:reset

* Decrease vote balance

* Include fee

* Remove unused line

* style: resolve style guide violations

---------

Co-authored-by: sebastijankuzner <[email protected]>

* chore: docker validator support (#468)

* release: 0.0.1-alpha.9 (#469)

* release: 0.0.1-alpha.9

* style: resolve style guide violations

---------

Co-authored-by: sebastijankuzner <[email protected]>

* chore: fix publish GitHub workflow (#470)

* Run on pull request

* No git checks

* set token

* Revert to original build conditions

---------

Co-authored-by: oXtxNt9U <[email protected]>

* refactor(transactions): move amount deduction into transaction handlers (#472)

* refactor transfer amount deduction

* cleanup

* update schema tests

* feat: add `env:paths:clear` commands (#473)

* Clear plugins & exports

* Clear data

* Remove variables

* Add paths to contracts

* Remove config paths

* Cache cache, log, temp

* Cleanup

* Add command to api

* Add clear all

* Fix case

* release: 0.0.1-alpha.10 (#474)

* release: 0.0.1-alpha.10

* style: resolve style guide violations

---------

Co-authored-by: sebastijankuzner <[email protected]>

* feat(crypto-transaction-username-registration): limit one transaction by sender in pool (#475)

* Rename variable

* Fix text

* Check transaction already in the pool

* feat(validator): log loaded validators (#477)

* Inject

* Print method

* Print on bootstrap

* Rename method

* Execute after state check

* Improve text

* Log 0 validators

* Determine activa & standby

* Wallet to string

* chore: fix typo in transaction fee errors (#476)

* feat(state): implements `sizeOfIndex` on WalletRepository (#479)

* Add sizeOfIndex

* Add initial implementation

* Wallet repository clone

* Implement on wallet repo clone

* Add missing attribute

* FIx validator resignation

* release: 0.0.1-alpha.11 (#480)

* release: 0.0.1-alpha.11

* style: resolve style guide violations

---------

Co-authored-by: sebastijankuzner <[email protected]>

* feat: port to ES modules (#478)

* initial browser support

* add package link script

* port api-common

* port api-database

* port api-development

* port api-http

* port api-sync

* port api-transaction-pool

* port api

* port bootstrap

* port cli

* port configuration-generator

* port consensus

* port webhooks

* port validator

* port validator-set-vote-weighted

* port validator-set-static

* port validation

* port utils

* port transactions

* port transaction-pool

* port test-framework

* port state

* port serializer

* port proposer

* port processor

* port p2p

* port networking-ntp

* port networking-dns

* port logger-winston

* port logger-pino

* port kernel

* port fees

* port fees-static

* port fees-managed

* port fees-burn

* port database

* port crypto-worker

* port crypto-wif

* port crypto-validation

* port crypto-transaction

* port crypto-transaction-vote

* port crypto-transaction-validator-resignation

* port crypto-transaction-validator-registration

* port crypto-transaction-username-resignation

* port crypto-transaction-username-registration

* port crypto-transaction-transfer

* port crypto-transaction-multi-signature-registration

* port crypto-transaction-multi-payment

* port crypto-signature-schnorr

* port crypto-signature-schnorr-secp256k1

* port crypto-signature-ed25519

* port crypto-signature-ecdsa

* port crypto-signature-bls12-381

* port crypto-messages

* port crypto-key-pair-schnorr

* port crypto-key-pair-ed25519

* port crypto-key-pair-ecdsa

* port crypto-key-pair-bls12-381

* port crypto-hash-wasm

* port crypto-hash-noble

* port crypto-hash-bcrypto

* port crypto-consensus-bls12-381

* port crypto-config

* port crypto-commit

* port crypto-block

* port crypto-address-ss58

* port crypto-address-keccak256

* port crypto-address-bech32m

* port crypto-address-bech32

* port crypto-address-base58

* port core

* port contracts

* port container

* update tsconfig to nodenext

* fix kleur/color

* update core/bin/run.js

* command fixes

* lmdb import fixes

* p2p fixes

* ajv fix

* get __dirname

* update pnpm-lock.yaml

* remove unused @pm2/io dependency

* replace fileURLToPath

* use filesystem service inside kernel

* cleanup

* update TypeScript to 5.4.2

* move __dirname into local scope

* replace fast-memoize with memoizee

* test-runner packacge

* re-export test-runner

* tests: utils

* tests: validation

* tests: crypto-config

* tests: container

* tests: kernel

* tests: transactions

* style: resolve style guide violations

* fix more tests

* fix transaction dependency lookup

* fix p2p tests

* more fixes

* fix cli and configuration-generator

* cli fixes

* kernel fixes

* transaction-pool

* all pass

* commit dirty

* style: resolve style guide violations

* fix api-http integration tests

* fix deps:check

* runtime fixes

---------

Co-authored-by: oXtxNt9U <[email protected]>
Co-authored-by: sebastijankuzner <[email protected]>

* fix(api): broken entrypoint (#481)

* fix api entrypoint

* fix more commands

* refactor(transaction-pool): return tx indexes as integers (#483)

* return tx indexes as integers

* fix compile error

* chore: update dependencies (#482)

* update dependencies

* Empyt commit

---------

Co-authored-by: sebastijankuzner <[email protected]>

* fix wallet response (#485)

* fix(configuration-generator): create genesis block script (#484)

* fix create genesis block script

* Empty commit

---------

Co-authored-by: sebastijankuzner <[email protected]>

* refactor(core): rename run script to have explicit file extension (#486)

* ensure run script has explicit file extension

fixes ERR_UNKNOWN_FILE_EXTENSION

* empty commit

* fix: use .js extension in `start` commands (#487)

* Fix start commands

* Fix package.json

* Fix tests

* release: 0.0.1-alpha.12 (#488)

* release: 0.0.1-alpha.12

* style: resolve style guide violations

---------

Co-authored-by: sebastijankuzner <[email protected]>

* fix(core): resolve correct plugin `package.json` path (#489)

* Fix package manifest

* Skip tests

* release: 0.0.1-alpha.13 (#490)

* release: 0.0.1-alpha.13

* style: resolve style guide violations

---------

Co-authored-by: sebastijankuzner <[email protected]>

* feat(cli): determine correct entrypoint paths (#491)

* Add setup class

* Fix setup

* Bind

* Fixes

* Use setup paths

* Use in api

* Remove logs

* Fix tests

* Cleanup tests

* fix(test-framework): list project packages in dependencies (#492)

* Use direct dependencies

* Empty c…
  • Loading branch information
6 people authored Sep 17, 2024
1 parent 1d5f57a commit c32a929
Show file tree
Hide file tree
Showing 470 changed files with 36,594 additions and 10,288 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/deps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ jobs:
restore-keys: ${{ runner.os }}-lerna-
- name: Install dependencies
run: pnpm install
- name: Build
run: pnpm run build
- name: Check dependencies
run: pnpm run deps:check
strategy:
Expand Down
130 changes: 110 additions & 20 deletions .github/workflows/publish-develop.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,105 @@
name: Publish (Develop)
name: Publish (Evm)

env:
DEBUG: napi:*
APP_NAME: evm
MACOSX_DEPLOYMENT_TARGET: "10.13"
permissions:
contents: write
id-token: write

on:
push:
branches:
- "develop"

permissions:
contents: read
- "evm"

jobs:
build:
if: "contains(github.event.head_commit.message, 'release:')"

runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
settings:
- host: ubuntu-latest
target: x86_64-unknown-linux-gnu
docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-debian
build: rustup update stable && cd ./packages/evm && pnpm run build-napi --target x86_64-unknown-linux-gnu
- host: ubuntu-latest
target: x86_64-unknown-linux-musl
docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine
build: rustup update stable && cd ./packages/evm && pnpm run build-napi --target x86_64-unknown-linux-musl
- host: ubuntu-latest
target: aarch64-unknown-linux-gnu
docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-debian-aarch64
build: rustup update stable && cd ./packages/evm && pnpm run build-napi --target aarch64-unknown-linux-gnu
- host: ubuntu-latest
target: aarch64-unknown-linux-musl
docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine
build: |-
set -e &&
rustup target add aarch64-unknown-linux-musl &&
rustup update stable && cd ./packages/evm && pnpm run build-napi --target aarch64-unknown-linux-musl
name: stable - ${{ matrix.settings.target }} - node@20
runs-on: ${{ matrix.settings.host }}

steps:
- uses: actions/checkout@v4

- name: Setup node
uses: actions/setup-node@v4
with:
node-version: "20.x"

- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
run_install: false
version: latest

- name: Get pnpm store directory
id: pnpm-cache
run: echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
shell: bash
- name: Cache pnpm modules
uses: actions/cache@v4
with:
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
restore-keys: ${{ runner.os }}-pnpm-

- name: Install dependencies
run: pnpm install

- name: Build in docker
uses: addnab/docker-run-action@v3
if: ${{ matrix.settings.docker }}
with:
ref: ${{ github.head_ref }}
image: ${{ matrix.settings.docker }}
options: "--user 0:0 -v ${{ github.workspace }}/.cargo-cache/git/db:/usr/local/cargo/git/db -v ${{ github.workspace }}/.cargo/registry/cache:/usr/local/cargo/registry/cache -v ${{ github.workspace }}/.cargo/registry/index:/usr/local/cargo/registry/index -v ${{ github.workspace }}:/build -w /build"
run: ${{ matrix.settings.build }}

- uses: actions/setup-node@v4
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
node-version: ${{ matrix.node-version }}
name: bindings-${{ matrix.settings.target }}
path: ./packages/evm/${{ env.APP_NAME }}.*.node
if-no-files-found: error

publish:
name: Publish
if: "contains(github.event.head_commit.message, 'release:')"
runs-on: ubuntu-latest
needs:
- build
steps:
- uses: actions/checkout@v4

- name: Setup node
uses: actions/setup-node@v4
with:
node-version: "20.x"
registry-url: https://registry.npmjs.org/

- name: Setup pnpm
Expand All @@ -40,30 +118,42 @@ jobs:
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
restore-keys: ${{ runner.os }}-pnpm-

- name: Cache lerna
uses: actions/cache@v4
with:
key: ${{ runner.os }}-lerna
path: ./.cache
restore-keys: ${{ runner.os }}-lerna-

- name: Install dependencies
run: pnpm install

- name: Build
run: pnpm run build

- name: Publish to NPM
run: |
pnpm run release -- --publish-branch=develop --tag=alpha
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: ./packages/evm/artifacts

- name: Set dist-tag latest
- name: Move artifacts
working-directory: ./packages/evm
run: pnpm artifacts

- name: List packages
working-directory: ./packages/evm
run: ls -R ./npm
shell: bash

- name: Publish to NPM
run: |
bash ./scripts/dist-tag-latest.sh
pnpm run release -- --publish-branch=evm --tag=evm
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}

strategy:
matrix:
node-version:
- 20.x
# - name: Set dist-tag latest
# run: |
# bash ./scripts/dist-tag-latest.sh
# env:
# NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
16 changes: 16 additions & 0 deletions .github/workflows/unit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ jobs:
run: cd packages/api-database && pnpm run test
- name: Test api-development
run: cd packages/api-development && pnpm run test
- name: Test api-evm
run: cd packages/api-evm && pnpm run test
- name: Test api-http
run: cd packages/api-http && pnpm run test
- name: Test api-sync
Expand Down Expand Up @@ -112,6 +114,8 @@ jobs:
run: cd packages/crypto-signature-schnorr-secp256k1 && pnpm run test
- name: Test crypto-transaction
run: cd packages/crypto-transaction && pnpm run test
- name: Test crypto-transaction-evm-call
run: cd packages/crypto-transaction-evm-call && pnpm run test
- name: Test crypto-transaction-multi-payment
run: cd packages/crypto-transaction-multi-payment && pnpm run test
- name: Test crypto-transaction-multi-signature-registration
Expand All @@ -137,6 +141,16 @@ jobs:
run: cd packages/crypto-worker && pnpm run test
- name: Test database
run: cd packages/database && pnpm run test
- name: Test evm
run: cd packages/evm && pnpm run test
- name: Test evm-api-worker
run: cd packages/evm-api-worker && pnpm run test
- name: Test evm-development
run: cd packages/evm-development && pnpm run test
- name: Test evm-gas-fee
run: cd packages/evm-gas-fee && pnpm run test
- name: Test evm-service
run: cd packages/evm-service && pnpm run test
- name: Test fees
run: cd packages/fees && pnpm run test
- name: Test fees-burn
Expand Down Expand Up @@ -171,6 +185,8 @@ jobs:
run: cd packages/test-runner && pnpm run test
- name: Test test-transaction-builders
run: cd packages/test-transaction-builders && pnpm run test
- name: Test transaction-pool-broadcaster
run: cd packages/transaction-pool-broadcaster && pnpm run test
- name: Test transaction-pool-service
run: cd packages/transaction-pool-service && pnpm run test
- name: Test transaction-pool-worker
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -128,4 +128,4 @@ tags
:memory:

tests/functional/**/paths/data/**
!tests/functional/**/paths/data/.gitkeep
!tests/functional/**/paths/data/.gitkeep
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "node_modules/lerna/schemas/lerna-schema.json",
"useWorkspaces": true,
"version": "0.0.1-alpha.20"
"version": "0.0.1-evm.1"
}
14 changes: 12 additions & 2 deletions nx.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
{
"namedInputs": {
"default": ["{projectRoot}/source/**/!(*.test).ts"],
"default": [
"{projectRoot}/source/**/!(*.test).ts",
"{projectRoot}/core/**/*.rs",
"{projectRoot}/bindings/**/*.rs",
"{projectRoot}/**/Cargo.toml"
],
"production": ["default"]
},
"tasksRunnerOptions": {
Expand All @@ -16,7 +21,12 @@
"build": {
"dependsOn": ["^build"],
"inputs": ["default"],
"outputs": ["{projectRoot}/distribution"]
"outputs": [
"{projectRoot}/distribution",
"{projectRoot}/index.d.ts",
"{projectRoot}/index.js",
"{projectRoot}/evm.*.node"
]
}
},
"$schema": "./node_modules/nx/schemas/nx-schema.json"
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"sort": "sort-package-json \"package.json\" \"packages/*/package.json\"",
"test:integration": "lerna run test:integration --parallel",
"test:unit": "lerna run test --parallel",
"version": "lerna version --no-git-tag-version --yes",
"workflows:unit": "node scripts/generate-unit-workflow.js"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/api-common/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mainsail/api-common",
"version": "0.0.1-alpha.20",
"version": "0.0.1-evm.1",
"description": "Common API building blocks for the Mainsail blockchain",
"license": "GPL-3.0-only",
"contributors": [],
Expand Down
2 changes: 1 addition & 1 deletion packages/api-database/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mainsail/api-database",
"version": "0.0.1-alpha.20",
"version": "0.0.1-evm.1",
"description": "API database for the Mainsail blockchain",
"license": "GPL-3.0-only",
"contributors": [],
Expand Down
15 changes: 13 additions & 2 deletions packages/api-database/source/contracts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
Configuration,
Peer,
Plugin,
Receipt,
State,
Transaction,
TransactionType,
Expand Down Expand Up @@ -73,7 +74,7 @@ export type FeeStatistics = {
};

export type TransactionRepositoryExtension = {
findManyByCritera(
findManyByCriteria(
walletRepository: WalletRepository,
transactionCriteria: Criteria.OrTransactionCriteria,
sorting: Sorting,
Expand All @@ -89,11 +90,20 @@ export type ValidatorRoundRepositoryExtension = {};
export type ValidatorRoundRepository = ExtendedRepository<ValidatorRound> & ValidatorRoundRepositoryExtension;
export type PluginRepositoryExtension = {};
export type PluginRepository = ExtendedRepository<Plugin> & PluginRepositoryExtension;
export type ReceiptRepositoryExtension = {
findManyByCriteria(
criteria: Criteria.OrReceiptCriteria,
sorting: Sorting,
pagination: Pagination,
options?: Options,
): Promise<ResultsPage<Receipt>>;
};
export type ReceiptRepository = ExtendedRepository<Receipt> & ReceiptRepositoryExtension;
export type StateRepositoryExtension = {};
export type StateRepository = ExtendedRepository<State> & StateRepositoryExtension;

export type WalletRepositoryExtension = {
findManyByCritera(
findManyByCriteria(
walletCriteria: Criteria.OrWalletCriteria,
sorting: Sorting,
pagination: Pagination,
Expand All @@ -113,6 +123,7 @@ export type ApiNodeRepositoryFactory = (customDataSource?: RepositoryDataSource)
export type BlockRepositoryFactory = (customDataSource?: RepositoryDataSource) => BlockRepository;
export type ConfigurationRepositoryFactory = (customDataSource?: RepositoryDataSource) => ConfigurationRepository;
export type PeerRepositoryFactory = (customDataSource?: RepositoryDataSource) => PeerRepository;
export type ReceiptRepositoryFactory = (customDataSource?: RepositoryDataSource) => ReceiptRepository;
export type TransactionRepositoryFactory = (customDataSource?: RepositoryDataSource) => TransactionRepository;
export type TransactionTypeRepositoryFactory = (customDataSource?: RepositoryDataSource) => TransactionTypeRepository;
export type ValidatorRoundRepositoryFactory = (customDataSource?: RepositoryDataSource) => ValidatorRoundRepository;
Expand Down
1 change: 1 addition & 0 deletions packages/api-database/source/identifiers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export const Identifiers = {
Migrations: Symbol.for("API<Migrations>"),
PeerRepositoryFactory: Symbol.for("API<Factory.PeerRepositoryFactory>"),
PluginRepositoryFactory: Symbol.for("API<Factory.PluginRepositoryFactory>"),
ReceiptRepositoryFactory: Symbol.for("API<Factory.ReceiptRepositoryFactory>"),
StateRepositoryFactory: Symbol.for("API<Factory.StateRepositoryFactory>"),
TransactionRepositoryFactory: Symbol.for("API<Factory.TransactionRepositoryFactory>"),
TransactionTypeRepositoryFactory: Symbol.for("API<Factory.TransactionTypeRepositoryFactory>"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ export class CreateIndexes1697617471901 implements MigrationInterface {
CREATE INDEX blocks_version ON blocks(version);
CREATE INDEX blocks_validator_round ON blocks(validator_round);
CREATE INDEX receipts_block_height ON receipts(block_height);
CREATE INDEX wallets_balance ON wallets(balance);
CREATE INDEX wallets_attributes ON wallets using GIN(attributes);
`);
Expand Down
17 changes: 14 additions & 3 deletions packages/api-database/source/models/block.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ export class Block {
})
public readonly previousBlock!: string;

@Column({
type: "varchar",
})
public readonly stateHash!: string;

@Column({
nullable: false,
type: "bigint",
Expand All @@ -43,19 +48,25 @@ export class Block {

@Column({
nullable: false,
type: "bigint",
type: "integer",
})
public readonly totalGasUsed!: number;

@Column({
nullable: false,
type: "numeric",
})
public readonly totalAmount!: string;

@Column({
nullable: false,
type: "bigint",
type: "numeric",
})
public readonly totalFee!: string;

@Column({
nullable: false,
type: "bigint",
type: "numeric",
})
public readonly reward!: string;

Expand Down
1 change: 1 addition & 0 deletions packages/api-database/source/models/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ export * from "./block.js";
export * from "./configuration.js";
export * from "./peer.js";
export * from "./plugin.js";
export * from "./receipt.js";
export * from "./state.js";
export * from "./transaction.js";
export * from "./transaction-type.js";
Expand Down
Loading

0 comments on commit c32a929

Please sign in to comment.