361 Commits

Author SHA1 Message Date
Jürgen Eckel
dd2621afde
hot fix for the tasmota PoP issues (#403)
* hot fix for the RDDL-Tasmota PoP issues
* adjusted test case

Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>
v0.9.7
2024-05-28 14:54:31 +02:00
Jürgen Eckel
e99b614e4a
added connection loss handler, extended logging, mqtt msg updates (#400)
* 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>
v0.9.6
2024-05-16 17:06:19 +02:00
Jürgen Eckel
0c05081604
unlock mutex before return (#399)
* unlock mutex before return
* added termination clause for the scheduler



Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>
v0.9.5
2024-05-15 17:05:26 +02:00
Jürgen Eckel
1f2b1702ea
Eckelj/mqtt monitoring fix (#398)
* 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>
v0.9.4
2024-05-15 13:23:06 +02:00
Jürgen Eckel
ccf491d658
added uncompressed trust anchor pub key processing (#396)
* 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>
v0.9.3
2024-05-14 10:32:52 +02:00
Jürgen Eckel
af1483a8ec
added secp256r1 machine ID Sig verification (#395)
* added secp256r1 machineIDSignature verification
* to go-utils v0.1.1
---------

Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>
v0.9.2
2024-05-10 10:57:55 +02:00
Lorenz Herzberger
066c1a7667
Fix rddl claim client load (#388)
* fix: lazyLoad on rddl-claim-service-client
* fix: sane default value for claim-host
---------

Signed-off-by: Lorenz Herzberger <lorenzherzberger@gmail.com>
v0.9.1
2024-04-29 11:49:45 +02:00
Lorenz Herzberger
b0f8516cd6
379 create redeem claim does not call service (#383)
* feat: add rddl-claim-service/client
---------

Signed-off-by: Lorenz Herzberger <lorenzherzberger@gmail.com>
Signed-off-by: Julian Strobl <jmastr@mailbox.org>
Co-authored-by: Julian Strobl <jmastr@mailbox.org>
v0.9.0
2024-04-25 14:38:58 +02:00
Julian Strobl
937104b3cd
fix: mqtt default config (#382)
* 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>
2024-04-25 13:50:22 +02:00
Jürgen Eckel
b45c381b3b
TLS support for planetmint (#381)
* 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>
2024-04-24 14:59:17 +02:00
Jürgen Eckel
43d152fcf6
Donate tokens to attested machines so that these are able to run after their attestation (#375)
* 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>
2024-04-23 12:00:31 +02:00
Lorenz Herzberger
5e2b307a70
368 make attestmachine msgtx with fee=zero (#372)
* 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>
2024-04-22 13:07:40 +02:00
Jürgen Eckel
1983890fb8
Adjusting to newest version of elements-rpc (#353)
* 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>
2024-04-09 13:49:51 +02:00
Jürgen Eckel
0fd12a563c
added to wait for another block to ensure the tx went through (#365)
Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>
2024-04-08 14:42:54 +02:00
Jürgen Eckel
779b1edd48
Eckelj/mqtt monitoring (#359)
* 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>
v0.8.5 lib/v0.5.0
2024-04-08 10:49:00 +02:00
Julian Strobl
0ec6fba4ec
test: run action dynamically for each module in a repository (#351)
// https://stackoverflow.com/a/68746128

Signed-off-by: Julian Strobl <jmastr@mailbox.org>
2024-03-20 09:48:18 +01:00
Lorenz Herzberger
7d4ec9d56c
change: CreateRedeemClaim consumes entire claim for reduced complexity (#352)
* change: CreateRedeemClaim consumes entire claim for reduced complexity

---------

Signed-off-by: Lorenz Herzberger <lorenzherzberger@gmail.com>
2024-03-19 14:29:29 +01:00
Jürgen Eckel
588a21f76e
stageing network takedown to avoid leveldb panics (#347)
Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>
2024-03-11 15:30:39 +01:00
Julian Strobl
06e60809ca
chore: bump lib version to v0.5.0 (#346)
Signed-off-by: Julian Strobl <jmastr@mailbox.org>
2024-03-11 11:24:36 +01:00
Jürgen Eckel
1e1e19bb19
added more sync objects to avoid accidential data races (#345)
* 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>
2024-03-11 11:11:56 +01:00
Jürgen Eckel
d5d86997f3
added wait for another block to have more reliable tests (#344)
* 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>
2024-03-08 15:14:36 +01:00
Jürgen Eckel
e6f6e43754
fixed crashes when two machines are attested at the same time (#343)
* * 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>
v0.8.4
2024-03-08 10:54:52 +01:00
Julian Strobl
8a5e7b5da6
fix: deprecated github actions (#342)
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>
v0.8.3
2024-03-07 10:02:32 +01:00
Jürgen Eckel
73e27b6145
tidy up ci logs (#339)
* moved initialization code to network initialization so that failures during the 1st 5 blocks disappear

---------

Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>
2024-03-06 15:04:38 +01:00
Julian Strobl
26457a7a6f
refactor: goify function (#337)
* chore: log in case of error

Signed-off-by: Julian Strobl <jmastr@mailbox.org>
2024-03-06 14:51:27 +01:00
Julian Strobl
f6f10b54b6
refactor: generate contract from struct in test (#338)
- also use default params

Signed-off-by: Julian Strobl <jmastr@mailbox.org>
2024-03-06 13:28:00 +01:00
Jürgen Eckel
31b304f232
added TermintionWaitGroup (#336)
* 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>
2024-03-06 10:52:22 +01:00
Jürgen Eckel
f13c54f582
fixed mqtt URI bug (#334)
* adjusted to refactored path

* removed go routine from attest machine msg server

Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>
2024-03-05 15:29:24 +01:00
Lorenz Herzberger
caa795e5f7
relocate redeem claim and reissuance proposal ante decorator to respe… (#331)
* relocate redeem claim and reissuance proposal ante decorator to respective msg servers

---------

Signed-off-by: Lorenz Herzberger <lorenzherzberger@gmail.com>
2024-03-05 15:03:27 +01:00
Jürgen Eckel
4f5b1e5777
Multi validator setup in test cases (#333)
* 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>
v0.8.2
2024-03-05 11:37:01 +01:00
Julian Strobl
838c887a91
Revert "Revert "Revert unnecessary config patch (#323)" (#324)" (#332)
This reverts commit b205c5ff29df25bad6b923bae327b88bdad89518.

This needs to be removed so that the parameters are read from chain.
v0.8.1
2024-03-01 12:42:44 +01:00
Jürgen Eckel
55b7065744
Eckelj/remove the smell (#326)
* 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>
2024-02-26 18:06:43 +01:00
Jürgen Eckel
75ed13b357
Eckelj/reducing code smell (#325)
* 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>
2024-02-26 16:44:00 +01:00
Julian Strobl
b205c5ff29
Revert "Revert unnecessary config patch (#323)" (#324)
This reverts commit b1c4d11ccf3e98bd46a13d7fb54b6b5c0aefbf29.
v0.8.0
2024-02-26 13:04:41 +01:00
Julian Strobl
b1c4d11ccf
Revert unnecessary config patch (#323)
* 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>
2024-02-26 12:25:12 +01:00
Jürgen Eckel
ec697840de
Eckelj/machine update params (#322)
* 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>
2024-02-26 12:00:37 +01:00
Julian Strobl
412e15449b feat: add migration to v0.8.0
Take x/dao and x/machine default parameters and store them into the
respective module state.

Signed-off-by: Julian Strobl <jmastr@mailbox.org>
2024-02-26 08:30:10 +01:00
Julian Strobl
4ab279033c feat: bring back config parameters
Needed for migration as interim solution.

Signed-off-by: Julian Strobl <jmastr@mailbox.org>
2024-02-26 08:30:10 +01:00
Lorenz Herzberger
373b2aeab6
docs: shorten readme to development parts only (#314)
* 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>
2024-02-15 16:09:43 +01:00
Jürgen Eckel
951d854891
311 review test case ssendpopresultoutbytes true todo bug (#313)
* 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>
2024-02-15 14:41:05 +01:00
Jürgen Eckel
04e45a7fb2
275 refactor feedenom on e2e test suite (#312)
* 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>
2024-02-14 12:15:40 +01:00
Jürgen Eckel
f6a7a56704
* added default params for x/machine/params (#310)
Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>
2024-02-01 15:24:41 +01:00
Jürgen Eckel
373614e1b2
269 set a chain wide upper gas limit for transactions (#309)
* 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>
2024-02-01 10:23:38 +01:00
Lorenz Herzberger
a38fe781ba
187 implement rddl claim (#298)
* ignite scaffold map redeem-claim amount issued:bool --module dao --index beneficiary,liquid-tx-hash

* revert: remove autogenerated delete redeem claim logic

* fix: replace deprecated autogenerated sdkerrors with errorsmod

* refactor: rename issued to confirmed on redeem claim

* feat: add claim address param

* test: add test for restricted msg UpdateRedeemClaim

* refactor: update redeem claim key creation and messages

* feat: add SendUpdateRedeemCLaim to util

* feat: add RedeemClaimDecorator for ante package

* ignite scaffold message confirm-redeem-claim id:uint beneficiary:string --module dao

* feat: add handleConfirmRedeemClaim to ante handler

* feat: add handleUpdateRedeemClaim to ante handler

* feat: implement ConfirmRedeemClaim msg handler

* test: add redeem claim test and adjust e2e test suite

* fix: make use of uint to rddl string util in CreateRedeemClaim

* fix: linter and staticcheck errors

* ignite scaffold query redeem-claim-by-liquid-tx-hash liquid-tx-hash --response redeem-claim:RedeemClaim --module dao

* feat: add RedeemClaimByLiquidTXHash store capabilities

* test: add QueryRedeemClaimByLiquidTxHash to e2e test suite

* feat: add RedeemClaimDecorator to ante handler chain

* fix: remove redundant planetmint-go from service path

* fix: linter and staticcheck errors

* fix: go vet errors

* fix: remove unused autogenerated simulation

* fix: broken simulation

* fix: openapi.yml

* revert: remove autogenerated redundant test file that causes data race on pipeline

* feat: burn claim on CreateRedeemClaim

* fix: linter error

* test: fix mock bankkeeper for msg server test

* fix: reissuance test if statement

* chore: removed TODO comment

* fix: typo in redeem claim error msg

* revert: remove autogenerated genesis state

* fix: dao module simulation

* revert: remove unused function

* fix: linter errors

* fix: linter error

---------

Signed-off-by: Lorenz Herzberger <lorenzherzberger@gmail.com>
2024-02-01 09:57:58 +01:00
Jürgen Eckel
a29f394bc4
192 migrate config params to on chain module params (#307)
* initial refactoring commit
* added config passing to network creation for some test suits
* fixed refactoring issues
* adjusted params

Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>
2024-01-30 16:12:04 +01:00
Julian Strobl
df264421b4
chore: bump lib version to v0.4.1
Signed-off-by: Julian Strobl <jmastr@mailbox.org>
lib/v0.4.1 v0.7.4
2024-01-30 12:15:58 +01:00
Julian Strobl
23648927c3
feat: put sequence files into sub-directory (#308)
- 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>
2024-01-30 12:13:05 +01:00
Jürgen Eckel
bfbe9584a1
296 change distribution (#306)
* 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>
2024-01-29 14:33:40 +01:00
Jürgen Eckel
f6509cfa64
removed StakeDenom and it's related code (#299)
* removed StakeDenom and it's related code
* fixed PoP, reissuance & distribution tests

Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>
2024-01-25 15:10:07 +01:00
Jürgen Eckel
2a9d3d4b47
lazy loading of config.GetConfig calls (#293)
* 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>
v0.7.3
2024-01-22 11:03:11 +01:00