* added a bit of logging
* added update messages to mqtt (every second with a timestamp)
* added isConnectionOpen to the interface and analysis this during execution
* added connection loss handler and status check
* put some global objects into an objects to avoid inter service testing issues
* TestingLocker Mutex to RWMutex (increase performance)
* termintationMutex became a sync.RWMutex
* added logging to the mqtt mock client
* made monitor Mutex a RWMutex
* added Mutex protection to the numberOfElements varialbe
* added another Waiting block to the machine attestation methods (CI tests)
* had to adjust the test cases to the impact of that change.
Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>
* set keepalive ping
* made mutex more granular
* avoid using app.Logger to have a consistent log from the beginning
* made lazyLoading local to the module
* fixed ticker bug so that the tasks are executed in an endless loop
* fixed timezone bug of Add Participant. only validator local time is used not the timestamp from the mqtt messages as these might come from a different time zone (resulted in delayed deletion from the activeActors DB)
* improved connection management for the monitor
* added a watchdog task to restart the monitor in case of connection loss (every 2 min)
* removed obsolete SetContext function/interface
* removed obsolete time conversion method
Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>
* added uncompressed trust anchor pub key processing
* added a nother waiting block to pass CI test cases - these are a bit slower
Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>
* fix: mqtt-tls in default config template
- panic: json: cannot unmarshal string into Go struct field
Config.mqtt-tls of type bool
* fix: default mqtt port
- since MqttTLS is set to true by default we need to use the mqtts port
as well.
panic: network Error : EOF
Signed-off-by: Julian Strobl <jmastr@mailbox.org>
* added TSL support for mqtt
* added configuration value mqtt-tls (bool) to support tls and non-tls connections (testing)
Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>
* added donation of tokens/denom to the just attestet machine
* extended the machine module to have two additional parameters: amount of tokens to be distributed and their denominator
Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>
* no fee deduction in case of machineattestation messages
* no gas price for machineattestations in lib/tx
* test: add balance check to machine attestation e2e test
Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>
Signed-off-by: Lorenz Herzberger <lorenzherzberger@gmail.com>
* added tests (for the sake of on-demand local tests)
* added wrapping the first parameters of the calls into `"`
* using newest elements RPC from now on (>=1.0.0)
* removed print outputs
* removed parallel testing from util/elementsd_connector_test.go
Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>
* added a MqttMonitor module with levelDB and periodic cleanup
* initialized in the app
* passed to dao keeper
* added conversion methods (string2unixtime, byte ToJSON)
* removed obsolete keeper code
* maded RDDLToken.Factor public
* added explicit mqtt client to the monitor module
* restart mqtt connection in mqttmonitor on connection loss
* adjusted mqttmock structure to be compatible
* added some linter exclusions to let the monitor tool pass
* created a MockMqttMonitor interface and mock object
* used this to pass tests
* made the MockMqttMonitor a global object so that it can be easily mocked
* removed MockMqttMonitor from the app/keeper initialization
* adjusted test cases to register "active machines" to the mqttmonitor
* added mutex in mocks to protect against data races
* defined mocks for the dao tests
* clear separation between interface and mqtt-Monitor
* added another waiting block to ensure the tx went through (multi-threading issue, race condition) during tests this failed sometimes
* added memstorage to test instead of a file based DB
Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>
* Added more sync objects to avoid accidental data races
* made lib.config.Config variables are private, so they cannot be tampered with (multithreading).
Please introduce Get-methods to retrieve the varialbes outside of the package if you need it.
This way, the race conditions and unexpected change of the global object state can be protected
* added reverse takedown of the validators to avoid the following error
[app] PoP broadcast tx failed: node0.info: key not found
* moved util.TerminationWaitGroup.Wait()
to the central network cleanup method
* removed mappings for private variables
Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>
* added wait for another block to have more reliable tests
* Added one network reload in case the address/port was still bound during the last try
test related
* separated Dao test suites (faster output on the CI)
* added 2 seconds wait time to avoid errors of still blocked ports/bindings (network)
* removed parallel flag from test/e2e/asset
* renamed a bunch of things to please the linters
* moved the reset of the libConfing clientctx back to the validator context before waiting for some blocks.
This should prevent the
panic: Log in goroutine after TestE2EMachineTestSuite has completed: [app] PoP broadcast tx failed: node0.info: key not found
on the CI.
Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>
* * added creation of random machines to prepare a test case
* setting all the consensus timeout values at once (if changed)
* mutex protection of the elements tx crafting methods (sequential processing)
* Extending the TestMachineNFTIssuance test case to parallel threads and threading issues
* moving all elements-rpc usage to the elementd-connector.go file
* removed call to fatal
* added WaitForNextBlock to be out of sync with PoP to avoid the following error
PoP broadcast tx failed: node0.info: key not found
after the test
---------
Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>
Warning:
```
Node.js 16 actions are deprecated. Please update the following actions
to use Node.js 20: actions/checkout@v3, actions/setup-go@v4.
```
Signed-off-by: Julian Strobl <jmastr@mailbox.org>
* moved initialization code to network initialization so that failures during the 1st 5 blocks disappear
---------
Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>
* added TermintionWaitGroup
* added mutex to lib/tx
* removed machine attestation thread (to comply with testing-race conditions becoming apparent on the CI)
* renamed test suites to have a clear naming structure
* removed parallel-testing from e2e machine test suite
* improved test suite logging
* removed parallel tests of machine_nft_tests - this caused data races due to the mock overwrites
* reduced error check to "out of gas" due to multi-threading and locking delays that result in different gas consumptions
* Added waiting blocks to pass the CI
Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>
* Initializing rootDir of dao and machine keeper with the home path of the validator key material
* added Block height logging of context decorator
* removed SetRoot usage
* fixed data races of the attest machine go-routine
* reproduction of the issue
* fixed testing URL issue
* refactored the machine-nft functions/mock
* fixed keeper.param read-bug that increased the gas prices in an inconsistent way
* increased the validator number to 3 for all e2e tests
* added go routine to attest machine workflow
---------
Signed-off-by: Julian Strobl <jmastr@mailbox.org>
Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>
Signed-off-by: Lorenz Herzberger <lorenzherzberger@gmail.com>
Co-authored-by: Julian Strobl <jmastr@mailbox.org>
Co-authored-by: Lorenz Herzberger <lorenzherzberger@gmail.com>
* removed some more code smell/error message aggregation
* removed obsolete/duplicate tests/code
* excluded TODOs (simulation) from being processed by sonarqube
* removed TODO code
Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>
---------
Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>
* aggregating error messages
* removed duplicate err msgs
* removed obsolete test (two times equal behaviour )
* added global error msg module
* refactored test utils to have sample types and sample objects by keepers separated
* excluded auto-generated code from sonarcube analysis
Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>
* Revert "feat: bring back config parameters"
This reverts commit 4ab279033cae5e351cd13c348a21e4717705f341.
Unnecessary because cosmos sdk handles chain upgrades properly: it holds
the chain and waits for a new binary version.
* refactor: use testnet parameters as default in x/dao
---------
Signed-off-by: Julian Strobl <jmastr@mailbox.org>
* added signing authority (dao) to the keeper to enable dao signing checks
* added UpdateParam message for the machine module
---------
Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>
* docs: shorten readme to development parts only
* docs: add discord link to readme
* docs: add link REPs
---------
Signed-off-by: Lorenz Herzberger <lorenzherzberger@gmail.com>
* added PoP report validation to the ReportPoPResult msg server
* removed two obsolete pop report deliveries
* added challenger is the PoPreport msg creator (new restriction)
* extended msg server test cases
---------
Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>
* extended AttestMachine FundAccount to support a given fee denominator
* renamed testutil/network/network.go to testutil/network/loader.go
* renamed new to Load
* integrated cosmos/testutil/network to planetmint-go/testutil/network
* changed to plmnt token tests only!
* removed obsolete variables
* fixed newest linter issues
---------
Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>
* set global tx gas limit
* extend lib/tx to process multiple messages
* extend lib/tx to configure tx gas limit
* added global gas limit tests
* increased account funding to support needs of testcases
Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>
- aligns the folder structure in `planetmint-go/`
- makes sequence number clean up via systemd possible
// see https://github.com/rddl-network/issues/issues/61
* refactor: open sequence file into function
* refactor: get sequence number into utils
Signed-off-by: Julian Strobl <jmastr@mailbox.org>
* updated planetmint-go dependency in lib/tx
* added two additional distribution addresses. splitted up the previous investor pool of 31% into three pools:
* early investors 19%
* investors 10%
* strategic 2%
* adjusted distribution request message
* adjusted distribution result
* adjusted distribution order
* refactored reissuance and distribution msg methods to be more readable
* fixed token distribution test case
Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>
* the execution of Config code is not determinitic within init methods. That's why we apply lazy loading.
Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>