Commit graph

39 commits

Author SHA1 Message Date
8091abd1b4 pallas-txbuilder: voting_procedures rejects empty CBOR maps
AUDIT-2026-05-06 M-4 fix from the aldabra Phase 3-6 audit.

NonEmptyKeyValuePairs::decode in pallas-codec accepts `0xa0`
(empty CBOR map) because the upstream empty-map check is commented
out. That decoded value re-encodes correctly and passes through
pallas-txbuilder, but the resulting Conway tx fails ledger validation
at submit time with a non-obvious error.

Add a debug_assert_ne! on the builder method input + clear doc note
warning callers to omit the field instead of passing an empty map.
Release builds pass through (no overhead); dev/test builds catch
accidental empty-map calls with a clear panic message.

The pre-existing aldabra build_signed_drep_vote_cast always
constructs a non-empty map so it doesn't trip this; the guard is for
future callers.
2026-05-06 08:05:55 -07:00
507fd9da15 pallas-txbuilder: thread voting_procedures through StagingTransaction → Conway build
Fills the third of pallas-txbuilder's Conway TODOs (after auxiliary_data
+ certificates):

- StagingTransaction gains `voting_procedures: Option<Vec<u8>>` (opaque
  CBOR — same Eq-derive workaround as auxiliary_data + certificates)
- Builder methods .voting_procedures(cbor_bytes) + .clear_voting_procedures()
- conway::build_conway_raw decodes via VotingProcedures::decode_fragment
  and assigns to TransactionBody.voting_procedures

VotingProcedures is itself a NonEmptyKeyValuePairs<Voter,
NonEmptyKeyValuePairs<GovActionId, VotingProcedure>> map, so callers
pre-assemble the full map and encode once.

Tests:
- voting_procedures_plumb_through_to_tx_body — encode DRepKey vote-Yes
  on a synthetic GovActionId, build, decode, assert round-trip
- no_voting_procedures_means_none — negative path
2026-05-06 07:11:23 -07:00
68221fbcb5 pallas-txbuilder: thread certificates through StagingTransaction → Conway build
second of the upstream TODOs. addresses the `// pub certificates: TODO`
comment in transaction/model.rs and the `certificates: None, // TODO`
in conway.rs:243.

