We drop this check for the following reasons:
* Its only usage was inside the transaction builder, this is subsumed
by the check we added in the SValue to Value translation (#10370)
* It seems to origianl check more that nesting (and so to be
overcomplicate)
* It was used in non-consitent way. It was used to check create
arguments and choice arguments, but niether choice result nor
contract key.
CHANGELOG_BEGIN
CHANGELOG_END
The conversion of SValue to Value already ensures the resulting value
has a serializable type. Here we add a check to ensure it does not
overpass the maximum allow nesting.
* Remove Optional[Location] field from transaction nodes.
xoptLocation
working but very messy!
cleanup PartialTransaction code
pass locationInfo in CompleteTransaction
dont pass locationInfo in SumittedTransaction
pass optLocation to CheckAuthorization
temp reinstate xoptLocation in ExerciseContextInfo
cleanup Conversions.scala
remove Optional[Location] field from transaction nodes.
CHANGELOG_BEGIN
CHANGELOG_END
* fix bad merge
* fix build after merge
* rename
* doc comment, and question
We probably want to start displaying the full ptx on the client side
but for now this at least moves things out of speedy and into the
rendering layer where they belong.
It also fixes IncompleteTransaction to unwind properly so the roots
are really the roots.
changelog_begin
changelog_end
* Use PartialFunction for more concise code.
CHANGELOG_BEGIN
CHANGELOG_END
* tweak to use guards
* blind fix for 2.12
* try fix 2.12 build
* loose if-guard parens
* fixes for 2.12 build (should actually work this time!)
* Testing for Validation.isReplayedBy
changelog_begin
changelog_end
try fix scala 2_12 build
fetch node: samples and tweaks
list sig/insig field tweaks side-by-side so coverage is easier to eyeball
exerciseResult tweak sig & insig
add sig/insig tweak for byKey of Fetch node
add sig/insig tweak for key of Fetch node
must use ImmArray.empty instead of ImmArray() for scala 2.12
another blind attempt to fix scala 2.12
use for/yield instead of flatMap for list-comprehensions
test sig/insig tweaks to LookupByKey nodes
wont attempt to tweak rollbacks
(and shorten trailing dash in comment banners)
comment about how Tweak testing is organized
dont dep/import scalacheck (not used!)
no wild imports
* val --> private def
* def --> val
* prefer fail to println/assert(false)
* daml-lf/data: Truncate party names in log output, on request.
The party name can grow quite long, so we offer ledger implementors the
opportunity to truncate it in structured log output.
Unfortunately, because we use Logback through the global
`LoggerFactory`, there is no place to inject logging configuration. This
means we also need to use global, mutable state to configure logging
output. I have added a `LoggingConfiguration` class+object in Daml-LF
Data, which may not be the best place, but I can't think of a better
one right now. I suggest we leave it there until it has reason to grow,
at which point we may want to move it.
CHANGELOG_BEGIN
CHANGELOG_END
* logging-entries: Make `ToLoggingValue` mixin-able.
* participant-integration-api: Truncate parties in filters when logging.
* participant-integration-api: Cast to `Party` for logging.
Invalid input should not break the request at this point. No assertions.
* daml-lf/data: Move `Party to LoggingValue` to a new package.
This avoids the transitive dependency issue most of the time.
* daml-lf-data: Move the `Identifier` logging to another package.
Again, reduces the need for transitively depending on _logging-entries_.
This modifies a test about version encoding that should not be run
with Rollback nodes as those do no have explicit version.
CHANGELOG_BEGIN
CHANGELOG_END
This PR fixes the todo in danglingRefGenNode to include rollback
nodes.
Some tests simply don’t work on rollback nodes so I added
danglingRefGenActionNode. For other tests, we just need to switch how
we generate nodes and versions to be a bit more sensible.
changelog_begin
changelog_end
* Normalize rollbacks: first draft
CHANGELOG_BEGIN
CHANGELOG_END
NormalizeRollbackSpec, WIP
WIP2
adapt to asVersionedTransaction
first stab at traversal for normalize-rollbacks... implement normalization rule #1
adapt existing testcase for rollback normalization rule #1
pluralize spec filename
temp disable rollback normalization
methodically test normalization rule #1
lots more tests
spec: check all 3 norm conditions
cleanup test/Shape code a bit
implement normalization rules #2 and #3 (using canonical types) and enable tests
add some comments and some 8020 todo markers
* add 2 more testcases from Sofia
* ensure tx produced when normalizing rollbacks has increasing node-ids when listed in pre-order
* enable rollback normalization in interpreter
* manage state functionaly for the created tx (counter & node-map)
* un-nest sub defs from normalizeTx (we can because we removed the mutable state)
* rename: force* --> push*
* introduce CPS for push functions
* introduce trampolines for push functions to be stack safe
* one more bounce
* ensure generated node-ids start from 0
* test that transaction node-ids start from 0
* add commets about pass1/2; move makeRoll (part of pass 1) earlier in file
* intro CPS for pass-1 over original tx
* intro trampolines for pass-1. everything is stack safe now
* clarify comment
* remove make stack-safe todo
* be more private
* factorize/share Trampoline implementation with previous implementation in speedy.Anf
* prefer Vector over List, for better algorithmic complexity
* make Trampoline private to lf
For better or for worse, kvutils validation insists on treating a
negative input from a create different to a negative key lookup (and
to make things more annoying the first one will never blow up during
submission only during validation).
While, nobody seems to argue all that strongly that the current errors
are very sensible, we agreed to do it in two steps:
1. Expose enough information in `contractKeyInputs` so that we can use
it in kvutils while preserving the current error semantics.
2. Revisit contract key error handling across ledgers which is
currently an inconsistent mess.
changelog_begin
changelog_end
.
changelog_begin
changelog_end
* Throw on internal errors instead of setting ptx to aborted
The main purpose of aborted is to be able to get out a ptx in the
scenario service. However, for internal errors that makes no
sense. Users should never encounter them. And the use of `aborted`
here has swallowed these errors silently in a few places before which
is clearly bad.
changelog_begin
changelog_end
* Fix tryHandleSubmitMustFail
changelog_begin
changelog_end
* Remove version field from rollback node.
changelog_begin
changelog_end
fix transaction decode & testcases
reinstate/adapt testcases
fmt
rebase change to fix conflicts
* treat missing version on transaction node as being version minExceptions when computing tx version
* add 8020 marker for grepability
* reinstate Node.version to avoid logic duplication
* Revert "reinstate Node.version to avoid logic duplication"
This reverts commit 00dacb453d.
* remove Node.updateVersion
* remove comments with dubious utility
* check whether collection.compat is unused when compiling for Scala 2.12
- Instead of always suppressing warnings for collection.compat._,
we should only do it for Scala 2.13
- We can also reduce boilerplate by automatically adding this
option when both silencer_plugin and collection-compat are
present
CHANGELOG_BEGIN
CHANGELOG_END
* remove unused import
* remove another unused import
* remove even more unused imports
* missed compat dependency
* more missed compat dependencies
* missed compat dependency
* use scala_deps in scaladoc_jar
- #8423 inlined the major version expansion, but this seems to
have been prior to proper support by scaladoc_jar
* restore custom handling of participant-integration-api
- fixing scaladoc_jar isn't worth it for a single case, as with
deps vs scala_deps
* Check byKey in transaction validation
No tests because validation has no tests in general :(
part of #7622
changelog_begin
changelog_end
* Fix preprocessing of transaction root nodes
changelog_begin
changelog_end
This PR includes :
- Adding ApiCommand to distinguish between generic command (that are
accepted by the engine) and command that are accepted by the ledger
API.
- Reimplement Canton's reinterpret method using commands instead of
node.
CHANGELOG_BEGIN
CHANGELOG_END
* Filter divulgence to an empty set of parties
As @nmarton-da noticed painfully, we currently include divulgence to
an empty set of parties. While this is arguably not wrong it is at
least confusing and useless. The whole point of divulgence is to track
visibility. Divulging to an empty set of parties does not affect
visibility so it is not meaningfully different from no
divulgence. Therefore this PR filters it out and adds a doc comment
that the list of divulgees is always non-empty.
changelog_begin
changelog_end
* Fix tests
changelog_begin
changelog_end
This PR clarifies that NodeInfo is only intended for actions by
renaming it to ActionNodeInfo and correspondingly also changes
protoNodeInfo to protoActionNodeInfo and makes it return a `Left` for
rollback nodes.
changelog_begin
changelog_end
* Address more exception todos
A bit of a kitchen sink PR to address a bunch of the trivial todos
that didn’t seem worth splitting out into separate PRs.
changelog_begin
changelog_end
* Revert changes to TransactionSpec
changelog_begin
changelog_end
As discussed, we don’t want to expose this via serializable values at
least for now (and it’s not exposed on the ledger API anyway) so this
PR drops the type.
changelog_begin
changelog_end
* Allow missing exercise results when version >= minExceptions
imp:
- adapt encode & decode implementations
- add version dependant checks for version < `minExceptions`
testing:
- update scalacheck `ValueGenerators` to produce exercise nodes with the missing result value guarded by the versions
- update `normalizeExe` in `TransactionCoderSpec`
- update `transactionVersionGen` to be inclusive on upper bound
- unhappy-path test for encode/missing-exercise-result when not allowed
- unhappy-path test for decode/missing-exercise-result when not allowed
changelog_begin
changelog_end
* Switch from `@silent` to `@nowarn`.
This annotation is native to Scala 2.12.13+ and 2.13.2+. It replaces
most usages of `@silent`.
I had to get creative about a couple of use cases that didn't work.
Specifically:
1. Suppressing deprecation warnings works, but Scala 2.12 erroneously
complains that the `@nowarn` is unnecessary. I had to suppress
this warning too with `-Ywarn-unused:-nowarn`.
2. I can't seem to suppress the warning, "The outer reference in this
type test cannot be checked at run time." Instead, I have
refactored the code to remove the warning.
We still need to use the silencer plugin to suppress some warnings about
unused imports (because of compatibility between Scala 2.12 and 2.13),
but this means we no longer need the library, and therefore it is not a
transitive dependency that downstream consumers need to worry about.
CHANGELOG_BEGIN
CHANGELOG_END
* Add some comments around `@nowarn` support.
* language-support/scala: Fix a warning suppression.
* Revert to the default warnings.
Compatibility was complaining.
* Add a helper for getting all inactive contracts to Transaction
This comes up in a few places and rather than inlining the
implementation everywhere, I’d rather rely on this.
changelog_begin
changelog_end
* 2.13
changelog_begin
changelog_end
* Fix validation of rollback nodes
To my own embarassment there is no test in this PR. We don’t have any
direct tests for validation atm. We absolutely need some and I already
discussed with Remy that this is something we should focus on once
exceptions are done but for now I’ll stick to being sad.
changelog_begin
changelog_end
* Fix bug
changelog_begin
changelog_end
* Extend Transaction proto format for rollback nodes.
- proto format
- encode/decode
- testcase
- always `allowRollback` from scalagen testing; and so remove control flag
- two more `8020` TODOs, for other code which matches `node.getNodeTypeCase` and sees `ROLLBACK`
changelog_begin
changelog_end
* add comments about version of rollback nodes in transaction.proto
* check rollback node version during encode & encode
* factor out code to decode children for exercise & rollback node
* test decode check for unexpected rollback node in old version
* KV: do not use "Effects" part of InputsAndEffects
The PR is based #9429.
changelog_begin
changelog_end
* Factor out helpers
changelog_begin
changelog_end
* Apply suggestions from code review
Co-authored-by: Miklos <57664299+miklos-da@users.noreply.github.com>
* review comments
changelog_begin
changelog_end
* fmt
changelog_begin
changelog_end
Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
Co-authored-by: Miklos <57664299+miklos-da@users.noreply.github.com>