It is possible to use a specific public key on multiple peers on the same interface:
set interfaces wireguard wg100 peer main pubkey 'QApDr57t1SSvzg6Gn5KGwSlVXqxp7wHmgKlBc6ww0mg=' set interfaces wireguard wg100 peer ghost pubkey 'QApDr57t1SSvzg6Gn5KGwSlVXqxp7wHmgKlBc6ww0mg='
If you do so, this will disrupt the interface status and statistics reporting as well as potentially prevent one or more of the connected peers from communicating with the server (based on what is covered in "allowed ips" definition of peers), so lets report the statistics:
show interfaces wireguard wg100
the main and ghost peers may show similar statistics including for example "transfer" and "status" while it is inaccurate (outputs are prepared for illustration only, not actual output):
peer: main public key: QApDr57t1SSvzg6Gn5KGwSlVXqxp7wHmgKlBc6ww0mg= latest handshake: 0:33:12 status: active endpoint: 220.127.116.11:54321 allowed ips: 192.168.1.5/32 transfer: 1 MB received, 14 MB sent peer: ghost public key: QApDr57t1SSvzg6Gn5KGwSlVXqxp7wHmgKlBc6ww0mg= latest handshake: 9:26:24 status: active endpoint: 18.104.22.168:12345 allowed ips: 192.168.1.6/32 transfer: 1 MB received, 14 MB sent
So it appears that some functions (including processing of access lists and reporting statistics) are based on looking up the pubkeys as the primary key. So it is desired that the commit would prevent or warn existence of duplicate pubkeys on the peers of each wireguard interface.