Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backport #5050 & #5132 to release/1.35 #5151

Closed

Conversation

KtorZ
Copy link
Contributor

@KtorZ KtorZ commented Apr 25, 2023

Description

Fixes #5150 (cc @newhoggy)

*   7f4336062 - (HEAD -> release/1.35) Merge branch '#5132-1.35-backport' into release/1.35 (19 seconds ago) <KtorZ>
|\  
| * 75e31eebd - (#5132-1.35-backport) Rework integration tests for governance commands (33 seconds ago) <KtorZ>
| * 0929d0476 - Use more meaningful (phantom) types for files around governance commands. (5 minutes ago) <KtorZ>
| * 5ba4ef7d6 - Re-implement command-line handler for 'governance verify-poll' (5 minutes ago) <KtorZ>
| * 4d07eb171 - Remove VRF signing option for producing SPO on-chain poll answers (8 minutes ago) <KtorZ>
|/  
*   f51d277f3 - Merge branch '#5050-1.35-backport' into release/1.35 (56 minutes ago) <KtorZ>
|\  
| * 5814f3b5c - (#5050-1.35-backport) Add property tests for 'chunks', and fix 'metaTextChunks' (57 minutes ago) <KtorZ>
| * a535b7585 - Add roundtrip serialization property tests for GovernancePoll{Answer, Witness} (65 minutes ago) <KtorZ>
| * 8ddeb6609 - Write automated tests to cover newly introduced SPO on-chain poll commands (65 minutes ago) <KtorZ>
| * cd877008c - Introduce a new test helper function: tryExecCardanoCLI (68 minutes ago) <KtorZ>
| * f53a3086e - Wire newly introduce governance commands in the CLI (68 minutes ago) <KtorZ>
| * 8acb364ed - Define commands behavior for {create,answer,verify}-poll (68 minutes ago) <KtorZ>
| * 392faaaee - Implement (de)serialization methods for GovernancePoll objects (2 hours ago) <KtorZ>
| * 749511de6 - Define new Governance.Poll types and high-level interface (2 hours ago) <KtorZ>
| * 85285d855 - Add 'meta{Bytes,Text}chunks helper smart-constructors for TxMetadataValue (2 hours ago) <KtorZ>
| * 8cf21028a - Expose bytes and text limit constraints on metadata value. (2 hours ago) <KtorZ>
|/  
*   f0b4ac897 - (tag: 1.35.7, origin/release/1.35) Merge pull request #5018 from input-output-hk/coot/4465_fixes (4 weeks ago) <Samuel Leathers>

Checklist

  • Commit sequence broadly makes sense and commits have useful messages
  • New tests are added if needed and existing tests are updated. These may include:
    • golden tests
    • property tests
    • roundtrip tests
    • integration tests
      See Runnings tests for more details
  • Any changes are noted in the CHANGELOG.md for affected package
  • The version bounds in .cabal files are updated
  • CI passes. See note on CI. The following CI checks are required:
    • Code is linted with hlint. See .github/workflows/check-hlint.yml to get the hlint version
    • Code is formatted with stylish-haskell. See .github/workflows/stylish-haskell.yml to get the stylish-haskell version
    • Code builds on Linux, MacOS and Windows for ghc-8.10.7 and ghc-9.2.7
  • Self-reviewed the diff

Note on CI

If your PR is from a fork, the necessary CI jobs won't trigger automatically for security reasons.
You will need to get someone with write privileges. Please contact IOG node developers to do this
for you.

newhoggy and others added 30 commits March 21, 2023 09:57
…raight-line-code-for-tx-commands

Straight line code for tx commands
…grade-to-cabal-3.10.1.0

Upgrade to cabal-3.10.1.0
…ics-mapping

Backward compatibility for Prometheus metrics names
…rdano-ping

New cardano-cli ping command.
- makeByronTransactionBody guards against overflows in the transaction indices,
but makeShelleyTransactionBody does not.
- Add appropriate guards to makeShelleyTransactionBody.
I revised a bunch of things in CHaP and the constraints are not needed
any more.
Split it into node-to-node and node-to-client. This is needed so that the
log contains information whether the version numbers (now encoded as
numbers) are node-to-node or node-to-client version.
Fixes input-output-hk/ouroboros-network#3691
The warning is not needed as of ouroboros-network#3859.
P2P is now an early release: we encourage to enable it on at most one of
the relays (if one has more than one relay).  We don't advise yet to use
it on BP nodes.
…etwork-version-repr

Use JSON instances for NodeToNodeVersion & NodeToClientVersion
…constraints

Bump CHaP and remove most constraints from the cabal file
…-genesis

workbench: Distribute genesis using an intermediate storage service
newhoggy and others added 13 commits April 19, 2023 07:34
…le-type-2

File type to track the content and direction of files
…w-mkExecConfig-function

New mkExecConfig function
  And also, remove the poll witnesses altogether from metadata.
  Since we'll now only rely on cold key signing, we can rely on the
  existing witness mechanism of transactions (combined with the
  'required extra signatories' field).

  This slightly adjust the 'verifyPollAnswer' function to now work
  directly from a transaction and return the actual signatories.
  Consumers can then verify whether signatories meet their expected
  criteria.
  As well as finalize the metadata extraction logic on the API's side.
  This is mostly the same thing as before, but it now takes a signed
  transaction file for verification instead of a standalone metadata.

  ```
  ❯ cardano-cli governance verify-poll --poll-file polls/basic.json --tx-file verify/valid
  Found valid poll answer, signed by:
  [
      "f8db28823f8ebd01a2d9e24efb2f0d18e387665770274513e370b5d5"
  ]
  ```

  ```
  ❯ cardano-cli -- governance verify-poll --poll-file polls/basic.json --tx-file verify/none
  Command failed: governance verify-poll  Error: No answer found in the provided transaction's metadata.
  ```

  ```
  ❯ cardano-cli -- governance verify-poll --poll-file polls/basic.json --tx-file verify/malformed
  Command failed: governance verify-poll  Error: Malformed metadata; couldn't deserialise answer: An error occured while decoding GovernancePollAnswer.2.
  Error: missing mandatory field
  ```

  ```
  ❯ cardano-cli -- governance verify-poll --poll-file polls/basic.json --tx-file verify/invalid
  Command failed: governance verify-poll  Error: Invalid answer (42) not part of the poll.
  Accepted answers:
  0 → yes
  1 → no
  ```

  ```
  ❯ cardano-cli -- governance verify-poll --poll-file polls/basic.json --tx-file verify/mismatch
  Command failed: governance verify-poll  Error: Answer's poll doesn't match provided poll (hash mismatch).
  ```
  - [x] Cover new error cases for 'verify'
  - [x] Create full-blown test transactions for 'verify'
  - [x] Slightly re-organised and re-structure data folder
  - [x] Remove now-unnecessary old files

  ```
  ❯ tree cardano-cli/test/data/golden/shelley/governance
  .
  ├── answer
  │   └── basic.json
  ├── cold.sk
  ├── cold.vk
  ├── create
  │   ├── basic.json
  │   └── long-text.json
  ├── polls
  │   ├── basic.json
  │   └── long-text.json
  └── verify
      ├── invalid
      ├── malformed
      ├── mismatch
      ├── none
      └── valid
  ```
@KtorZ KtorZ changed the title Cip 0094 on chain spo polls Backport #5050 & #5132 to release/1.35 Apr 25, 2023
@KtorZ KtorZ changed the base branch from cip-0094-on-chain-spo-polls to release/1.35 April 25, 2023 09:29
@KtorZ KtorZ requested a review from coot as a code owner April 25, 2023 09:29
@KtorZ KtorZ closed this Apr 25, 2023
@KtorZ KtorZ deleted the cip-0094-on-chain-spo-polls branch May 3, 2023 10:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.