302 Commits

Author SHA1 Message Date
Julian Strobl
d0e269a478
lib: bump version to v0.4.0
Signed-off-by: Julian Strobl <jmastr@mailbox.org>
lib/v0.4.0 v0.7.0
2024-01-12 10:03:24 +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
986685d8db
test: add e2e test for asset distribution (#276)
Closes #164

Signed-off-by: Julian Strobl <jmastr@mailbox.org>
2024-01-11 16:56:35 +01:00
Lorenz Herzberger
461891cde8
refactor: remove duplicate test scenarios (#278)
* refactor: remove duplicate test scenarios

* chore: remove deprecated rest testutil
---------

Signed-off-by: Lorenz Herzberger <lorenzherzberger@gmail.com>
2024-01-11 15:59:53 +01:00
Lorenz Herzberger
2534828fc6
feature: add ante handler to block non validators from sending restri… (#273)
* 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>
2024-01-11 14:33:20 +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
Lorenz Herzberger
4042968dff
Add gaskv ante decorator (#268)
* feature: add gaskv ante handler

* test: add test case for gaskv consumption

* chore: fix typo

* test: split up consumption test cases

* test: replace contains with equal

* fix: linter error
---------

Signed-off-by: Lorenz Herzberger <lorenzherzberger@gmail.com>
2024-01-10 16:49:48 +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
Julian Strobl
2cf9bd4c43
refactor: replace raw tx by command in reissuance (#266)
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>
2024-01-10 10:30:58 +01:00
Julian Strobl
094f547e7a
fix: app logger formatting (#265)
From this:
```
ERR [app] reissue: failed. valid result: %v proposer: %s validator
identity: %s module=server
```
to this:
```
ERR [app] reissue: failed. valid result: true proposer:
9d3b2072f96f9481de983700605fbcd9158d5b63 validator identity:
31615187759d4bdb1c43ea7e7b9be91066042fbf module=server
```

Signed-off-by: Julian Strobl <jmastr@mailbox.org>
2024-01-09 16:55:33 +01:00
Julian Strobl
25649be550
fix: remove check from machine attestation request (#264)
`k.isNFTCreationRequest(msg.Machine)` was removed as it became obsolete
and we are not issuing generic tokens from within the machine
attestation process.

Closes #242

Signed-off-by: Julian Strobl <jmastr@mailbox.org>
2024-01-09 10:25:50 +01:00
Julian Strobl
6d05f85cbd
Use lib in rest e2e machine test (#263)
* refactor: align variable name with rest of the code

Signed-off-by: Julian Strobl <jmastr@mailbox.org>
2024-01-09 10:14:54 +01:00
Julian Strobl
ae161f11e5
refactor: let lib set client context's address and name (#261)
* fix: make a real copy of bytes.Buffer

* refactor: rename `address` for maximum clarity in lib

Signed-off-by: Julian Strobl <jmastr@mailbox.org>
2024-01-08 16:04:42 +01:00
Julian Strobl
3e23260a9c
test: refactor broadcast tx into function (#259)
Force test cases to check tx response for errors.

* refactor: improve broadcast error logging

Signed-off-by: Julian Strobl <jmastr@mailbox.org>
2024-01-05 13:43:52 +01:00
Julian Strobl
fa05ec7fff
Fix test pop result (#258)
* chore: update elements-rpc to v0.5.2

* fix: logging output in dao keeper

* refactor: properly check broadcast tx output

* fix: use correct proposer address in test

Otherwise we get an error like:
```
[app] reissue: failed. valid result: true proposer: plmnt1gyg6lxcre5f8t4ef0uxcqen9jczwalzjvc25k8
  validator identity: fb7ecaf9584dfdc67265f599155571651c149207
```

Signed-off-by: Julian Strobl <jmastr@mailbox.org>
2024-01-05 09:49:40 +01:00
Julian Strobl
4599bc2c78
refactor: improve logging (#257)
* refactor: improve logging

- Introduce logger tags
- Log variable contents
- Fix testing logger to support string formatting

* refactor: set logging context

And move logging into function.

Signed-off-by: Julian Strobl <jmastr@mailbox.org>
2024-01-04 12:50:34 +01:00
Lorenz Herzberger
6bff8e835d
Split up e2e test suites to run separately (#256)
* refactor: Split up machine e2e test suites

* refactor: move CreateAccount and FundAccount to testutil/e2e

* refactor: add AttestMachine to testutil/e2e

* refactor: split up asset e2e test suites

* refactor: make use of testutil in e2e dao suite

Signed-off-by: Lorenz Herzberger <lorenzherzberger@gmail.com>
2024-01-04 07:43:01 +01:00
Julian Strobl
99031fb857
lib: add initial e2e tests (#255)
* fix: only increase counter if broadcast was successful

Otherwise we will get account and sequence numbers mismatches.

* test: add initial e2e tests for `lib/`

Signed-off-by: Julian Strobl <jmastr@mailbox.org>
2024-01-03 13:08:13 +01:00
Julian Strobl
f957f540a1
Refactor lib (#254)
* refactor: remove unwanted function in `lib`

The `lib` shall always be used with file lock.

* refactor: log `txResponse` in `buildSignBroadcastTx`

- Move `GetTxResponseFromOut` from `testutil` to `lib`

Signed-off-by: Julian Strobl <jmastr@mailbox.org>
2024-01-03 10:41:09 +01:00
dependabot[bot]
3ca729c15b
Bump github.com/dvsekhvalnov/jose2go from 1.5.0 to 1.6.0 in /lib (#252)
Bumps [github.com/dvsekhvalnov/jose2go](https://github.com/dvsekhvalnov/jose2go) from 1.5.0 to 1.6.0.
- [Commits](https://github.com/dvsekhvalnov/jose2go/compare/v1.5...v1.6.0)

---
updated-dependencies:
- dependency-name: github.com/dvsekhvalnov/jose2go
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-03 10:36:49 +01:00
dependabot[bot]
e4a57914cd
Bump github.com/dvsekhvalnov/jose2go from 1.5.0 to 1.6.0 (#253)
Bumps [github.com/dvsekhvalnov/jose2go](https://github.com/dvsekhvalnov/jose2go) from 1.5.0 to 1.6.0.
- [Commits](https://github.com/dvsekhvalnov/jose2go/compare/v1.5...v1.6.0)

---
updated-dependencies:
- dependency-name: github.com/dvsekhvalnov/jose2go
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-03 10:32:04 +01:00
Julian Strobl
48b3145aaa
refactor: github audit workflow (#251)
Execute jobs in parallel to speed up the workflow.

Signed-off-by: Julian Strobl <jmastr@mailbox.org>
2024-01-03 09:24:17 +01:00
Julian Strobl
f812a8c543
fix: do not try to notarize liquid asset here (#250)
Actually error in case of error.

Signed-off-by: Julian Strobl <jmastr@mailbox.org>
2024-01-02 14:59:22 +01:00
Julian Strobl
a1d6923ca3
Support releasing from different branch (#249)
* ci: support releasing from different branch
* fix: git tags are not fetched

This preveted to detect if a `LIB_TAG` is already there.

Signed-off-by: Julian Strobl <jmastr@mailbox.org>
2023-12-22 11:25:32 +01:00
Julian Strobl
926fc76659
* fixed the cause for different results by different keepers during the processing of the distribution rewards. (#248)
Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>
Co-authored-by: Jürgen Eckel <juergen@riddleandcode.com>
2023-12-22 10:07:53 +01:00
Julian Strobl
1d41d050fe
feat: add mqtt mock client (#245)
Signed-off-by: Julian Strobl <jmastr@mailbox.org>
2023-12-21 13:03:10 +01:00
Lorenz Herzberger
0cab7d5878
217 pop participant election (#244)
* 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>
2023-12-21 12:29:11 +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
00aba3115f
[lib] Bump version to v0.3.0
Signed-off-by: Julian Strobl <jmastr@mailbox.org>
lib/v0.3.0 v0.6.6
2023-12-19 09:11:52 +01:00
Jürgen Eckel
379cc761b2
adjusted re-issuance values and the corresponding test cases. (#238)
* adjusted re-issuance values and the corresponding test cases.
* [test] Fix `TestPoPResult`
* [test] Revert `TestReissuance`

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-12-19 09:02:35 +01:00
dependabot[bot]
618f8835be
Bump golang.org/x/crypto from 0.14.0 to 0.17.0 in /lib (#240)
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.14.0 to 0.17.0.
- [Commits](https://github.com/golang/crypto/compare/v0.14.0...v0.17.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-19 08:27:52 +01:00
dependabot[bot]
94ecb64034
Bump golang.org/x/crypto from 0.14.0 to 0.17.0 (#239)
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.14.0 to 0.17.0.
- [Commits](https://github.com/golang/crypto/compare/v0.14.0...v0.17.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-19 08:18:49 +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
036ce7cbc1
Enable sequence file locking in tests (#236)
* [lib] Add `FeeGranter` to tx factory
* [lib] Align return value with test cases
* [test] Return error on tx response
* [test] Switch to sequence file locking via libRPC
* [test] Reintegrate `TestPoPResult`

Closes #234


Signed-off-by: Julian Strobl <jmastr@mailbox.org>
2023-12-18 15:47:44 +01:00
Julian Strobl
487dc3b93c
[test] Check TxResponse on every ExecTestCLICmd() (#235)
Just a small improvement to not forget to check the error code of the
transaction and not only from the command itself.

Signed-off-by: Julian Strobl <jmastr@mailbox.org>
2023-12-15 11:32:29 +01:00
Lorenz Herzberger
0d74b81ac9
210 make distribution dependent reissuance (#216)
* distribution now requires re-issuance
* change claim conversion to use fixed uint amounts
* change initialization of util variable
* move rpc conf init to app config init


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-15 09:39:02 +01:00
Julian Strobl
ff2f2eb386
[test] Use elements RPC mock server (#232)
Fix `reissueasset` in tests.

Signed-off-by: Julian Strobl <jmastr@mailbox.org>
2023-12-13 15:42:09 +01:00
Lorenz Herzberger
bb8e055e44
add challenges query (#231)
* add challenges query

* implement query reissuances paginated

* fix linter errors

---------

Signed-off-by: Lorenz Herzberger <lorenzherzberger@gmail.com>
2023-12-13 11:47:32 +01:00
Julian Strobl
804a8e5be6
Add AppLogger to test runs (#230)
* [log] Do not create a new object of `GetAppLogger()` every time

* [tests] Enable AppLogger during testing

Signed-off-by: Julian Strobl <jmastr@mailbox.org>
2023-12-12 13:39:37 +01:00
Jürgen Eckel
3c1a2fa776
fixed precsion issue within the distribution order (#229)
* fixed precision issue within the distribution order
* adjusted test cases: migrated from uint64 to float64
---------

Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>
2023-12-12 13:15:14 +01:00
Julian Strobl
7b381f3313
Use elements RPC library (#225)
* Use elements RPC library

// Closes #218

Signed-off-by: Julian Strobl <jmastr@mailbox.org>
2023-12-12 12:14:19 +01:00
Jürgen Eckel
2b19b8194b
Fix distribution bugs (#228)
* fixed missing-proposer bug for asset distribution

* improved logging

reduced type conversions and potential errors

Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>
2023-12-12 11:09:33 +01:00
Jürgen Eckel
73b0d1b4c8
Add GetDistribution query (#227)
Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>
2023-12-12 10:13:27 +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
Julian Strobl
df8ece2a30
Fix TestReissuance() E2E test (#214)
* [lib] Add fee denominator parameter

* [lib] Add client context parameter

e.g. the test cases create their own client context.

* [lib] Reset client context's output

Otherwise if the client context does not change, output gets appended
and gets un-parsable.

* [test] Set missing validator client context values

Necessary for sending transactions.

* [test] Configure RPC library

* [test] Fix `TestReissuance()`

// Closes #195

* Partially revert "[lib] Provide default encoding config (#209)"

This reverts commit 8a8a3aaaf2648f87c4052575bc1a60b23056463b.

Fix README example.

Signed-off-by: Julian Strobl <jmastr@mailbox.org>
2023-12-07 09:57:33 +01:00
Jürgen Eckel
ff6aab33df
Fix error throwing bug that lead to block creation inconsistencies (#212)
* removed error throwing within the AttestMachine method
* add more extensive logging around that call

Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>
2023-12-06 11:20:37 +01:00
Julian Strobl
0455176123
[ci] Pin ignite version to v0.27.1 (#213)
Version v28.0.0 was released and breaks the pipeline.

Signed-off-by: Julian Strobl <jmastr@mailbox.org>
2023-12-06 11:13:04 +01:00