* 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 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>
* 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 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>
* 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>
* fix: challangee rewards stay in dao module if challenge is not sucessful
* refactor: split up coin conversion functions
* fix: add dao module coin conversion
* test: adjust test case for updated behavior
* chore: fix typo
* fix: do not mint claims for dao
* refactor: remove redundant statement
* fix: error handling on claim converstion fail
* fix: linter error
* chore: add comment to test case
---------
Signed-off-by: Lorenz Herzberger <lorenzherzberger@gmail.com>
* ensure PoP is always initialized even without a defined challenger and challengee
* send the MQTT PoPInit if challenger and challengee are defined
* store the challenge in any case without regarding the minting of the rewards
* structured the added test and their staging
* fixed SelectPopParticipants bug
* restore the previous pop epoch after running dao/suite.go
* avoid popInit during machine attestations (within test cases)
---------
Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>
* feat: verify the availability of PoP participants
* simplified and improved logging
* added MQTT-based availability check for PoP participants
* extended MQTT mocking
* Only the block proposer will send out the MQTT messages to the pop participants
* Added a configuration value for the MQTT response timeout
* removed parallel execution of one test case
* added r/w locking to the MQTT response processing
* set MQTT timeout unit to ms
Signed-off-by: Julian Strobl <jmastr@mailbox.org>
* feature: add ante handler to block non validators from sending restricted txs
* fix: add missing msg types and linter errors
* fix: staticcheck error
* refactor: use fallthrough on ante handle switch
* fix: set val address on machine attest test
---------
Signed-off-by: Lorenz Herzberger <lorenzherzberger@gmail.com>
* refactor: switch log level for PoP messages
Needs to be the other way around, otherwise we receive up to 720
messages on info level.
* refactor: align spelling in comments and log messages
* fix: config key
Commit fc9e795bd0678746993806ac21c92a675ed7006f changed the reissuance
variable. The config key was forgotten to change.
* refactor: return early to reduce indentation
Signed-off-by: Julian Strobl <jmastr@mailbox.org>
Reissue and reissuance are standalone words and should not contain an
uppercase `I` in the variable name. This should only happen to connect
different word like: file name gets `fileName` resp. `FileName`.
Signed-off-by: Julian Strobl <jmastr@mailbox.org>
In the beginning we wanted to send the raw transaction to elements, but
what we ended up doing is to send the command like:
```
"reissueasset assetID amount"
```
to elements-cli/elements-rpc.
Closes#226
Signed-off-by: Julian Strobl <jmastr@mailbox.org>
* implemented SelectPopParticipants
* added check if enough participants to initiate PoP
* make use of lib for broadcasting tx
Signed-off-by: Lorenz Herzberger <lorenzherzberger@gmail.com>
* added MQTT lib
* added MQTT config params: domain, port user, password
* sending PoPInit commands to devices par of the pop (after delivery of the PoPInit message)
* Added test case to verify the working of the MQTT connection (test is skipped and designed for manual tests (lack of credentials))
---------
Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>
* Fix typo and align log messages
* Align some variable names with rest of the program
* [log] Fix log formatting and change log level
* Fix comment
Signed-off-by: Julian Strobl <jmastr@mailbox.org>
* fixed precision issue within the distribution order
* adjusted test cases: migrated from uint64 to float64
---------
Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>
* fixed missing-proposer bug for asset distribution
* improved logging
reduced type conversions and potential errors
Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>
* adjust issuePoPRewards to mint stagedCRDDL
* add GetChallengeRange
* add resolveStagedClaims on ReissueRDDLResult msg
* move claim resolve to distribution result
* add StagedDenom and ClaimDenom to config
* added the prepare4linting.sh script
* renamed PoPEpochs to PopEpochs
* renamed DistributionAddressPoP to DistributionAddressPop
* added config value ReIssuanceEpochs
* detached the re-issuance from the distribution process and schedule them independently
* changed logging messages
* added an explicit util/kv_serialize.go file to have all KV serialization done
* switched to Bigendian serialization of int64 to have the ordered list on the kvstore
* added ComputeReIssuanceValue to enable re-issuances once a day or defined by ReIssuanceEpoch
* integrated a ReIssuanceValue computation test case
* adjusted the challenges test cases to be epoch-dependent
* added ReIssuances per ReIssuanceEpoch
* extended the Reissue message
* checking ReIssuanceProposal in the ante handler
* added precision setter for the UINT to RDDL token converter (and test cases)
* add e2e test case for pop rewards
Signed-off-by: Lorenz Herzberger <lorenzherzberger@gmail.com>
Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>
Co-authored-by: Jürgen Eckel <juergen@riddleandcode.com>
* added InitPoP message
* added getChallenge query to inspect challenges
* adjusted towards a unique block height identification unit: int64, not uint64
* added challenge param finished to identify challenges that weren't completed but will be part of re-issuance.
Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>
* removed error handling from util/issue_command.go methods
* integrated the complete error handling with context into util/issue_command.go: buildSignBroadcastTx
* setting the chainID of lib/tx dynamically
* removed obsolete timeout
* removed obsolete TODO message
* improved logging information and clarity of information
* improved readability and debugability of BroadcastTxWithFileLock
* fixed getClientContext bug for chains different from the testnet by removing a hard-coded value
* renamed setConfig to setRPCConfig
Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>