Commit Graph

1608 Commits

Author SHA1 Message Date
Remy
2152b72755
[Speedy] Make Machine parametric wrt questions (#15576) 2023-01-03 15:12:33 +01:00
tudor-da
3b87836fa7
Pass agreementText in ProcessedDisclosedContract (#15935)
changelog_begin
changelog_end
2022-12-20 15:42:04 +00:00
Stephen Compall
1f31d2dce2
use LF 1.15 instead of dev for interface-related bazel tests (#15923) 2022-12-19 13:40:45 -05:00
Remy
f1aca5e11c
[Speedy] create Scenario Machine (#15588) 2022-12-16 08:20:42 +00:00
Chun Lok Ling
5f01588417
Conversion between javaapi.data.Value and lf.value.Value (#15885)
* init

* make it able to sync first

* deps

* adt cases

* reorder

* toLfValue

* revert

* toLfValue

* fromLfValue

* bazel

* scala check generator round trip test

* fix test

* Apply suggestions from code review

Co-authored-by: Stephen Compall <stephen.compall@daml.com>

* address comments

* address comments

* address comments

* address comments

* address comments

* address comments

* address comments

* address comments

* fix CI

* fix CI

* na

Co-authored-by: Stephen Compall <stephen.compall@daml.com>
2022-12-15 19:27:55 +00:00
Remy
4135041a38
[Engine] compute agreement as part of contract caching (#15901) 2022-12-15 11:29:06 +00:00
nickchapman-da
2df734e1ce
[engine] consortium primitives in LF (#15864) 2022-12-14 15:06:15 +00:00
Remy
311f419842
LF: get rid of agreement text in ContractInst (#15818) 2022-12-14 10:39:29 +00:00
Stefano Baghino
5ab3fd7cbe
Fix typos in methods (#15884) 2022-12-13 18:36:54 +00:00
Stefano Baghino
18ed316827
Accept uppercase English alphabet letters in user IDs (#15832)
* Accept uppercase English alphabet letters in user IDs

changelog_begin
Accept uppercase English alphabet letters in user IDs
changelog_end

* Fix title case in docs change

Co-authored-by: Sergey Kisel <98825453+skisel-da@users.noreply.github.com>

Co-authored-by: Sergey Kisel <98825453+skisel-da@users.noreply.github.com>
2022-12-08 16:44:54 +00:00
Stephen Compall
d14a6441e3
close the gap between scalac -Xlint and our global options (#15799)
* add -Xlint options requiring no changes

* add -Xlint:recurse-with-default

- very minor code changes

* factor http-json hj_scalacopts duplication

* use lf_scalacopts_stricter in libs-scala where NonUnitStatements was

* use hj_scalacopts in api-type-signature

* add nonlocal-return and nullary-unit to hj_scalacopts

* commented-out excluded options

* add unit-special globally

* check implicit-recursion for clients code
2022-12-07 16:08:33 +00:00
Moisés Ackerman
f35ebb8dcd
Move stdlib datatypes into stable packages (#15795)
* Move datatype DA.Action.State.State into a stable package

* Move datatype DA.Stack.SrcLoc into a stable package

* Move datatype DA.Random.Minstd into a stable package

* Skip doctest for DA.Action.State.Type

* Don't use magic numbers in CodeGenRunnerTests.scala

* Update comment in StablePackageTest.scala
2022-12-06 15:48:35 +01:00
Moisés Ackerman
3a6ddf8f9e
Set default LF version to 1.14 in LanguageVersion.scala (#15803) 2022-12-06 14:24:49 +00:00
tudor-da
b4b1f6c7d9
Engine outputs interpreted disclosed contract metadata [DPP-1323] (#15751)
* Engine outputs interpreted disclosed contract metadata

* Addressed Remy's review comments
2022-12-04 20:11:53 +01:00
Matthias Schmalz
44dc483387
Revised test cases for authorization and added security annotations. (#15759)
CHANGELOG_BEGIN
CHANGELOG_END
2022-12-01 15:14:54 +00:00
Matthias Schmalz
eb59830a7b
Added a flag checkAuthorization to EngineConfig that allows clients to disable the authorization checks (for security testing). (#15748)
Generalized `object CheckAuthorization` to `trait AuthorizationChecker` which now gets injected into `PartialTransaction`.
2022-12-01 12:05:10 +00:00
dylant-da
05d9ee89f3
Improve interpretation error consistency (#15680)
* Add custom viewtype mismatch error

* Modify error message on EViewTypeMismatch to be like GHC error

* Make EUnknownMethodInInterfaceInstance error consistent w/ GHC

* Add MethodTypeMismatch error, sync with GHC error

* Prefix fields in new errors

* Intercept type mismatch in method to throw EMethodTypeMismatch

* Synchronize EUnknownField with GHC-side message

* Complete synchronizing EUnknownField with GHC-side error message

* satisfy lint and changelog check

CHANGELOG_BEGIN
CHANGELOG_END

* lint

* Fix TypingSpec for new EMethodTypeMismatch

* lint

* lint again

* EFieldTypeMismatch error for ERecUpd/ERecProj mismatch, like in GHC

* lint
2022-11-29 13:02:46 +00:00
Remy
462044bd93
[LF] add language version to scala StablePackage list (#15640)
fixes #11371
2022-11-28 10:42:21 +01:00
mziolekda
fd8439144a
fix eta-expansion and nullary method warnings [DPP-1281] (#15689)
* Fix flake jwt leeway test

* fix eta-expansion warnings

* fix nullary method errors

* Revert "Fix flake jwt leeway test"

This reverts commit 5e2fed648b.

* format
2022-11-24 12:28:41 +00:00
Remy
bef0f15d70
[LF] make qualified choice name a LF concept (#15599) 2022-11-17 22:44:18 +00:00
Remy
3dee676cbb
[LF] making LF 1.15 stable (#15614) 2022-11-17 23:30:11 +01:00
Remy
eb6b3cc13e
[LF] reactivate test for //daml-lf/data (#15598)
Those have been deactivated by mistake.
2022-11-16 16:51:46 +00:00
Remy
7cac969756
[Speedy] Inline LedgerMode in the Machine (#15514) 2022-11-15 14:47:22 +00:00
Remy
a18fe164ca
[LF] reenable requires for interface (#15561)
Co-authored-by: Moisés Ackerman <6054733+akrmn@users.noreply.github.com>
2022-11-15 08:59:24 +00:00
dylant-da
c6d10b6246
Remove GHC.Tuple.Check module (#15549)
* Prevent unused import warnings

* Remove all explicit occurences of GHC.Tuple.Check

* Update desugar tests

* Remove magic from GHC.Tuple.Check

* Add GHC.Tuple.Check back to DarReaderTest

* Point to merged changes
2022-11-14 18:29:35 +00:00
Remy
3d95bf84f8
[speedy] refactor continuations (#15513) 2022-11-14 17:23:18 +00:00
Moisés Ackerman
7a3b715568
Add DA.Internal.Interface.AnyView.Types to scala StablePackage#stablePackages (#15559) 2022-11-14 18:13:57 +01:00
dylant-da
bb67fb7f51
Move userWrittenTuple check into own helper in GHC.Tuple.Check (#15445)
* Create tuple size check function in GHC.Tuple.Check

* Update desugar test

* lint

* Fix accidental minus in stable-packages

* Replace GHC.Types with GHC.Tuple.Check in doctest generation

* Fix DarReaderTest

* Fix DamlDocTest for GHC.Tuple.Check import

* Remove unnecessary DamlSyntax pragma

Co-authored-by: Moisés Ackerman <6054733+akrmn@users.noreply.github.com>

* Point to merged GHC changes

* Point to akrmn's merged in changes

* Point back at merged in changes

* restart CI

Co-authored-by: Moisés Ackerman <6054733+akrmn@users.noreply.github.com>
2022-11-11 15:59:29 +00:00
Remy
72c69fd55c
fix package in archive proto SNAPSHOT (#15550) 2022-11-11 14:15:50 +00:00
Remy
49f4d2979e
[LF] strengthen compilation flags (#15481) 2022-11-09 14:12:04 +01:00
tudor-da
346bb48904
Extract Ledger API error definitions in //ledger/ledger-api-errors [DPP-1269] (#15439)
* Extract Ledger API error definitions in //ledger/error-definitions

changelog_begin
SERVICE_INTERNAL_ERROR error code is created in CommonErrors and replaces the usage of LEDGER_API_INTERNAL_ERROR in ledger-api-client (as a fix).
changelog_end

* Tests in //ledger/error do not depend on //ledger/ledger-api-errors

* Remove unused dependency from //ledger/error

changelog_begin
changelog_end

* Address Martino's comment
2022-11-07 17:24:43 +01:00
Remy
f240917e94
[Speedy] Drop second argument of SResultFinal (#15429) 2022-11-04 14:20:21 +01:00
Remy
ed9d9c7ae6
[Speedy] move submissionTime in OnLedger case class (#15427) 2022-11-02 23:36:33 +00:00
Remy
e23f0a5cde
Speedy Cosmetic cleanup (#15421)
* change trait to abstract class
* add missing override
* cleanup scope restrictions
* add missing final
* add missing extends Product with Serializable
2022-11-02 16:11:36 +00:00
Remy
5a3a013b21
Speedy: cleanup SBUKeyBuiltin (#15420)
CHANGELOG_BEGIN
CHANGELOG_END
2022-11-02 13:35:59 +00:00
Remy
bd7e12809e
[LF] fix versioning of value w.r.t. interface (#15370)
CHANGELOG_BEGIN
CHANGELOG_END
2022-10-28 12:31:58 +02:00
Remy
0bba409d0e
[LF] Make ApiCommand.Exercise work directly with type constructor (#15360)
CHANGELOG_BEGIN
CHANGELOG_END
2022-10-26 18:13:38 +00:00
Carl Pulley
c407c4b635
Versioned triggering and correct parsing of TransactionMsg
CHANGELOG_BEGIN
CHANGELOG_END
2022-10-26 15:08:37 +01:00
dylant-da
da8064de64
Add AnyView with HasFromAnyView instances (#15280)
* Implement AnyView as a stable package / primitive

* Point to updated GHC

* Export AnyView datatype, move typeclasses, fix convertPrim

* Adjust AnyView w/ InterfaceTypeRep, implement {to,from}AnyView

* fix lint, satisfy changelog

CHANGELOG_BEGIN
CHANGELOG_END

* fix daml-desugar

* Has{From,To}AnyView instances in daml-docs

* Add DA.Internal.Interface.AnyView to LibraryModules for stdlib

* Fix hash for DA.Internal.Interface.AnyView

* Prefix AnyView with CurrentSdk, add to golden for daml-script test

* Remove HasToAnyView

* Split AnyView into AnyView and AnyView.Types

* fix hash

* Remove unused StandaloneDeriving

* Add HasField instances (requires relevant workers)

* Accept desugaring test changes for removal of HasToAnyView

* Update daml-doc for removal/modification of HasToAnyView/HasFromAnyView

* Update StablePackage hash for DA.Internal.Interface.AnyView.Types
2022-10-25 11:49:32 +00:00
Remy
4fa22e85c1
[Triggers] Version Trigger Daml code (#15298)
We track in `DA.Trigger.Internal` the version of the API between the Daml code and the scala code of the Triggers.

CHANGELOG_BEGIN
CHANGELOG_END
2022-10-21 11:36:59 +02:00
Remy
4318a2341b
[LF] Cleanup StablePackage object (#15250)
CHANGELOG_BEGIN
CHANGELOG_END
2022-10-19 08:06:49 +00:00
Moisés Ackerman
7e6908612b
Fix instance Show Text to produce escaped Text (#15235)
* Fix `instance Show Text` to produce escaped Text (#15177)

This adapts the code used in GHC's 'instance Show Char where { showList }', representing characters as single-character
'Text's using a type synonym. CPP can be used during development to switch to a newtype-based implementation in order
to check type safety.

changelog_begin
- [Daml Standard Library] ``show @Text`` now escapes special characters, producing syntactically correct expressions (#15177)
changelog_end

* Add daml-test-file testing `show @Text`

* Avoid 'explode' in 'showLitChr'

* Cleanup 'showLitChr'

* Update DarReaderTest.scala

* Clean up import of GHC.Base

* Add Note for __DEBUG__SHOW_TEXT_CHR_NEWTYPE macro

* Extract longStringSize from longStringOf in daml-test-file ShowText.daml

* Document differences with GHC implementation

* Remove redundancy between showLitChr and {ascii=>ctrlChrText}

* Add 'exhaustive' test case in daml-test-file ShowText.daml

* Change 'ctrlChrText' default case to throw error
2022-10-17 18:07:56 +02:00
Claudio Bley
e24497635d
Rework evidence security categories (#15226)
* Rework evidence security categories

using the 7 industry standard security testing areas:

* Authentication
* Authorization
* Confidentiality
* Integrity
* Availability
* Non-Repudiation
* Resilience

CHANGELOG_BEGIN
CHANGELOG_END

* Replace category `Input Validation`

* Replace category `Privacy`

* Replace category `Semantics`

* Replace category `Semantics`

* Replace category `Performance`

* Skip categories `NonRepudiation` and `Resilience` for now

There are currently no tests for these categories.

* Regenerate `security-evidence.md`
2022-10-13 09:55:45 +00:00
nickchapman-da
490056ebf9
fix bug in pretty-print for empty kont-stack (#15179)
changelog_begin
changelog_end
2022-10-10 16:35:10 +02:00
nickchapman-da
4d5157b20e
remove dead code (#15181)
changelog_begin
changelog_end
2022-10-06 15:57:27 +00:00
Carl Pulley
6364deb68e
Disable visibility checks for disclosed contracts and disclosed contract keys
* Fixes #14168

CHANGELOG_BEGIN
CHANGELOG_END
2022-09-30 09:38:08 +01:00
Carl Pulley
233bca9d01
Proper error handling on input validation of disclosed contracts
* Fixes #14200

CHANGELOG_BEGIN
CHANGELOG_END
2022-09-29 17:21:02 +01:00
Simon Maxen
817e6aac01
Exclude infrastructure transactions [DPP-1110] (#15121)
* Exclude infrastructure transactions

changelog_begin
changelog_end
2022-09-29 16:22:52 +01:00
dylant-da
485eb2b8dd
Archive choices for interfaces (#15085)
* Point to latest GHC with archive choices on interfaces

* Update Desugared daml for interfaces Archives

* satisfy changelog check

CHANGELOG_BEGIN
CHANGELOG_END

* Update daml-doc test files

* Add relevant identifiers to SignatureReaderSpec for iface Archive choice

* lint

* Point to GHC with generated HasArchive instance

* Add test for archive on interface

* Test that second archive doesn't work

* Update desugar tests

* Point to GHC merge
2022-09-29 10:57:07 +01:00
nickchapman-da
68b323635d
[engine] prefer lastLocation to stackTrace (#15111)
TLDR: Remove broken code which constructs stackTrace().
Happy never to have to read those NOTE(MH) comments in the pushLocation code again!

(1) This code was fundamentally broken for various reasons:
- It doesn't make sense to track location info on the continuation stack. The continuation stack is a record of the evaluation still to come; not a context for the current evaluation.
- Stack traces can't sensibly be provided in a language such as Daml which promises that tail-recursion is evaluated in constant stack-space.
- Attempting to keep location info on the continuation stack does not play well when exceptions are thrown and the stack is unwound.

(2) The stack-trace management code was also very hacky:
- The pushLocation code contained special cases when the continuation stack was headed by a KArg/SToken continuation. This is an internal implementation detail. The KArg doesn't even exist when we stop using the deprecated SEAppGeneral expression constructor.
- The pushLocation code also contained special support for copying stack-traces into SEVal and SDefinition caches, and then later back on to the continuation stack. Yuck!

(3) The stackTrace() code was barely used:
- Some time ago an alternative/simpler location tracking system (lastLocation) was implemented.
- Only ScenarioRunner makes use of the stackTrace()
- Only a single test changes behaviour when we drop use of stackTrace() in favour of getLastLocation
2022-09-28 13:15:08 +01:00