45 Commits

Author SHA1 Message Date
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>
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>
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
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>
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.
2024-03-01 12:42:44 +01:00
Julian Strobl
b205c5ff29
Revert "Revert unnecessary config patch (#323)" (#324)
This reverts commit b1c4d11ccf3e98bd46a13d7fb54b6b5c0aefbf29.
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
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
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
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
3ca10dfff1
Verifying the availability of PoP participants (#274)
* 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>
2024-01-12 10:02:09 +01:00
Julian Strobl
001a472ef9
Refactoring and fixes (#272)
* 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>
2024-01-11 10:39:25 +01:00
Julian Strobl
7e3c0b719b
fix: distribution relative to the reissuance epoch (#270)
- reissuance   = 1 day
- distribution = 1 day + 30 min

expectation:
- reissuance:   1 day, 2 day, 3 day, ...
- distribution: 1 day + 30 min, 2 day + 30 min, 3 day + 30 min, ...

without patch:
- reissuance:   1 day, 2 day, 3 day, ...
- distribution: 1 day + 30 min, 2 day + 60 min, 3 day + 90 min, ...

Closes #260

Signed-off-by: Julian Strobl <jmastr@mailbox.org>
2024-01-11 10:27:57 +01:00
Julian Strobl
fc9e795bd0
refactor: fix casing for reissuance variable (#267)
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>
2024-01-10 10:47:38 +01:00
Jürgen Eckel
c09aab8b38
Initializing the PoP process on the tasmota nodes (#243)
* 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>
2023-12-20 10:01:28 +01:00
Julian Strobl
fd58362a42
Fix typo and align log messages (#241)
* 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>
2023-12-19 14:28:15 +01:00
Julian Strobl
7ac0f31de0
[config] Default config shall point to testnet (#237)
Signed-off-by: Julian Strobl <jmastr@mailbox.org>
2023-12-18 16:14:34 +01:00
Julian Strobl
ede70b073b
Replace call to external python program (#215)
* Split asset registry endpoint

Into scheme, domain and path. We need the domain in the liquid contract.

* Switch to pure Go implementation

This is a reimplementation of the `issue2liquid.py`.

See https://github.com/rddl-network/issuer_service

// Closes #196

* Move elements RPC URL into config

Signed-off-by: Julian Strobl <jmastr@mailbox.org>
2023-12-11 15:53:58 +01:00
Julian Strobl
363d82d344
[ci] Improve staticcheck setup (#221)
* [staticcheck] Fix comments on exported functions and structs

* [ci] Improve staticcheck setup

- Add global staticcheck.conf file
- Ignore: at least one file in a package should have a package comment (ST1000)
- Ignore deprecation warnings. They are reported by golangci-lint and
  there we have a proper way to exclude generated files.

Signed-off-by: Julian Strobl <jmastr@mailbox.org>
2023-12-11 11:41:45 +01:00
Lorenz Herzberger
94830df5fc
184 implement staged claim (#190)
* 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>
2023-12-05 10:51:06 +01:00
Julian Strobl
5b25d4cefc
Improve linter setup (#186)
* [linter] Add `musttag`

Enforce field tags in (un)marshaled structs.

* [linter] Add `nestif`

Reports deeply nested if statements.

* [linter] Add `noctx`

Finds sending http request without context.Context.

* [linter] Add `paralleltest`

Paralleltest detects missing usage of t.Parallel() method in your Go
test.

* [linter] Add `tagalign`

Check that struct tags are well aligned.

* [linter] Add `tagliatelle`

Checks the struct tags.

* [linter] Add `whitespace`

Tool for detection of leading and trailing whitespace.

* [paralleltest] Exclude files bc of data race in tests

Signed-off-by: Julian Strobl <jmastr@mailbox.org>
2023-11-17 10:56:25 +01:00
Jürgen Eckel
a982abecf5
Distribute assets (#162)
* distributed & result msgs
* added DistributionResult
* added RDDL token conversion methods
* set proper validatoraddress within the testcases for e2e/dao
* set proper root dir for test cases
* fixed some wordings
---------

Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>
2023-11-15 13:31:20 +01:00
Lorenz Herzberger
83d493dd94
139 implement mint address param (#174)
* add MintAddress to params.proto

* ignite scaffold message update-params params:Params --module dao

* add dao get and set params

* make dao.MsgUpdateParams.Params non-nullable

* use GetMintAddress in ante handler

* adjust dao e2e test suit for mint address param

* change msg creator to authority and set gov module as default in gov proposal

* fix staticcheck error

* remove depricated config param

* fix linter errors

Signed-off-by: Lorenz Herzberger <lorenzherzberger@gmail.com>
2023-11-15 10:46:01 +01:00
Julian Strobl
8a2a05f2fb
Fix default validator address in app.toml (#169)
Copy&paste error.

Signed-off-by: Julian Strobl <jmastr@mailbox.org>
2023-11-08 15:20:40 +01:00
Julian Strobl
0b6b1e120a
DRY: Use RootDir from main config (#155)
Usually passed by `--home`.

Signed-off-by: Julian Strobl <jmastr@mailbox.org>
2023-10-23 10:45:10 +02:00
Julian Strobl
e10416b23d
Use globally defined keyring backend from client.toml (#156)
This partially reverts commit 1927c4d47219c428e4d12cfd9015f0137af7a030.

// Closes #142

Signed-off-by: Julian Strobl <jmastr@mailbox.org>
2023-10-19 09:48:18 +02:00
Jürgen Eckel
1927c4d472
Eckelj/support keyring (#136)
* added keyring option
* added Reissuance workflow logging

Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>
2023-10-11 16:02:37 +02:00
Jürgen Eckel
b4ddc44044
* integrated ante-handler
* added two new config variables: reissuance-asset and validator-address

Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>
2023-10-10 01:24:28 +02:00
Jürgen Eckel
ef52e51ec8
Merge branch 'main' into 124-propose-a-liquid-issuance-to-the-network-unsigned-transaction 2023-10-06 12:00:08 +02:00
Julian Strobl
ec77832ca1
Fix missing quotes
Signed-off-by: Julian Strobl <jmastr@mailbox.org>
2023-10-06 11:54:24 +02:00
Jürgen Eckel
b81cdb6dc9
Merge branch 'main' into 124-propose-a-liquid-issuance-to-the-network-unsigned-transaction
Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>
2023-10-05 16:09:10 +02:00
Lorenz Herzberger
7a3ccccc7a
119 create dao msg to mint plmnt on demand (#122)
* add mint address to config file
* ignite scaffold type mint-request beneficiary amount liquid-tx-hash --module dao
* add mintrequest stores
* rename mint_request.go
* add unit tests for mint request store
* ignite scaffold message mint-token mint-request:MintRequest --module dao
* add ante handler for mint address
* add msg validation for mint request
* fix staticcheck error
* ignite scaffold query get-mint-requests-by-hash hash --response mint-request:MintRequest --module dao
* add a query for mint request and additional validation for msg server
* add mock for mint unit testing
* add unit test for mint token msg server
* add unit tests for query mint requests by hash
* ignite scaffold query mint-requests-by-address address --response mint-requests:MintRequests --module dao
* implement query mint requests by address and unit tests
* add e2e test for token mint

---------

Signed-off-by: Lorenz Herzberger <lorenzherzberger@gmail.com>
2023-10-05 15:38:53 +02:00
Jürgen Eckel
4ad86048a5
initial reissue rddl proposal message
Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>
2023-10-05 15:02:36 +02:00
Jürgen Eckel
f11f66e14f
112 direct call to issue2liquid (#121)
* removed IssueResponseHandler
* added asset-registration endpoint config
* added methods to locally issue the asset and register it
* added issue_service directory configuration
* removed obsolete configuration options
Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>

---------

Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>
2023-10-05 12:38:35 +02:00
Lorenz Herzberger
c12a30c71a
2 trigger token reissuance on liquid including the distribution (#96)
* add pop epochs to config

* add config for triggering RDDL issuance

---------

Signed-off-by: Lorenz Herzberger <lorenzherzberger@gmail.com>
2023-09-28 16:07:02 +02:00
Lorenz Herzberger
86a85913cf
add GetMachineByAddress capabilities
Signed-off-by: Lorenz Herzberger <lorenzherzberger@gmail.com>
2023-09-25 16:42:26 +02:00
Julian Strobl
2f2adb4543
Fix toml: incomplete number
```
$ go build -v ./cmd/planetmint-god/
$ rm -rf ~/.planetmint-go ~/.ignite
$ ignite chain init --check-dependencies --clear-cache
```

https://github.com/spf13/viper/issues/1434#issuecomment-1259326026

Signed-off-by: Julian Strobl <jmastr@mailbox.org>
2023-09-12 14:36:14 +02:00
Lorenz Herzberger
c58dda2034
add denoms to config
Signed-off-by: Lorenz Herzberger <lorenzherzberger@gmail.com>
2023-09-05 11:03:42 +02:00
Julian Strobl
1383d0aaa6
Add extended public key as IssuerPlanetmint (#62)
* Fix package and domain name

Signed-off-by: Julian Strobl <jmastr@mailbox.org>

* Add extended public key as `IssuerPlanetmint`

This patch introduces parts of the `chaincfg` for Planetmint and
especially the magic bytes that produces extended keys with the prefix
`pmpr` for a Planetmint extended private key and `pmpb` for a Planetmint
extended public key.

// Closes https://github.com/rddl-network/issues/issues/30

Signed-off-by: Julian Strobl <jmastr@mailbox.org>

* Validate Planetmint extended public key during machine attestation

Signed-off-by: Julian Strobl <jmastr@mailbox.org>

* [lint] Fix error return value is not checked

Signed-off-by: Julian Strobl <jmastr@mailbox.org>

---------

Signed-off-by: Julian Strobl <jmastr@mailbox.org>
2023-08-11 09:14:52 +02:00
Jürgen Eckel
01ef2dbfd0
Improve communication to liquid issuance service (#58)
* added OSC response listener with logging

added Machine NFT issuance for each machine attestation process
added CID and Planetmint Issuer extPublicKey to the issuance process
removed type inconsistency

* added machine NFT creation criteria

* [toml] Parsing does not allow sub-structs

* made OSC listener port configurable

Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>
Signed-off-by: Julian Strobl <jmastr@mailbox.org>
Co-authored-by: Julian Strobl <jmastr@mailbox.org>
2023-08-04 16:38:18 +02:00
Julian Strobl
4ba12f7b03
[config] Add planetmint section to app.toml
This patch extends `app.toml` and adds the following section with these
default values:

```
[planetmint]
watchmen-endpoint = "localhost"
watchmen-port = 7401
```

A global singleton `plmntConfig` is introduced to save and access the
values similar to how cosmos does it (see
vendor/github.com/cosmos/cosmos-sdk/types/config.go).

Different environments can be managed by changing the values in
`app.toml` and restarting the daemon.

// Closes #53

Signed-off-by: Julian Strobl <jmastr@mailbox.org>
2023-08-04 10:53:38 +02:00
Lorenz Herzberger
b92758268d
rename config and adjust osc call
Signed-off-by: Lorenz Herzberger <lorenzherzberger@gmail.com>
Signed-off-by: Julian Strobl <jmastr@mailbox.org>
2023-07-31 08:21:28 +02:00
Lorenz Herzberger
238e68808b
add config for watchmen
Signed-off-by: Lorenz Herzberger <lorenzherzberger@gmail.com>
2023-07-31 08:21:28 +02:00