implementation:
- new field: pub certificates: Option<Vec<Vec<u8>>> on StagingTransaction.
  cbor bytes per cert (each entry is conway::Certificate) — same opaque-
  bytes pattern as auxiliary_data, for the same reason (Certificate
  doesn't impl Eq).
- builder: .add_certificate(cbor_bytes) and .clear_certificates().
- conway::build_conway_raw decodes each entry via
  Certificate::decode_fragment + plumbs into TransactionBody.certificates
  via NonEmptySet::from_vec. fragment-decode failures map to
  TxBuilderError::CorruptedTxBytes (same as aux_data path).

tests:
- certificates_plumb_through_to_tx_body: encodes a
  StakeRegistration(AddrKeyhash([7;28])), attaches, builds, decodes
  resulting tx, asserts the cert round-trips byte-for-byte.
- no_certificates_means_none: confirms unset path keeps
  body.certificates None (no spurious empty Set).

unblocks aldabra phase 4.6 stake delegation. PR upstream still pending;
this is part of the same vendored fork as the auxiliary_data work.
2026-05-04 12:36:29 -07:00
57b36d3a7c pallas-txbuilder: thread auxiliary_data through StagingTransaction → Conway build
addresses the four TODO comments in pallas-txbuilder/src/transaction/model.rs
and conway.rs around auxiliary_data + auxiliary_data_hash. without this the
conway builder hardcodes auxiliary_data: None, which blocks CIP-20 / CIP-25
/ CIP-68 metadata.

implementation:
- new StagingTransaction field: pub auxiliary_data: Option<Vec<u8>>.
  stored as opaque cbor bytes (caller encodes alonzo::AuxiliaryData) since
  AuxiliaryData itself doesn't impl Eq, which the rest of StagingTransaction
  requires.
- builder methods .auxiliary_data(cbor) and .clear_auxiliary_data().
- conway::build_conway_raw now decodes the bytes back into
  AuxiliaryData::decode_fragment and plugs it into pallas_tx.auxiliary_data.
  the existing auxiliary_data_hash population block is unchanged — it
  already computes the hash from pallas_tx.auxiliary_data after assignment.
- decode failures map to TxBuilderError::CorruptedTxBytes.

tests:
- auxiliary_data_round_trips_through_build: encodes a CIP-25-shaped
  metadata, attaches, builds, decodes resulting tx, asserts both
  body.auxiliary_data_hash matches expected_hash.compute_hash() and the
  aux re-encodes byte-equivalent.
- no_auxiliary_data_means_no_hash: confirms the absence path still works
  (no aux → hash field stays None).

both pre-existing tests (staging_json_roundtrip, built_json_roundtrip,
test_script_data_hash) continue to pass — the new field defaults to None
and rides alongside.

PR upstream pending; using as a vendored patch via [patch.crates-io] on
the Sulkta side until merge.
2026-05-04 12:04:11 -07:00
Santiago Carmuega
af0463f5b6
Release 0.32.1
pallas@0.32.1
pallas-addresses@0.32.1
pallas-applying@0.32.1
pallas-codec@0.32.1
pallas-configs@0.32.1
pallas-crypto@0.32.1
pallas-hardano@0.32.1
pallas-math@0.32.1
pallas-network@0.32.1
pallas-primitives@0.32.1
pallas-traverse@0.32.1
pallas-txbuilder@0.32.1
pallas-utxorpc@0.32.1
pallas-wallet@0.32.1

Generated by cargo-workspaces
2025-06-25 10:28:02 -03:00
Santiago Carmuega
b7b64977e4
Release 0.32.0
pallas@0.32.0
pallas-addresses@0.32.0
pallas-applying@0.32.0
pallas-codec@0.32.0
pallas-configs@0.32.0
pallas-crypto@0.32.0
pallas-hardano@0.32.0
pallas-math@0.32.0
pallas-network@0.32.0
pallas-primitives@0.32.0
pallas-traverse@0.32.0
pallas-txbuilder@0.32.0
pallas-utxorpc@0.32.0
pallas-wallet@0.32.0

Generated by cargo-workspaces
2024-12-29 19:18:18 -03:00
Santiago Carmuega
3a614d2c91
chore: apply new lint warnings from latest clippy (#561) 2024-12-14 17:37:33 -03:00
Logical Mechanism
2864ff45a9
feat(txbuilder): allow cloning of relevant structs (#558)
Co-authored-by: logicalmechanism <logicalmechanism@protonmail.com>
2024-12-13 07:57:36 -03:00
Logical Mechanism
e9b7ec23ee
fix(txbuilder): support adding signatures to Conway transactions (#553)
Co-authored-by: logicalmechanism <logicalmechanism@protonmail.com>
Co-authored-by: logicalmechanism <logicalmechanism@proton.mail>
2024-12-11 21:54:09 -03:00
Santiago Carmuega
bda3889b41
Release 0.31.0
pallas@0.31.0
pallas-addresses@0.31.0
pallas-applying@0.31.0
pallas-codec@0.31.0
pallas-configs@0.31.0
pallas-crypto@0.31.0
pallas-hardano@0.31.0
pallas-math@0.31.0
pallas-network@0.31.0
pallas-primitives@0.31.0
pallas-traverse@0.31.0
pallas-txbuilder@0.31.0
pallas-utxorpc@0.31.0
pallas-wallet@0.31.0

Generated by cargo-workspaces
2024-11-03 12:28:59 -03:00
Joshua Marchand (JSHy)
0dd9bcdd7e
fix(txbuilder): don't include empty redeemers in Conway txs (#532) 2024-10-25 19:06:25 -03:00
Santiago Carmuega
211674d81c
fix(txbuilder): sign transactions using Conway era (#531) 2024-10-24 16:17:34 -03:00
Santiago Carmuega
698d7a4933
feat(txbuilder): compute ScriptDataHash including edge cases (#525)
Co-authored-by: kalomaaan <kalomaaan@gmail.com>
2024-10-22 22:20:58 -03:00
Santiago Carmuega
537cd45c23
refactor: support roundtrip encoding for script data hash components (#526) 2024-10-22 10:09:37 -03:00
Matthias Benkort
969d5612b7
refactor: Re-organize and clean-up pallas-primitives (#523)
* Re-organize and clean-up pallas-primitives

  Namely:

  - Move _common_ (i.e. era-independent) types and structures up to the
    `lib` module; to be shared across all eras. If any of those deviate
    in a subsequent era, it is easy to bring them down and define new
    types from the point of divergence onward. This simplifies the scope
    of each era-specific module and make them slightly easier to
    navigate.

    Note that, each era module still re-export all of the common types
    that's relevant to that particular era. So technically, this
    reorganization doesn't really change anything for callers/users of
    the library.

  - Rename `Scripthash` to `ScriptHash`. Before this commit, both
    actually existed as `ScriptHash` was introduced with the Conway era.
    Yet, they refer to the same thing, so the duplication is simply
    confusing.

  - Rename `One` / `Two` constructors for `NetworkId` to `Testnet` and
    `Mainnet` respectively. Also defined idiomatic `From` & `TryFrom`
    implementation for conversion to and from `u8`. This is a lot let
    confusing!

  - Generalize `PlutusScript` with a constant generic, to avoid
    repetition for each plutus script generated for specific version.
    Note that a distinction is still _necessary_ if we want to provie
    out-of-the-box serialisers for Plutus scripts, which are serialised
    with a tag prefix depending on the language. All else apart, they
    are strictly similar types.

  - Rename `CostMdls` to `CostModels`. Because, common.

  - Rename `plutus_script` to `plutus_v1_script` in the Alonzo's witness
    set, for consistency with other eras.

* Fix ordering of ScriptHash variants.

  This is an odd one. See the note.

* Bump minicbor to v0.25.1

* Add aliases with deprecation warnings to various fields and types.

* revert renaming plutus_script to plutus_v1_script in Alonzo witness

  See https://github.com/txpipe/pallas/pull/523#discussion_r1807329742
2024-10-22 08:57:21 -03:00
Santiago Carmuega
05f8b2bd07
feat(txbuilder): expose independent output builder (#522) 2024-10-17 13:36:33 -03:00
Santiago Carmuega
1bec8be109
Release 0.30.2
pallas@0.30.2
pallas-addresses@0.30.2
pallas-applying@0.30.2
pallas-codec@0.30.2
pallas-configs@0.30.2
pallas-crypto@0.30.2
pallas-hardano@0.30.2
pallas-math@0.30.2
pallas-network@0.30.2
pallas-primitives@0.30.2
pallas-rolldb@0.30.2
pallas-traverse@0.30.2
pallas-txbuilder@0.30.2
pallas-utxorpc@0.30.2
pallas-wallet@0.30.2

Generated by cargo-workspaces
2024-09-08 18:49:23 -03:00
Santiago Carmuega
21640a5c68
Release 0.30.1
pallas@0.30.1
pallas-addresses@0.30.1
pallas-applying@0.30.1
pallas-codec@0.30.1
pallas-configs@0.30.1
pallas-crypto@0.30.1
pallas-hardano@0.30.1
pallas-math@0.30.1
pallas-network@0.30.1
pallas-primitives@0.30.1
pallas-rolldb@0.30.1
pallas-traverse@0.30.1
pallas-txbuilder@0.30.1
pallas-utxorpc@0.30.1
pallas-wallet@0.30.1

Generated by cargo-workspaces
2024-08-25 14:35:15 -03:00
Santiago Carmuega
385973b544
Release 0.30.0
pallas@0.30.0
pallas-addresses@0.30.0
pallas-applying@0.30.0
pallas-codec@0.30.0
pallas-configs@0.30.0
pallas-crypto@0.30.0
pallas-hardano@0.30.0
pallas-math@0.30.0
pallas-network@0.30.0
pallas-primitives@0.30.0
pallas-rolldb@0.30.0
pallas-traverse@0.30.0
pallas-txbuilder@0.30.0
pallas-utxorpc@0.30.0
pallas-wallet@0.30.0

Generated by cargo-workspaces
2024-08-20 14:02:20 -03:00
Joshua Marchand (JSHy)
be681fed92
chore(txbuilder): export ExUnits to make them accessible from outside (#497) 2024-08-02 14:39:49 -03:00
Santiago Carmuega
5d00e2c992
Release 0.29.0
pallas@0.29.0
pallas-addresses@0.29.0
pallas-applying@0.29.0
pallas-codec@0.29.0
pallas-configs@0.29.0
pallas-crypto@0.29.0
pallas-hardano@0.29.0
pallas-math@0.29.0
pallas-network@0.29.0
pallas-primitives@0.29.0
pallas-rolldb@0.29.0
pallas-traverse@0.29.0
pallas-txbuilder@0.29.0
pallas-utxorpc@0.29.0
pallas-wallet@0.29.0

Generated by cargo-workspaces
2024-07-15 22:31:37 -03:00
Santiago Carmuega
412fde4d6c
Release 0.28.0
pallas@0.28.0
pallas-addresses@0.28.0
pallas-applying@0.28.0
pallas-codec@0.28.0
pallas-configs@0.28.0
pallas-crypto@0.28.0
pallas-hardano@0.28.0
pallas-math@0.28.0
pallas-network@0.28.0
pallas-primitives@0.28.0
pallas-rolldb@0.28.0
pallas-traverse@0.28.0
pallas-txbuilder@0.28.0
pallas-utxorpc@0.28.0
pallas-wallet@0.28.0

Generated by cargo-workspaces
2024-07-01 13:39:28 -03:00
Santiago Carmuega
ee505a02e6
fix: relax CBOR decoding of Conway protocol params update (#473) 2024-06-18 13:03:07 -03:00
Santiago Carmuega
91e17f31d1
Release 0.27.0
pallas@0.27.0
pallas-addresses@0.27.0
pallas-applying@0.27.0
pallas-codec@0.27.0
pallas-configs@0.27.0
pallas-crypto@0.27.0
pallas-hardano@0.27.0
pallas-network@0.27.0
pallas-primitives@0.27.0
pallas-rolldb@0.27.0
pallas-traverse@0.27.0
pallas-txbuilder@0.27.0
pallas-utxorpc@0.27.0
pallas-wallet@0.27.0

Generated by cargo-workspaces
2024-06-01 08:47:13 -03:00
Santiago Carmuega
51a81241d3
Release 0.26.0
pallas@0.26.0
pallas-addresses@0.26.0
pallas-applying@0.26.0
pallas-codec@0.26.0
pallas-configs@0.26.0
pallas-crypto@0.26.0
pallas-hardano@0.26.0
pallas-network@0.26.0
pallas-primitives@0.26.0
pallas-rolldb@0.26.0
pallas-traverse@0.26.0
pallas-txbuilder@0.26.0
pallas-utxorpc@0.26.0
pallas-wallet@0.26.0

Generated by cargo-workspaces
2024-05-21 08:32:18 -03:00
Santiago Carmuega
d5fd8f1e20
Release 0.25.0
pallas@0.25.0
pallas-addresses@0.25.0
pallas-applying@0.25.0
pallas-codec@0.25.0
pallas-configs@0.25.0
pallas-crypto@0.25.0
pallas-hardano@0.25.0
pallas-network@0.25.0
pallas-primitives@0.25.0
pallas-rolldb@0.25.0
pallas-traverse@0.25.0
pallas-txbuilder@0.25.0
pallas-utxorpc@0.25.0
pallas-wallet@0.25.0

Generated by cargo-workspaces
2024-04-02 09:50:58 -03:00
Santiago Carmuega
00ece5d300
Release 0.24.0
pallas@0.24.0
pallas-addresses@0.24.0
pallas-applying@0.24.0
pallas-codec@0.24.0
pallas-configs@0.24.0
pallas-crypto@0.24.0
pallas-hardano@0.24.0
pallas-network@0.24.0
pallas-primitives@0.24.0
pallas-rolldb@0.24.0
pallas-traverse@0.24.0
pallas-txbuilder@0.24.0
pallas-utxorpc@0.24.0
pallas-wallet@0.24.0

Generated by cargo-workspaces
2024-03-09 08:09:42 -03:00
Santiago Carmuega
5a44f38e7a
Release 0.23.0
pallas@0.23.0
pallas-addresses@0.23.0
pallas-applying@0.23.0
pallas-codec@0.23.0
pallas-configs@0.23.0
pallas-crypto@0.23.0
pallas-hardano@0.23.0
pallas-network@0.23.0
pallas-primitives@0.23.0
pallas-rolldb@0.23.0
pallas-traverse@0.23.0
pallas-txbuilder@0.23.0
pallas-utxorpc@0.23.0
pallas-wallet@0.23.0

Generated by cargo-workspaces
2024-02-11 18:02:33 -03:00
Santiago Carmuega
8916e43b95
Release 0.22.0
pallas@0.22.0
pallas-addresses@0.22.0
pallas-applying@0.22.0
pallas-codec@0.22.0
pallas-configs@0.22.0
pallas-crypto@0.22.0
pallas-hardano@0.22.0
pallas-network@0.22.0
pallas-primitives@0.22.0
pallas-rolldb@0.22.0
pallas-traverse@0.22.0
pallas-txbuilder@0.22.0
pallas-utxorpc@0.22.0
pallas-wallet@0.22.0

Generated by cargo-workspaces
2024-01-25 09:03:26 -03:00
Santiago Carmuega
ca27aa91ac
fix: add missing Cargo metadata required for publish 2024-01-04 12:22:47 -03:00
Santiago Carmuega
a42a8d64c8
fix: add missing READMEs for crate publish 2024-01-04 11:58:28 -03:00
Santiago Carmuega
cf98e1e5da
release: v0.21.0 (#375) 2024-01-04 10:07:12 -03:00
Alex Pozhylenkov
972102aed8
feat(hardano): implement search for the immutabledb reader (#372) 2024-01-04 08:46:19 -03:00
Harper
b78cedaf43
fix: correct datum kind for set_datum_hash (#350) 2024-01-02 07:18:12 -03:00
Harper
afa397f4ea
fix: return witness objects for conway era multieratx (#346) 2024-01-02 07:17:40 -03:00
Harper
550eac147b
feat(wallet): implement HD private keys & encrypted wrapper (#358) 2023-12-23 13:24:32 -03:00
Santiago Carmuega
fcbaf4ed97
fix: fix unable to build and sign txs (#345) 2023-12-04 09:22:56 -03:00
Santiago Carmuega
b13d3b6688
chore(txbuilder): fix lint warnings (#343) 2023-12-03 10:29:27 -03:00
Harper
f3d9719b5d
feat: introduce transaction builder crate (#338) 2023-12-03 09:51:06 -03:00