Commit Graph

5 Commits

Author SHA1 Message Date
Stefano Baghino
f1cd4b1c7c
Remove dependencies on compatibility libraries (#12548)
Continues the work started in https://github.com/digital-asset/daml/pull/12543

These libraries were only needed to transition from Scala 2.12 to 2.13
and are no longer useful as all the necessary items are now available
in Scala 2.13.

changelog_begin
changelog_end
2022-01-24 18:04:07 +00:00
Gary Verhaegen
d2e2c21684
update copyright headers (#12240)
New year, new copyright, new expected unknown issues with various files
that won't be covered by the script and/or will be but shouldn't change.

I'll do the details on Jan 1, but would appreciate this being
preapproved so I can actually get it merged by then.

CHANGELOG_BEGIN
CHANGELOG_END
2022-01-03 16:36:51 +00:00
Andreas Herrmann
a1da025b78
FreePort draw from outside ephemeral port range (#10774)
* Test case for LockedFreePort not colliding with port 0

changelog_begin
changelog_end

* Discover dynamic port range on Linux

* Random port generator outside ephemeral range

* remove dev comments

* Draw FreePort from outside the ephemeral port range

Note, there is a race condition between the socket being closed and the
lock-file being created in LockedFreePort. This is not a new issue, it
was already present with the previous port 0 based implementation.

LockedFreePort handles this by attempting to find a free port and taking
a file lock multiple times.

But, it could happen that A `find`s port N, and obtains the lock, but
doesn't bind port N again, yet; then B binds port N during `find`; then
A attempts to bind port N before B could release it again and fails
because B still holds it.

* Select dynamic port range based on OS

* Detect dynamic port range on MacOS and Windows

* Import sysctl from Nix on MacOS

changelog_begin
changelog_end

* Windows line separator

* FreePort helpers visibility

* Use more informative exception types

* Use a more light weight unit test

* Add comments

* Fix Windows

* Update libs-scala/ports/src/main/scala/com/digitalasset/ports/FreePort.scala

Co-authored-by: Stefano Baghino <43749967+stefanobaghino-da@users.noreply.github.com>

* Update libs-scala/ports/src/main/scala/com/digitalasset/ports/FreePort.scala

Co-authored-by: Stefano Baghino <43749967+stefanobaghino-da@users.noreply.github.com>

* Add a comment to clarify the generated port range

* fmt

* unused import

* Split libs-scala/ports

Splits the FreePort and LockedFreePort components into a separate
library as this is only used for testing purposes.

Co-authored-by: Andreas Herrmann <andreas.herrmann@tweag.io>
Co-authored-by: Stefano Baghino <43749967+stefanobaghino-da@users.noreply.github.com>
2021-09-07 15:41:43 +02:00
Stefano Baghino
0e4af7418d
Add runner for non-repudiation (#9076)
* Add runner for non-repudiation

Closes #8633

changelog_begin
changelog_end

* Fix existing tests

* Add test for non-repudiation-app option parser

* Remove unnecessary dependencies from non-repudiation testing

* Fix Scala 2.13 build errors

* Fix help message for --api-address and --api-port
2021-03-11 10:57:50 +01:00
Stefano Baghino
eaf7fb6f63
Add non-repudiation API (#8982)
* Add non-repudiation API

The Web API for the non-repudiation proxy allows to retrieve the signed
payload for a given command, add a new certificate or query for an
existing one.

Closes #8658

changelog_begin
changelog_end

* Fix Scala 2.13 compilation error

* Test error conditions

* Add tests for errors and logging

* Fix Scala 2.13 compilation error

* Address https://github.com/digital-asset/daml/pull/8982#discussion_r585641768

* Address https://github.com/digital-asset/daml/pull/8982#discussion_r585674885

* Address https://github.com/digital-asset/daml/pull/8982#discussion_r585668733
2021-03-04 11:02:25 +00:00