PMListKnownParties_ being assigned as the party name?

I upgraded my project from 1.8.0 to 1.9.0 and now am finding that some but not all of my parties in my daml.yaml are getting deployed as weird names. This happened with daml-on-fabric but I’m not sure if it’s related:

$ daml deploy --host localhost --port 6865
Deploying to localhost:6865
Checking party allocation at localhost:6865
Allocated 'PMListKnownParties_S8ug5PUuKa' for 'Alice' at localhost:6865
Allocated 'PMListKnownParties_6ZpsRCpTFQ' for 'Bob' at localhost:6865
Allocating party for 'Carol' at localhost:6865
Allocated 'Carol' for 'Carol' at localhost:6865
Allocating party for 'Dave' at localhost:6865
Allocated 'Dave' for 'Dave' at localhost:6865
Compiling o_beer to a DAR.

When I try to use the party Alice I get the error:

"io.grpc.StatusRuntimeException: INVALID_ARGUMENT: …own on ledger: Submitting party 'Alice' not known"

However PMListKnownParties_S8ug5PUuKa works just fine. Is there a way to avoid this happening during party allocation? Do I need to use the /v1/parties endpoint to resolve parties going forward?

Edit: I deleted my previous ledger and cannot reproduce the error now by changing Daml version nor running daml deploy multiple times.

On some further investigation I think this may be a bug related to the test suite not cleaning up some parties. I was running it prior to deploying my application.

The Ledger API does not provide a way to deallocate parties at the moment so the ledger API test tool has no way to clean up after itself in that regard. Canton has some ledger-specific functionality for that.

That said, you generally cannot rely on the ledger allocating the party provided as a hint. That works on DAML on SQL and some other ledgers but in general, the ledger is free to ignore this and e.g., Canton includes a cryptographic key in the party that is allocated. You have to keep track of which parties you actually allocated and how they map to their “real names”. You can use the party management service and the display names as the real names but note that the ledger is perfectly happy accepting two parties with the same display name so you have to enforce uniqueness externally.

1 Like