Skip to content

Commit

Permalink
chore(release): release v0.6.0 (#1725)
Browse files Browse the repository at this point in the history
* feat: cmd: implement import-runtime subcommand (#1483)

* fix(lib/crypto/ed25519): update ed25519 to use go-schnorrkel bip39 derivation (#1488)

* fix(state) : Update StorageState to load storage from database. (#1486)

* fix(dot/state): fix usage of trie.Snapshot (#1489)

* fix(dot/state,dot/network): improve memory usage when syncing (#1491)

* fix(dot/network): update notificationsProtocol handshakeData to sync.Map (#1492)

* remove log (#1493)

* feat(dot/network): request block justifications when near head (#1499)

* chore(cmd): rename genesis-raw flag and files to genesis, allow raw and human-readable genesis to be passed to it (#1500)

* refactor: docs: Docs Overhaul (#1438)

* Beginning new docs

* Theming set up

* General layouts n links sorted

* Cleaned up

* Updated Commandline

* Cleaned a bit

* Minor cleaning

* Removed todo

* Config page

* Connect to Polkadotjs

* Fixed dev resources

* New categories sorted

* Updated permalink

* Corrected contributor doc

* Removed unused partials

* Tidying

* Removed offical nodes page

* Amended with feed back

* Resolved a majority of feedback

* Ammeded workflows

* Feedback

* Added diagram

* Recent feedback

* Test package content

* Removed comment

* Debugging page

* Block production expansion

* Typos

* Host spec link

Co-authored-by: noot <36753753+noot@users.noreply.github.com>

* chore(codeowners): update codeowners file (#1505)

* fix: cmd/gossamer: Generate random name if --name flag not set (#1506)

* generate random name if --name flag not set

* update tests with name flag to handle random names

* update tests that reference name cfg

* chore(release): Automated release using semantic-release. (#1503)

* feat: dot/telemetry: Implement basic telemetry connection (#1497)

* implement telemetry connection server

* add telemetry for import block

* setup telemetry to use node name from Global config

* init telemetry connections based on genesis.json values

* fix error message formatting

* add tests for telemetry

* implement no-telemetry cli flag

* fix typos

* cleanup error check

* create TelemetryEndpoint struct

* created connection data struct to hold connection data

* make TelemetryEndpoints a pointer reference

* add tests for interfaceToTelemetryEndpoint

* update test to fix random name

* fix: fix edit link (#1507)

* chore(readme): Fix broken image link (#1509)

Co-authored-by: Arijit Das <arijit@chainsafe.io>

* fix(dot/network): fix justification request at head logic (#1510)

* feat(dot/network): implement persistent peers functionality (#1512)

* chore(release): Update name in package.json. (#1514)

* Update package.json.

* Disable package publish to npm.

* Add support to skip a release.

* feat(dot/network): Add cache for network message. (#1511)

* Add cache for network message.

* chore(release): Fix Deepsource error on development branch. (#1516)

* Fix Deepsource error.

* Fix lint issues.

* chore(codeowners): update codeowners file (#1523)

* fix(dot/network): fix receiving notifications messages from substrate peers (#1517)

* chore(.github): remove development from release flow (#1526)

* chore(dot/network, lib/grandpa): update network.ConsensusMessage, add grandpa.NeighbourMessage and handle accordingly (#1519)

* feat: Add properties and chainId on build-spec command (#1520)

* feat(dot/network, lib/grandpa): request justification on receiving NeighbourMessage, verify justification on receipt (#1529)

* fix (dot/rpc, dot/state): state_subscribeStorage to only notify for value changes (#1460)

* move websocket messages and listeners into own files

* fix notifyStorageSubscriptions to only notify for changes

* address PR comments

* add to websocket tests

* repair append, cleanup filter declareation

* fix anti-pattern in log message

* create notifyStorageSubscription for individual sub notify

* add websocket listeners unit tests

* cleanup merge conflicts

* lint

* add sleep timer

* refactor websocket files

* lint

* a locks to fix data race

* implement observer design pattern

* fix race conditions

* add tests

* add tests

* add tests

* add tests

* add tests

* add tests

* add troubleshooting stuff for testing transactions

* save commit

* address PR comments

* lint

* remove unused printf and comments

* fix test

* update tests

* add return from error

* fix(lib/babe): fix BABE state storing after building block (#1536)

* chore(lib/grandpa): update grandpa message types to match substrate (#1534)

* chore(linter): change locale to UK from US (#1533)

* chore(linter): change locale to UK from US

* fix(babe): Fix extrinsic format in block. (#1530)

* chore:remove codecov token (#1542)

* chore(dot/core, dot/state, lib/grandpa): implement GrandpaState, use in DigestHandler and grandpa.Service (#1540)

* chore(dot/state): create BaseState for accessing non-prefixed db keys (#1546)

* feat(lib/grandpa): fully verify justifications using GrandpaState (#1544)

* chore(lib/common) implement MustHexToBigInt (#1547)

* implement MustHexToBigInt

* add tests for panics

* clean-up string checking

* fix(dot/network): Fix notification handshake and reuse stream. (#1545)

* fix: persist node name (#1543)

* fix(dot/network): split stored streams and handshakeData into inbound and outbound (#1553)

* chore(docs): fix image paths for integrate docs page (#1552)

* fix: update go-schnorrkel version (#1557)

* chore: close db if node initialized check fails (#1551)

* feat(dot/network): add propagate return bool to messageHandler func type to determine whether to propagate message or not (#1555)

* feat (dot/telemetry): implement telemetry system.interval message (#1528)

* implement network data sytem interval telemetry message

* add lock to telemetry struct to fix concurrent websocket writes

* implement block data system.interval telemetry message

* address comments

* fix race condition

* fix lint

* update tests

* refactor tests

* use interface{} for channel, add recover

* rename channel doneNetworkTelemetry to closeCh

* fix check for closed channel

* fix error checking

* feat(lib/grandpa): send NeighbourMessage to peers (#1558)

* chore: merge main into development before release (#1559)

* chore: fix merge issues before release

* fix(release): Trigger release when pushed to main branch. (#1566)

* feat: add --chain dev option (#1561)

* fix(dot/sync): fix creating block response, fixes node sync between gossamer nodes (#1572)

* fix(lib/babe): add pre-runtime digest before calling initialize_block (#1581)

* fix(polkadot.js) fix -infinity in keys error by adding genesis field (#1573)

* chore: add polkadotjs tests to ci (#1567)

* chore: add polkadotjs tests to ci

* Update .github/workflows/tests.yml

Co-authored-by: Edward Mack <ed@edwardmack.com>

* chore: update dockerfile to install yarn and cd into js test dir and install dependencies

* chore:updated dockerfile to run polkadotjs tests

* chore: updated deps to include js tests

* chore: removed unneeded command in test wrkflow

* add rpc module to gossamer start-up

* fix linter rants

Co-authored-by: Edward Mack <ed@edwardmack.com>
Co-authored-by: noot <36753753+noot@users.noreply.github.com>

* fix(lib/babe): call AddBlock in BABE synchronously (#1585)

* chore(docs): update README and installation doc to include dev node (#1583)

* fix(docs) rename hosts package to dot packages (#1582)

* chore: improved ci caching for mod and build. Also add codecov id-ci-fail success attribute (#1590)

Co-authored-by: Arijit Das <arijit@chainsafe.io>

* chore: fix block production path and add article links (#1593)

* feat(rpc/subscription): implement state_unsubscribeStorage (#1574)

* implement state_unsubscribeStorage

* add value checks, add tests

* handle string parameter, add tests, use const for error messages

* parse to uint

* update type

* update variable names (based on comments)

Co-authored-by: Arijit Das <arijit@chainsafe.io>

* fix: pending bubble hidden after block included (#1592)

* fix: pending bubble hidden after block included

* chore: fix typo

* chore: change FindExtrinsic to HasExtrinsic

Co-authored-by: noot <36753753+noot@users.noreply.github.com>

* fix(dot/network) track sent/received requests by hash (#1575)

* fix(dot/network): add map to track requests by hash

* chore: remove store request by hash when sync fails

Co-authored-by: noot <36753753+noot@users.noreply.github.com>

* feat(cmd): implement offline pruning of state trie (#1564)

* fix(dot/network): fix discovery between gossamer nodes (#1594)

* fix(utils): create a specific folder for database (#1598)

* feat: create a specific folder for database

* chore: remove unused const

* fix: add default database dir on NodeInitialized function

* fix: change default database dir to db and fix typo

* chore(review): Add Eclesio to code owners (#1601)

* chore(dot/network): use sync.Pool for network message buffers (#1600)

* chore(lib/babe): create BlockBuilder type (#1602)

* fix: update deprecated package (#1603)

* fix(lib/blocktree): fix setting leaves after blocktree pruning (#1605)

* fix(dot/telemetry): refactor telemetry to reduce CPU usage (#1597)

* chore(dot/network): improve CPU usage again; no more mallocs (#1608)

* fix(dot/core): Fix handle transaction message test. (#1607)

* fix(dot/core): Fix handle transaction message test.

* Remove hardcoded extrinsic value.

* Add subkey for Macos.

* Add subkey in the coverage report.

* chore(dot/network): Add test for leb128 to uint64 conversion. (#1614)

* Add test for leb128 to uint86 conversion.

* feat(dot/network): implement streamManager to cleanup not recently used streams (#1611)

* fix(dot/network): implement a handshake timeout (#1615)

* chore: return the bytes read by leb128

* feat: add handshake timeout

* chore: remove debug network loglevel

* chore: get back to trace

* chore: stop ticker no matter the case

* chore: implement timer and use unbuffered

* chore: using defer

* chore: remove the timer.Stop() when the <-timer.C was called

* fix(dot/network): check if peer supports protocol (#1617)

* fix(dot/core): Add only extrinsic during chain reorg. (#1609)

* maintainence: fix network tests on CI  (#1627)

* fix(dot/state, lib/babe, lib/trie): improve syncing between gossamer authority nodes (#1613)

* fix(dot/network, lib/grandpa): fix handshake decoding and grandpa message handler sigabort (#1631)

* chore: remove finalnum inherent, clear babe `slotToProof` map (#1632)

* fix(dot/network): Check for size when decoding leb128. (#1634)

* chore: replace handmade test mocks with auto-generated mocks (#1626)

* chore(lib/blocktree): cache nodes in map (#1633)

* fix(lib/babe): fix timing for transition between epochs (#1636)

* feat(dot/sync): implement codeSubstitutes (#1635)

* chore(deps): bump glob-parent in /tests/polkadotjs_test (#1637)

* feat(dot/state): implement online pruning of historical state tries (#1596)

* chore: updated doc links (#1647)

* chore: updated doc links

* chore: increase timeout

* chore: update linter config

* chore(dot/core, dot/sync, lib/babe): refactor handling on block import to reduce duplicate code (#1645)

* chore: change tests log level to info (#1644)

* chore: change tests log level to info

* chore: revert previus log levels

* chore: fix the corrects levels

* ajust make mock command

* exec go mod tidy

* fix lint

* chore: update docs

* fix(dot/core): check transaction Validity.Propagate field to determine whether to propagate tx (#1643)

* check validate.Propagate field

* add functionality to remove non-propagate txs

* fix mocks

* chore: adding verbosity to golangci

* chore: change the out-format argument golangci

* using print-issued-lines arg

* ínstalling golangci instead use github actions

* lint

* clean-up logic checks

* run make mock

* update comments, fix mock output

* add test for bogus extrinsic

* fix spelling

* change logging level

Co-authored-by: Eclésio Júnior <eclesiomelo.1@gmail.com>

* refactor(lib/scale): refactor lib/scale into own package with idiomatic types, marshalling, and optionality (#1548)

* scale encoding with optionality, struct tag field ordering, uint128

* add indices caching

* add mtx

* add variable data type interface, test to compare old vs new encoding

* fix width int decode and tests

* wip

* []byte, string decoding

* encodeBool and tests

* refactor tests, include optionality tests

* use shared tests in decode

* struct decode tests, and unmarshal refactor

* wip

* decode of VariantDataType, wip tests

* add optionality testing

* fix struct tests and optionality tests

* test VaryingDataType

* wip decode refactor, use reflect.Value as passed param

* repurpose int and uint as compact length encoded integers, remove unnecessary handling of []int

* cleanup, and all tests benchmark

* add README

* update README

* update readme

* update readme

* update README

* update README

* rResult encode/decode and RegisterResult

* wip cr feedback

* add licenses

* add custom primitive encode/decode

* more cr feedback

* cr feedback

* wip

* revise Result

* add readme

* add usage example for Result

* refactor(lib/scale): Revise VaryingDataType interfaces, and introduce VaryingDataTypeSlice (#1651)

* wip VaryingDataType and VaryingDataTypeSlice

* refactor VaryingDataType and add VaryingDataTypeSlice

* update README

* fix lint

* update examples

* fix deepsource

* check decoded in comparison_test

* cr feedback

* fix result.set with nil value

* feat(dot/babe) implement block production time metric (#1648)

* metric: gossamer_proposer_block_constructed

* chore: improve metrics instance and add tests

* chore: add peer check and peerstore metrics

* chore: fix pacakge name and interface to gauge struct

* chore: change to const

* chore: adjust babe metrics

* chore: removing duplicated net metrics

* chore: improve babe time to build block test

* chore: fix CI tests failures

* exec go mod tidy

* chore: go mod

* change docker-compose instructions to docs/ folder

* fix(lib/babe): fix setting first slot of network, fix loading BABE epoch params (#1640)

* chore: replace time.After with time.NewTicker (#1650)

* replace time.After with time.NewTimer

* replace time.Affer with time.NewTicker

* lint

* replace time.After is discovery so ttl var is used

* replace time.After in if statement

* add configuration variables for time duration functions

* feat(dot/telemetry): implement telemetry message network_state (#1618)

* refactor telemetry messages to map format

* add basic network state telemetry message

* refactor message sender to handle interface{} types

* refactor telemetry messages to be structs

* lint

* go fmt

* lint

* move msg building logic outside msg sending loop

* make telemetry messages an interface

* Lookup transactions count from TransactionsState

* address comments

* fix mocks for tests

* lint

* refactor TelemetryMessage to Message

* update mock handler to return result

* add TransactionsCount to mockhandler

* move logic to build new network state message

* lint

* fix interface

* update mockhandler

* lint

* chore: update dev, gssmr to use genesis-spec by default (#1665)

* feat(lib/transactions) ready transactions metrics (#1656)

* pool ready transaction metrics

* chore: add priority queue metrics

* chore: fix lint

* chore: remove println

* chore: add copyright comments

* chore: resolve comments

* chore: remove stop function and add comments to exported funcs

* chore: adjust tests

* chore: make metrics.Start blocking and using wg to inner gorout

* chore: fix typo

* chore: fix metrics test

* fix: solving data race condition on metrics tests

* feat(lib/trie): Parallel hash trie. (#1657)

* feat(lib/trie): Parallel hash trie.

* Fix race.

* Use bytes.Buffer in pool.

* chore: update gssmr genesis to v0.9; stub missing ext_ funcs (#1625)

* refactor(dot/rpc/modules) Add author unit tests, migrate old tests to integration tests (#1666)

* chore (pkg/scale) scale babe integration (#1670)

* integrate scale into babe library

* use results for unmarshalling

* clean up code

* fix switch to pass checks

* integrate scale into dot/sync

* cr feedback

* merge

Co-authored-by: noot <36753753+noot@users.noreply.github.com>

* feat(lib/grandpa) implement grandpa finality round metrics (#1655)

* chore: implement grandpa finality round

* pool ready transaction metrics

* chore: add priority queue metrics

* chore: fix lint

* chore: add gauge collector interface

* chore: fix lint

* remove unused metrics timeout

* chore: remove unused test

* remove unused consts

* chore: adding tests

* fix(dot/network, lib/grandpa): fix node sync, improve devnet finality

* fix(dot/node): Start websocket server only with `--ws` flag (#1671)

* fix (dot/telemetry): NoTelemetry flag stops telemetry (#1660)

* refactor(dot/rpc/subscription): refactor websocket `HandleComm` (#1673)

* chore(pkg/scale): scale integration into genesis (#1669)

* fix(dot/network): fix stream manager tests (#1683)

* chore (pkg/scale) integrate scale into dot/core and dot/sync (#1676)

* scale into messages_test

* integrate scale into dot core

* integrate scale into dot/sync

* integrate scale into sync and core

Co-authored-by: noot <36753753+noot@users.noreply.github.com>

* chore (pkg/scale) integrate scale pkg into dot/rpc (#1678)

* integrate scale into dot/sync

* integrate scale into dot/rpc

* scale into epoch

* integrate scale into pruner

* integrate scale pkg into dot/state

* WIP/Fix digest encoding errors

* remove changes in dot/state to include in separate PR

* feat(lib/grandpa) add round state rpc call (#1664)

* chore: add interface for grandpa in rpc pkg

* chore: create roundState rpc call

* chore: coment unused branch

* chore: fix lint

* chore: add test case

* chore: fix lint

* chore: address comments

* chore: fix the diff implementation

* chore: address comment

* chore: change PreVotes and PreCommits interface signature

* chore: remove check

* chore: improve code defs

* chore: replace unbuffered channels with buffered channels (#1668)

* add buffer to channels

* add buffers to channels in tests

* remove buffers from channels that shouldn't be buffered

* added DEFAULT_BUFFERS_SIZE const

* lint

* addres comments

* fix(lib/babe): always use 2/3 of slot to produce block, re-add potentially valid txs to queue (#1679)

* fix(dot/types): fix max value for digest (#1687)

Co-authored-by: noot <36753753+noot@users.noreply.github.com>

* fix(dot/state, lib/grandpa): update justification and SignedVote handling in database (#1682)

* feat(dot/rpc) Add `system_localPeerId` rpc call (#1690)

* chore: add local peer id rpc call

* chore: add func desc

* cover empty test case

* chore: ignore Id on func name

* chore: adjusts tests

* chore: added cname for docs (#1692)

* feat(dot/rpc): Add `system_localListenAddresses` RPC call (#1689)

* chore(lib/grandpa, dot/network): send `CommitMessage` directly to peer on round mismatch; cleanup grandpa `receiveMessages`  (#1684)

* feat(dot/rpc) Add `system_syncState` rpc call (#1691)

* chore: adjust tests

* chore: exposing network methods

* chore: add test

* chore: resolve lint and improve func description

* chore: resolve lint

* fix: update gssmr genesis to use pallet_babe::SameAuthoritiesForever (#1696)

* chore(lib/common) implement byte pool to improve websocket subscription efficiency (#1693)

* implement bufferpool

* implement byte pool for subscription setup

* lint

* fix lint

* address comments

* refactor UnregisterFinalizedChannel to UnregisterFinalisedChannel

* lint

* change error handling

* refactor NumPooled to Len

* fix(dot/state): track runtime per-block, fix runtime upgrades differing between forks (#1638)

* fix runtime upgrade

* Add runtime in blocktree.

* Remove runtime instance from babe service.

* Remove runtime instance from sync service.

* Self review.

* Fix chain reorg test.

* Fix failing test.

* Self review.

* Address comments.

* Remove unused functions from interface.

* Fix failing test.

* fix TestService_HandleSubmittedExtrinsic

* update HandleTransactionMessage to set runtime storage before validating

* Fix failing test.

* address comment

* lint

* cleanup

Co-authored-by: noot <elizabethjbinks@gmail.com>
Co-authored-by: noot <36753753+noot@users.noreply.github.com>

* feat(dot/network) add `network_is_major_syncing` metric (#1697)

* chore: transform goal into atomic

* add tests

* remove debug from polkadot config

* chore: add comment

* chore: remove comments

* change var name

Co-authored-by: Timothy Wu <timwu20@gmail.com>

* update var name

* chore: add metrics port

* chore: add clean up to close dbs while testing

Co-authored-by: Timothy Wu <timwu20@gmail.com>

* fix(dot/network): decrease DHT find peers interval for gssmr nodes (#1703)

* fix(docs): improve build-spec usage docs (#1706)

* feat: improve build-spec usage docs

* add doc to use  build-spec command using --output flag

* fix(dot/state): add StorageState Lock/Unlock API for usage by babe and sync  (#1700)

* add Jimmy to codeowners (#1711)

* feat(dot/rpc) implement `author_hasSessionKeys` RPC call (#1704)

* chore: add interface for grandpa in rpc pkg

* chore: create roundState rpc call

* chore: coment unused branch

* chore: fix lint

* chore: add test case

* chore: fix lint

* chore: add grandpa subscribe justification rpc call

* chore: add cancel function to stop goroutine when unsuubscribe

* chore: resolve lint

* chore: add tests to subscribe justification call

* remove deps from round state rpc call pr

* chore: remove unecessary changes

* remove inpackage well mock is in mocks folder

* chore: fix lint

* wip: fixing tests

* chore: use channels to control goroutines

* chore: resolve lint

* add time.Duration on structs

* chore: add runtime method and rpc method

* wip: fix runtime response scale decoding

* chore: adding data to tests

* wip: improve test coverage and assertions

* chore: hasSessionKey rpc call done

* chore: change config.toml back

* chore: remove log, add string.EqualFold

* chore: remove unused logs, get back new private key

* update hasSessionKey method to use coreapi insted of runtime api

* chore: resolve lint issues

* chore: change from []byte to []uint8

* chore: fix tests failures

* chore: fix HasSessionKeyResponse comments

Co-authored-by: noot <36753753+noot@users.noreply.github.com>

* chore: fix KeyTypeID comments

Co-authored-by: noot <36753753+noot@users.noreply.github.com>

* chore: update comments, unexport struct and remove qtyCheck

* chore: improve hasSessionKey key check

* chore: update params to represent better data

* chore: improve func name to DecodeKeyPairFromHex

* chore: get back func names to avoid naming conflicts

* chore: update go.sum

* chore: update grandpa_subscribeJustification return response

* chore: fix lint issues

* chore: check the len of the slice of decoded keys

* chore: update exports comments

* chore: update the import style

* chore: improve DecodeKeyPairFromHex export comment

* chore: hasSessionKeys test fixed

* chore: improve export function comment

* chore: group rpc methods string in a unique place

* chore: use chan struct{}

* chore: fix tests that uses wsconn

* chore: fix subscription test

* chore: improve log message

* chore: fix lint issues

* chore: increase the author RPC method qty

* chore: fix deepsource style error

Co-authored-by: Arijit Das <arijitad.in@gmail.com>
Co-authored-by: noot <36753753+noot@users.noreply.github.com>

* Revert "feat(dot/rpc) implement `author_hasSessionKeys` RPC call (#1704)" (#1714)

This reverts commit 86df957.

* feat(dot/rpc) add `grandpa_subscribeJustifications` rpc call (#1672)

* chore: add interface for grandpa in rpc pkg

* chore: create roundState rpc call

* chore: coment unused branch

* chore: fix lint

* chore: add test case

* chore: fix lint

* chore: add grandpa subscribe justification rpc call

* chore: add cancel function to stop goroutine when unsuubscribe

* chore: resolve lint

* chore: add tests to subscribe justification call

* remove deps from round state rpc call pr

* chore: remove unecessary changes

* remove inpackage well mock is in mocks folder

* chore: fix lint

* wip: fixing tests

* chore: use channels to control goroutines

* chore: resolve lint

* add time.Duration on structs

* chore: update grandpa_subscribeJustification return response

* chore: fix lint issues

* chore: resolve tests issues

* chore: fix channels and methods const

* chore: improve error messages

Co-authored-by: Arijit Das <arijitad.in@gmail.com>

* chore(lib/runtime): stub v0.9.8 runtime funcs, partially implement storage ext_ funcs (#1710)

* fix(lib/grandpa): fix grandpa stall and various bugs (#1708)

* feat(dot/rpc) implement `author_hasSessionKeys` RPC call (#1715)

* chore: add interface for grandpa in rpc pkg

* chore: create roundState rpc call

* chore: coment unused branch

* chore: fix lint

* chore: add test case

* chore: fix lint

* chore: add grandpa subscribe justification rpc call

* chore: add cancel function to stop goroutine when unsuubscribe

* chore: resolve lint

* chore: add tests to subscribe justification call

* remove deps from round state rpc call pr

* chore: remove unecessary changes

* remove inpackage well mock is in mocks folder

* chore: fix lint

* wip: fixing tests

* chore: use channels to control goroutines

* chore: resolve lint

* add time.Duration on structs

* chore: add runtime method and rpc method

* wip: fix runtime response scale decoding

* chore: adding data to tests

* wip: improve test coverage and assertions

* chore: hasSessionKey rpc call done

* chore: change config.toml back

* chore: remove log, add string.EqualFold

* chore: remove unused logs, get back new private key

* update hasSessionKey method to use coreapi insted of runtime api

* chore: resolve lint issues

* chore: change from []byte to []uint8

* chore: fix tests failures

* chore: fix HasSessionKeyResponse comments

Co-authored-by: noot <36753753+noot@users.noreply.github.com>

* chore: fix KeyTypeID comments

Co-authored-by: noot <36753753+noot@users.noreply.github.com>

* chore: update comments, unexport struct and remove qtyCheck

* chore: improve hasSessionKey key check

* chore: update params to represent better data

* chore: improve func name to DecodeKeyPairFromHex

* chore: get back func names to avoid naming conflicts

* chore: update go.sum

* chore: update grandpa_subscribeJustification return response

* chore: fix lint issues

* chore: check the len of the slice of decoded keys

* chore: update exports comments

* chore: update the import style

* chore: improve DecodeKeyPairFromHex export comment

* chore: hasSessionKeys test fixed

* chore: improve export function comment

* chore: group rpc methods string in a unique place

* chore: use chan struct{}

* chore: fix tests that uses wsconn

* chore: fix subscription test

* chore: improve log message

* chore: fix lint issues

* chore: increase the author RPC method qty

* chore: fix deepsource style error

* chore: keep just related changes

* chore: improve test coverage

* chore: improve test coverage on lib/keystore/helpers.go

* chore: improve testing and remove unused function

* chore: create more test cases to hasSessionKey RPC method

Co-authored-by: Arijit Das <arijitad.in@gmail.com>
Co-authored-by: noot <36753753+noot@users.noreply.github.com>

* feat(dot/rpc/modules) implement `state_queryStorage` rpc method (#1707)

* wip: state query storage rpc

* chore: query keys from block stateRoot

* chore: implemented rpc method and format response correctly

* chore: check starting block hash is nil

* chore: use GetStorage instead of TrieState

* chore: remove logs

* chore: resolve lint issues

* chore: preallocate slice, use varidic param

* chore: update variable name

* chore: made from not nulable

* chore: get best block hash if to is nil

* chore: remove pointer and compare with EmptyHash

* chore: fix tests, remove write to nil reference

* chore: fix deepsource rule

* chore: fix rpc test

* chore: uncomment conditional test

* chore: improve testing

* chore: change from null to a empty array

* chore: skip state_queryStorage RPC method test

* chore: remove unconsitent test check

* feat(dot/rpc/modules): add `system_addReservedPeer` and `system_removeReservedPeer` RPC call (#1712)

* chore: include rpc methods and adding peers on store

* chore: add unit tests for reserved peers on net layer

* chore: add unit tests for reserved peers on net layer

* chore: remove redundancy conditionals

* chore: add and remove peers from protected map

* increase the system RPC methods qtt

* chore: test add and remove protected peers

* chore: improve comment at removeReservedPeers

Co-authored-by: noot <36753753+noot@users.noreply.github.com>

* chore: improve comment at addReservedPeers

* chore: jump when there is no peer to disconect

* chore: fix lint issues

* chore: remove unused checks and use trim space

* chore: improve test coverage

* chore: remove global websocket test variable

* chore: improve tests on modules/system

Co-authored-by: noot <36753753+noot@users.noreply.github.com>

* chore: updated pr template to include primary reviewer (#1724)

Co-authored-by: noot <36753753+noot@users.noreply.github.com>
Co-authored-by: Arijit Das <arijit@chainsafe.io>
Co-authored-by: Ryan Noble <ryanjnoble@gmail.com>
Co-authored-by: Dustin Brickwood <dustinbrickwood204@gmail.com>
Co-authored-by: Eclésio Junior <eclesiomelo.1@gmail.com>
Co-authored-by: Kanishka <kanishkatn@gmail.com>
Co-authored-by: noot <elizabethjbinks@gmail.com>
Co-authored-by: Daniel Gómez <dani91.gomez@gmail.com>
Co-authored-by: Arijit Das <arijitad.in@gmail.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Timothy Wu <timwu20@gmail.com>
Co-authored-by: JimboJ <40345116+jimjbrettj@users.noreply.github.com>
  • Loading branch information
13 people authored Aug 13, 2021
1 parent 6bf1c62 commit 9272de4
Show file tree
Hide file tree
Showing 315 changed files with 23,339 additions and 8,037 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# CODEOWNERS: https://help.github.com/articles/about-codeowners/

# Primary repo maintainers
* @noot @arijitAD @edwardmack @timwu20
* @noot @arijitAD @edwardmack @timwu20 @EclesioMeloJunior @jimjbrettj
14 changes: 14 additions & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,20 @@ Changes that only affect a single file can be tested with
$ go test <file_you_are_working_on>
```

Sometimes you may need to create mocks for interfaces, in that case you will just execute:

```
$ make mock path=$(path to the interface) interface=$(interface name)
```

The command above will generate a file with prefix `mock_` inside the interface folder, if you want to generate the same mock but inside the `mocks` folder, you can execute:

```
$ make mock path=$(path to the interface) interface=$(interface name) INMOCKS=1
```

The command above will generate the mock inside the folder `$(path)/mocks`, and the mocks will be in the same package that your interface is.

**8. Lint your changes.**

Before opening a pull request be sure to run the linter
Expand Down
8 changes: 8 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,11 @@ supported format for automatically closing issues (ie, closes #123, fixes #123)
-->

-

## Primary Reviewer

<!--
Please indicate one of the code owners that are required to review prior to merging changes (e.g. @noot)
-->

-
54 changes: 43 additions & 11 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,42 +12,74 @@ jobs:
platform: [macos-latest, ubuntu-latest]
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/setup-go@v1
- id: go-cache-paths
run: |
echo "::set-output name=go-build::$(go env GOCACHE)"
echo "::set-output name=go-mod::$(go env GOMODCACHE)"
- uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
- uses: actions/checkout@v2

# cache go build cache
- name: Cache go modules
uses: actions/cache@v1
uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('go.sum') }}
restore-keys: ${{ runner.os }}-go-
path: ${{ steps.go-cache-paths.outputs.go-build }}
key: ${{ runner.os }}-go-build-${{ hashFiles('**/go.sum') }}
restore-keys: ${{ runner.os }}-go-build

# cache go mod cache
- name: Cache go modules
uses: actions/cache@v2
with:
path: ${{ steps.go-cache-paths.outputs.go-mod }}
key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }}
restore-keys: ${{ runner.os }}-go-mod

- name: Run build
run: make build

publish-code-coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v1
- id: go-cache-paths
run: |
echo "::set-output name=go-build::$(go env GOCACHE)"
echo "::set-output name=go-mod::$(go env GOMODCACHE)"
- uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
- uses: actions/checkout@v2

# cache go build cache
- name: Cache go modules
uses: actions/cache@v1
uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('go.sum') }}
restore-keys: ${{ runner.os }}-go-
path: ${{ steps.go-cache-paths.outputs.go-build }}
key: ${{ runner.os }}-go-build-${{ hashFiles('**/go.sum') }}
restore-keys: ${{ runner.os }}-go-build

# cache go mod cache
- name: Cache go modules
uses: actions/cache@v2
with:
path: ${{ steps.go-cache-paths.outputs.go-mod }}
key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }}
restore-keys: ${{ runner.os }}-go-mod

- name: Install Subkey
run: |
wget -P $HOME/.local/bin/ https://chainbridge.ams3.digitaloceanspaces.com/subkey-v2.0.0
mv $HOME/.local/bin/subkey-v2.0.0 $HOME/.local/bin/subkey
chmod +x $HOME/.local/bin/subkey
echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Generate coverage report
run: |
go test ./... -short -coverprofile=coverage.out -covermode=atomic -timeout=20m
- uses: codecov/codecov-action@v1
with:
token: "89982880-a53b-4a3a-9bdd-3dc9c78bd190"
files: ./coverage.out
flags: unit-tests
name: coverage
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,12 @@ jobs:
uses: golangci/golangci-lint-action@v2
with:
version: 'latest'
args: -v

vet-check:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v1
- uses: actions/setup-go@v2
with:
go-version: '1.15.x'
- uses: actions/checkout@v2
Expand Down
102 changes: 87 additions & 15 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,27 +11,50 @@ jobs:
platform: [macos-latest, ubuntu-latest]
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/setup-go@v1
- id: go-cache-paths
run: |
echo "::set-output name=go-build::$(go env GOCACHE)"
echo "::set-output name=go-mod::$(go env GOMODCACHE)"
- uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
- uses: actions/checkout@v2

# cache go build cache
- name: Cache go modules
uses: actions/cache@v1
uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('go.sum') }}
restore-keys: ${{ runner.os }}-go-
path: ${{ steps.go-cache-paths.outputs.go-build }}
key: ${{ runner.os }}-go-build-${{ hashFiles('**/go.sum') }}
restore-keys: ${{ runner.os }}-go-build

# cache go mod cache
- name: Cache go modules
uses: actions/cache@v2
with:
path: ${{ steps.go-cache-paths.outputs.go-mod }}
key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }}
restore-keys: ${{ runner.os }}-go-mod

- name: Install Subkey
run: |
wget -P $HOME/.local/bin/ https://chainbridge.ams3.digitaloceanspaces.com/subkey-v2.0.0
mv $HOME/.local/bin/subkey-v2.0.0 $HOME/.local/bin/subkey
if [ "$RUNNER_OS" == "Linux" ]; then
wget -P $HOME/.local/bin/ https://chainbridge.ams3.digitaloceanspaces.com/subkey-v2.0.0
mv $HOME/.local/bin/subkey-v2.0.0 $HOME/.local/bin/subkey
elif [ "$RUNNER_OS" == "macOS" ]; then
wget -P $HOME/.local/bin/ https://chainbridge.ams3.digitaloceanspaces.com/subkey-v2.0.0-macos
mv $HOME/.local/bin/subkey-v2.0.0-macos $HOME/.local/bin/subkey
else
echo "Subkey for $RUNNER_OS is not supported"
exit 1
fi
chmod +x $HOME/.local/bin/subkey
echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Run unit tests
run: go test -short ./... -timeout=20m
run: go test -short ./... -timeout=30m

- name: Test State - Race
run: make test-state-race
Expand All @@ -42,23 +65,45 @@ jobs:
publish-code-coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v1
- id: go-cache-paths
run: |
echo "::set-output name=go-build::$(go env GOCACHE)"
echo "::set-output name=go-mod::$(go env GOMODCACHE)"
- uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
- uses: actions/checkout@v2

# cache go build cache
- name: Cache go modules
uses: actions/cache@v2
with:
path: ${{ steps.go-cache-paths.outputs.go-build }}
key: ${{ runner.os }}-go-build-${{ hashFiles('**/go.sum') }}
restore-keys: ${{ runner.os }}-go-build

# cache go mod cache
- name: Cache go modules
uses: actions/cache@v1
uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('go.sum') }}
restore-keys: ${{ runner.os }}-go-
path: ${{ steps.go-cache-paths.outputs.go-mod }}
key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }}
restore-keys: ${{ runner.os }}-go-mod

- name: Install Subkey
run: |
wget -P $HOME/.local/bin/ https://chainbridge.ams3.digitaloceanspaces.com/subkey-v2.0.0
mv $HOME/.local/bin/subkey-v2.0.0 $HOME/.local/bin/subkey
chmod +x $HOME/.local/bin/subkey
echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Generate coverage report
run: |
go test ./... -short -coverprofile=coverage.out -covermode=atomic -timeout=20m
- uses: codecov/codecov-action@v1
with:
with:
if_ci_failed: success
informational: true
files: ./coverage.out
flags: unit-tests
name: coverage
Expand Down Expand Up @@ -87,6 +132,7 @@ jobs:
name: Run stable tests
run: |
docker run chainsafe/gossamer:test sh -c "make it-stable"
docker-rpc-tests:
runs-on: ubuntu-latest
steps:
Expand All @@ -110,6 +156,7 @@ jobs:
name: Run rpc tests
run: |
docker run chainsafe/gossamer:test sh -c "make it-rpc"
docker-stress-tests:
runs-on: ubuntu-latest
steps:
Expand All @@ -133,6 +180,7 @@ jobs:
name: Run stress
run: |
docker run chainsafe/gossamer:test sh -c "make it-stress"
docker-grandpa-tests:
runs-on: ubuntu-latest
steps:
Expand All @@ -153,6 +201,30 @@ jobs:
push: false
tags: chainsafe/gossamer:test
-
name: Run stress
name: Run grandpa
run: |
docker run chainsafe/gossamer:test sh -c "make it-grandpa"
docker-polkadotjs-tests:
runs-on: ubuntu-latest
steps:
-
name: Set up QEMU
uses: docker/setup-qemu-action@v1
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
-
name: Build
id: docker_build
uses: docker/build-push-action@v2
with:
load: true
file: ./Dockerfile
platforms: linux/amd64
push: false
tags: chainsafe/gossamer:test
-
name: Run polkadotjs tests
run: |
docker run chainsafe/gossamer:test sh -c "make it-polkadotjs"
16 changes: 10 additions & 6 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ linters-settings:
# - (github.com/golangci/golangci-lint/pkg/logutils.Log).Warnf
# - (github.com/golangci/golangci-lint/pkg/logutils.Log).Errorf
# - (github.com/golangci/golangci-lint/pkg/logutils.Log).Fatalf
golint:
revive:
# minimal confidence for issues, default is 0.8
min-confidence: 0.8
gofmt:
Expand Down Expand Up @@ -187,10 +187,10 @@ linters:
- govet
- gofmt
- goimports
- gosimple
- varcheck
- misspell
- ineffassign
- gosimple
- unconvert
- goconst
- errcheck
Expand All @@ -200,7 +200,7 @@ linters:
- gosec
- bodyclose
- goprintffuncname
- golint
- revive
- depguard
- gocyclo
- unparam
Expand Down Expand Up @@ -245,15 +245,19 @@ issues:
text: "SA9003:"

- linters:
- golint
- gosimple
text: "S1025:"

- linters:
- revive
text: "package comment should be of the form"

- linters:
- golint
- revive
text: "don't use ALL_CAPS in Go names;"

- linters:
- golint
- revive
text: "don't use underscores in Go names;"

- linters:
Expand Down
17 changes: 15 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,17 @@ RUN apt-get update && \
apt-get install -y \
gcc \
cmake \
wget
wget \
curl \
npm

# Install node source for polkadotjs tests
RUN curl -sL https://deb.nodesource.com/setup_14.x | bash -

# Install nodejs for polkadotjs tests
RUN apt-get update && \
apt-get install -y \
nodejs

# Install Go
RUN wget https://dl.google.com/go/go1.15.5.linux-amd64.tar.gz
Expand Down Expand Up @@ -36,6 +46,9 @@ RUN go mod download
# Copy gossamer sources
COPY . $GOPATH/src/github.com/ChainSafe/gossamer

# Install js dependencies for polkadot.js tests
RUN cd $GOPATH/src/github.com/ChainSafe/gossamer/tests/polkadotjs_test && npm install

# Build
RUN GOBIN=$GOPATH/src/github.com/ChainSafe/gossamer/bin go run scripts/ci.go install

Expand All @@ -48,4 +61,4 @@ RUN chmod +x $GOPATH/src/github.com/ChainSafe/gossamer/scripts/docker-entrypoint
# Expose gossamer command and port
ENTRYPOINT ["/gocode/src/github.com/ChainSafe/gossamer/scripts/docker-entrypoint.sh"]
CMD ["/usr/local/gossamer"]
EXPOSE 7001
EXPOSE 7001 8546 8540
Loading

0 comments on commit 9272de4

Please sign in to comment.