* row_id changes
* fixing inserts
* replacing offset with row_id in the flat transaction stream queries
* fixing flat transaction query, updating H2 migration script
* fixing formatting
* ACS query pagination relies on row_id instead of ledger offset
* give a name to the index that we have to drop
* give a name to the index
* Fixing events range query it can return SQL nulls on empty DB.
* remove the debug println
* remove outdated comment
* removing unused orderByColumns constant
* getting rid of new `Source.flatMapConcat` calls that were added as part of this PR.
CHANGELOG_BEGIN
1. ACS, Flat Transaction and Transaction Tree stream pagination based on event_sequential_id instead of event_offset.
2. Events ordering based on the order of insertion: order by event_sequential_id instead of order by (event_offset, transaction_id, node_index).
CHANGELOG_END
* reverting changes to V13 H2 migration script,
figuring out the name of the index that has to be dropped
* Addressing code review comments:
- replacing scalaz Option.cata with stdlib Option.fold
- moving implicit val def into import
* Addressing code review comments:
- extracting re-usable stream query functions
* forcing postgres to use index when looking up lower and upper bound row ids
* fixing the query when it is run on an empty ledger
* resolving rebase conflicts
* Update ledger/sandbox/src/main/scala/com/digitalasset/platform/store/dao/events/EventsRange.scala
Co-authored-by: Stefano Baghino <43749967+stefanobaghino-da@users.noreply.github.com>
* fetching a single row, fetchSize should NOT matter
* Adding integration test to reproduce invalid order of archived, created events
The test fails, which is expected.
* Fixing the order of archived, created events triggered by exercise
* Addressing code review comments and cleaning up
* Renaming row_id to event_sequential_id
* Investigating flaky tests
* Fixing formatting
* Revert HOTFIX-flaky-client-server changes
`bazel test --runs_per_test=50 //ledger/participant-state/kvutils:reference-ledger-dump` passed on this branch.
Co-authored-by: Stefano Baghino <43749967+stefanobaghino-da@users.noreply.github.com>
* Kill stale sandbox processes on macos and linux
changelog_begin
changelog_end
* Update build.sh
Co-authored-by: Samir Talwar <samir.talwar@digitalasset.com>
* exitcodes are hard
changelog_begin
changelog_end
* Also kill stale sandboxes in compat tests
Co-authored-by: Samir Talwar <samir.talwar@digitalasset.com>
* Return the ledger beginning as the ledger end on an empty ledger
Previously, the services would return `Offset.beforeBegin` to the
clients, and the other services deem this offset to be invalid.
CHANGELOG_BEGIN
CHANGELOG_END
* Apply suggestions from code review
Co-authored-by: Samir Talwar <samir.talwar@digitalasset.com>
* Import DurationInt
* Kill unused import
* Use ApiOffset for the external ledger begin
Co-authored-by: Samir Talwar <samir.talwar@digitalasset.com>
* replace traverseU and sequenceU with traverse and sequence
- with -Ypartial-unification on, the extra Unapply typeclass lookup is
unnecessary
* no changelog
CHANGELOG_BEGIN
CHANGELOG_END
* limit imports; we only need *> and void
While we do have additional tests, they pass in a single-participant
setup even on older SDK so no new exclusions necessary.
Side note: The autoupdate PR for yesterday’s (second) snapshot failed
since Maven was too slow and the ledger-api-test-tool wasn’t there
yet. I would suggest that for now we wait and see if this happens
frequently (it definitely doesn’t happen always). If it does, we could
get the checksum from the current build and avoid the race.
changelog_begin
changelog_end
* Update rules_haskell
- Fixes the issue where a `sh_test` wrapping a `haskell_binary` couldn't
add runfiles as is the case with other Bazel rules.
CHANGELOG_BEGIN
CHANGELOG_END
* Save the runfiles environment at start-up
To work around the fact that `withProgName` overwrites `argv[0]`.
See https://gitlab.haskell.org/ghc/ghc/-/issues/18418.
* damlc_compile_test include damlc runfiles
Co-authored-by: Andreas Herrmann <andreas.herrmann@tweag.io>
Previously, daml2js generated Text without any intermediate
representation. This both made the code pretty messy and it makes it
super hard to implement things like generating JS source + TS typings
instead of generating typescript.
This PR addresses this by first generating intermediate types which
are then rendered into Text in a separate step. This should hopefully
make it almost trivial to generate JS source + typings in the future
my implementing two rendering functions.
The types are somewhat adhoc atm. I expect that they will probably
change a bit anyway once we switch to JS + typings so I would like to
avoid bikeshedding the exact definitions too much.
I didn’t bother to preserve the pretty printing exactly as before. If
we really care about pretty output (why should we?), I would suggest
to switch to a proper pretty printing library (in a separate PR).
I apologize for the large PR. Not quite sure how to make it smaller.
changelog_begin
changelog_end
So that the resulting value is returned from the `execute` function, instead of being assigned to the `returnValue` machine state.
Rename the parent class from `SBuiltinMaybeHungry` to `SBuiltinEffect`, and have this be the parent of a few more subclasses which cannot meat the _pure_ interface.
Declare method `executeEffect` of the parent class `SBuiltinEffect` which has the same type as the original `execute`.
changelog_begin
changelog_end
* Release 1.3.0 snapshot
This includes the fix for the indexer, a fix for the stackoverflow and
unpublishes daml-on-sql from GH releases.
changelog_begin
changelog_end
* Bump commit
changelog_begin
changelog_end
The running trigger store is now written to synchronously by the server, so there's no need for retry logic.
Also assert equality of trigger ids rather than an arbitrary predicate, as it gives better error messages and we don't use other types of predicates for this function.
CHANGELOG_BEGIN
CHANGELOG_END
If you have something like `http://localhost:8080` the port is handled
correctly. However, if you have `http://localhost/abc:8080` the port
will silently be ignored (`http://localhost:8080/abc` would be
correct). That is clearly wrong so this PR fixes it.
changelog_begin
- [DAML Script] Fix an issue where the `port` was ignored for
non-empty paths in the url when running DAML Script over the JSON API.
changelog_end
Buildifier now comes with a handy attachment to catch single `\`
characters inside strings and replace them with `\\` if the escape
sequence is invalid. Skylark/Python will do this at runtime anyway; this
just makes it clearer what the actual behavior is.
I needed to change `\` characters at the end of lines to `\\` manually
in order to stop Buildifier from simply concatenating the lines
together. Everything else was automatic.
CHANGELOG_BEGIN
CHANGELOG_END
* kvutils/integrity-check: Always reset the output color.
Contrary to popular belief, terminal colors are hard. Resetting to
"white" isn't good enough; you don't know which color the user's
terminal should be set to. We need to print `AnsiColor.RESET` to ensure
the terminal is properly reset.
This changes the way we print so we _always_ set the color and then
reset it in one operation, making it impossible to accidentally leave
the terminal using a specific color. It also fixes the above bug as a
side effect.
CHANGELOG_BEGIN
CHANGELOG_END
* kvutils/integrity-check: Print the total outside `go`.
* kvutils/integrity-check: Push the error outwards.
I'd rather avoid calling `sys.exit` inside a loop if I can.
* kvutils/integrity-check: Implicits for colors.
Before:
```scala
Print.green("Hello!")
```
After:
```scala
println("Hello!".green)
```
GHC has weird restriction on version numbers which damlc inserits so
we need to use `ghc_version` instead of `sdk_version`. That only makes
a difference for snapshot versions where the `-snapshot.` part is
replaced by `.`.
changelog_begin
changelog_end
Ask @nickchapman-da for details on what this transform does and why it's
better. I have no clue.
What I do understand is that current master has a stack-consuming
behaviour that just so happens to not reach the 1mb default stack size
on the tests we run, and that this presumably better version of a let
transform had been left out from the original ANF PR because it was
pushing the stack consumption over that 1mb limit.
Besides reintroducing the "better" let version, this PR applies an
almost full CPS transform to the set of mutually recursive functions
that grow the stack. Combined with the trampoline, this should mean the
ANF transform itself is done in (almost) constant stack space.
The one exception to that is the `flattenAlts` function, which has been
left as a plain imperative loop. This does mean that we consume stack
linearly with the nesting level of alts, so conceivably this could still
blow the stack. There is no fundamental reason that makes this hard, it
just seemed unnecessary for the stack consumption and potentially
damaging to performance (changing a native Java loop on an array to a
recursive list consumption).
To verify the stack-consuming behaviour on master, one can apply this
patch:
```patch
diff --git a/ledger/sandbox/BUILD.bazel b/ledger/sandbox/BUILD.bazel
index a717e66fb..4c953b3ea 100644
--- a/ledger/sandbox/BUILD.bazel
+++ b/ledger/sandbox/BUILD.bazel
@@ -124,6 +124,7 @@ da_scala_library(
da_scala_binary(
name = "sandbox-binary",
+ jvm_flags = ["-Xss256k"],
main_class = "com.daml.platform.sandbox.SandboxMain",
resources = ["src/main/resources/logback.xml"],
visibility = ["//visibility:public"],
```
then run
```
bazel test -t- //ledger/sandbox:conformance-test-contract-id-seeding-memory
```
The same process can be repeated on this branch to verify that, at
least, this now runs under 256kb of stack for all our tests. I don't
know of a good way to get a stronger guarantee on stack allocations.
While my primary motivation here is correctness (and termination, I
guess), this does seem to yield a modest performance improvement. On a
test machine, I got the following results as confidence intervals:
* `master` (b4915a4bd7): 54.00, 54.56
* this branch: 52.54, 53.11
I've only ran the benchmark once on each and don't have enough
experience with it to know how reliable those numbers are. I'll try to
run some more.
CHANGELOG_BEGIN
CHANGELOG_END
Note for reviewers: This is a hotfix for a snapshot. I’m not going to
into why we need this here. As for the version number we decided that
the least confusing option here is the following:
Use the sha and number of commits as usual but use the date of the
original snapshot that we are patching here.
changelog_begin
changelog_end
* kvutils/integrity-check: When there's an exception, crash.
The integrity checker would previously hang around for a long time in
the event of an exception. This makes sure all threads are shut down
immediately.
* kvutils/integrity-check: Increase the timeout per submission.
Larger submissions time out on my machine.
CHANGELOG_BEGIN
CHANGELOG_END
* kvutils/integrity-check: Rewrite without `Await`.
* kvutils/integrity-check: Close the file after running.
small clean up in the testing library TransactionBuilder, bsaically add a Submitted and a Committed version for empty transaction constant and build method.
plus a bit of cleaning in tests using TransactionBuilder
CHANGELOG_BEGIN
CHANGELOG_END
* Removed archived_by_entry from CommitContext and DamlContractState.
* Removed references to getEntryId from test code.
* Do not pass log entry ID to committers.
* Log entry ID is no longer required for computing submission outputs.
* Log entry ID is no longer required for computing submission outputs.
* Code tidying.
CHANGELOG_BEGIN
CHANGELOG_END
This PR splits up the significantly too large `DA.Daml.Helper.Run`
module into modules grouped by the individual commands:
- `DA.Daml.Helper.Init` for `daml init`
- `DA.Daml.Helper.Ledger` for `daml ledger *`
- `DA.Daml.Helper.New` for `daml new`
- `DA.Daml.Helper.Start` for `daml start` and code for starting the
components that are part of that individually.
- `DA.Daml.Helper.Studio` for `daml studio`
- `DA.Daml.Helper.Util` as a kitchen-sink utilty moduel for things
that don’t really belong in one of the others.
This PR _only_ shuffles code around, there is no change in the
implementation.
changelog_begin
changelog_end
* Fix record update evaluation order.
This PR only fixes the evaluation order for single-constructor record
types. Fixing it for variant records, if we do, will be a major
challenge.
This PR also adds a regression test.
changelog_begin
changelog_end
* fix daml-lf-verify
As requested by @shaul-da, this PR hides the information added by
@hurryabit in #6571 behind a checkbox, and reverts to plain "X"s by
default (checkbox unchecked).
CHANGELOG_BEGIN
- [DAML Studio] The new S/O/W/D information is hidden behind a top-level
checkbox (next to Show archived). When that checkbox is not checked
(which is the default), we display X's as before.
CHANGELOG_END
'.' is not a valid character in a mangled name which caused unmangling
to fail. Sadly the scenario service does not properly distinguish
between dotted an undotted names but for now everything we unmangle is
dotted anyway so I’ve taken the easy approach of simply changing our
unmangling to take that into account.
We might want to change the scenario service here but I’ll leave that
for a separate PR.
changelog_begin
- [DAML Studio] Fix a crash in scenarios that referenced records
originating from definitions like `data T = T1 { f1 : Int } | T2 { f2
: Int }`.
changelog_end
Since we have only absolute contract ids, there is no more distinction
between local and global disclosure/divulgence. Let's please remove the
`global` prefix since it causes confusion (at least for me it did).
CHANGELOG_BEGIN
CHANGELOG_END
The dead code was hanging on by a slender thread. This change cuts that thread.
For over-apps, we now push a new continuation type KOverApp, instead of KArg.
KOverApp contains args of type SExprAtomic, instead of SExpr, and so its
execute() method may use enterApplication, instead of executeApplication.
This allowing lots of code to be removed:
- the continuation types: KArg, KFun, KBuiltin and KPap.
- defs: evaluateArguments and executeApplication.
changelog_begin
changelog_end
* Update rules_haskell
* Pin stack_snapshot repositories
* Document stack_snapshot_json
CHANGELOG_BEGIN
CHANGELOG_END
* Don't pin stack_snapshot on Windows
The lock file is generated on Unix and includes unix specific
dependencies, e.g. `unix`. Most developers don't have easy access to a
Windows machine, so regenerating the lock file for Windows would be
inconvenient.
* upgrade stack 2.1.3 --> 2.3.1 on Windows
Co-authored-by: Andreas Herrmann <andreas.herrmann@tweag.io>
* update versions bbased on git tags
We currently run the update script as part of the release process. This
causes an issue (highlighted by @cocreature in #6560): the update script
currently relies on querying the docs website to get the list of
versions, but the docs website is updated on a cron, which means by the
time we run the update script it is not up-to-date yet.
This PR changes the update script to instead rely on the local git repo
and its list of tags, as that is updated synchronously.
CHANGELOG_BEGIN
CHANGELOG_END
* test
* revert test
* add lf_scalacopts to ledger-service/ projects
* handle unused warnings in http-json main
* handle unused warnings in lf-value-json
* handle unused warnings in http-json tests
* handle unused warnings in jwt
* JwtGenerator.generate doesn't use its argument; remove it
* no changelog
CHANGELOG_BEGIN
CHANGELOG_END
* format bazel files
Currently, the scenario service ships the disclosure information of a
transaction twice. One of the two copies is completely unused. This PR
simply deletes it. I hope this reduces confusion in the future.
CHANGELOG_BEGIN
CHANGELOG_END
* Remove the copyright header from the skelton
It doesn't make sense to annoy our users with our copyright for on a
template. And the over abundance of empty lines has annoyed me so many
times.
* Add NO_AUTO_COPYRIGHT file
CHANGELOG_BEGIN
CHANGELOG_END
The issue is described in a comment (since I want to preserve it) but
here’s the brief summary:
Calling `follow` twice can result in contention if we do not wait in
between. That is shown in the log of the JSON API. For some reason
that ends up propagating to a misleading Target closed error from
puppeteer.
This PR addresses the problem by waiting for the list of followers to
be updated which definitely implies that the ledger has seen the
command.
changelog_begin
changelog_end
* Split damlc integration tests per DAML-LF version
Currently, we have one test for all stable DAML-LF versions. This test
takes quite a while to run and times out occasionally. This PR splits
the big test into one test per stable DAML-LF version.
CHANGELOG_BEGIN
CHANGELOG_END
* Address some feedback
* Distinguish witnesses and divulgences in scenario table view
Currently, we display a "D" (for "Disclosure/Divulgence") in the table
view of the scenario view when a party can see a contract because they
have learnt about it via disclosure.
This change further refines this visibily indicators for disclosure:
We display a "W" for "Witness" (i.e. the party has witnessed the
creation of the contract) and "D" for "Divulgence".
Help for the reviewer: In the scenario service server, witnessing is
called explicit disclosure whereas divulgence is called implicit
disclosure.
CHANGELOG_BEGIN
* [DAML Studio]
When displaying scenario results in table view in DAML Studio, we now
indicate _why_ a party knows about the existence of a contract:
- `S` means the party is a signatory.
- `O` means the party is an observer.
- `W` means the party has witnessed the creation of the contract.
- `D` means the party has learned about the contract via divulgence.
CHANGELOG_END
* Address @cocreature's feedback