Rework delegate events
This MR aims to fix the "leaking" of secret keys into events, when using unencrypted secret keys. Indeed, an encoding can output the sk Uri.t when emitting some events. This is not a critical issue as only the unencrypted schemes will leak the sk. The encrypted schemes will only leak the "Uri path". In addition to that, it is not put into logs events that are stored in daily logs, it only appears when setting an event sink
The fix implemented in this MR is not ideal as it introduces a non bijective encoding, but seems to be the simplest solution to minimize code changes. Let's discuss on the MR.
Here is an output example
[09:50:34.714] [agnostic-baker1] pre-emptive-forge-time optimization set to 0.300000s. Operation inclusion window is ~1.700000s. Caution: Setting this too high may result in reduced block proposal rewards.
[09:50:34.714] [agnostic-baker1] Baker 21.0~rc3+dev (524d2518) for ProtoALphaAL started.
[09:50:34.714] [agnostic-baker1] Nov 06 10:50:34.715: Baker will run with the following delegates:
[09:50:34.714] [agnostic-baker1] Nov 06 10:50:34.715:
[09:50:34.714] [agnostic-baker1] Nov 06 10:50:34.715: activator (tz1TGu6TN5GSez2ndXXeDX6LgUDvLzPLqgYV)
[09:50:34.714] [agnostic-baker1] Nov 06 10:50:34.715: bootstrap1 (tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx)
[09:50:34.714] [agnostic-baker1] Nov 06 10:50:34.715: bootstrap2 (tz1gjaF81ZRRvdzjobyfVNsAeSC6PScjfQwN)
[09:50:34.714] [agnostic-baker1] Nov 06 10:50:34.715: bootstrap3 (tz1faswCTDciRzE4oJ9jn2Vm2dvjeyA9fUzU)
[09:50:34.714] [agnostic-baker1] Nov 06 10:50:34.715: bootstrap4 (tz1b7tUupMgCNw2cCLpKTkSD1NZzB5TkP2sv)
[09:50:34.714] [agnostic-baker1] Nov 06 10:50:34.715: bootstrap5 (tz1ddb9NMYHZi5UzPdzTZMYQQZoMub195zgv)
[09:50:34.714] [{"fd-sink-item.v0":{"hostname":"squirrel","time_stamp":1730886634.714811,"section":["alpha","baker","delegates"],"event":{"delegates_used.v0":[{"alias":"activator","public_key":"edpkuSLWfVU1Vq7Jg9FucPyKmma6otcMHac9zG4oU1KMHSTBpJuGQ2","public_key_hash":"tz1TGu6TN5GSez2ndXXeDX6LgUDvLzPLqgYV","secret_key_uri":"unencrypted:edsk31vznjHSSpGExDMHYASz45VZqXN4DPxvsa4hAyY8dHM28cZzp6"},{"alias":"bootstrap1","public_key":"edpkuBknW28nW72KG6RoHtYW7p12T6GKc7nAbwYX5m8Wd9sDVC9yav","public_key_hash":"tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx","secret_key_uri":"unencrypted:edsk3gUfUPyBSfrS9CCgmCiQsTCHGkviBDusMxDJstFtojtc1zcpsh"},{"alias":"bootstrap2","public_key":"edpktzNbDAUjUk697W7gYg2CRuBQjyPxbEg8dLccYYwKSKvkPvjtV9","public_key_hash":"tz1gjaF81ZRRvdzjobyfVNsAeSC6PScjfQwN","secret_key_uri":"unencrypted:edsk39qAm1fiMjgmPkw1EgQYkMzkJezLNewd7PLNHTkr6w9XA2zdfo"},{"alias":"bootstrap3","public_key":"edpkuTXkJDGcFd5nh6VvMz8phXxU3Bi7h6hqgywNFi1vZTfQNnS1RV","public_key_hash":"tz1faswCTDciRzE4oJ9jn2Vm2dvjeyA9fUzU","secret_key_uri":"unencrypted:edsk4ArLQgBTLWG5FJmnGnT689VKoqhXwmDPBuGx3z4cvwU9MmrPZZ"},{"alias":"bootstrap4","public_key":"edpkuFrRoDSEbJYgxRtLx2ps82UdaYc1WwfS9sE11yhauZt5DgCHbU","public_key_hash":"tz1b7tUupMgCNw2cCLpKTkSD1NZzB5TkP2sv","secret_key_uri":"unencrypted:edsk2uqQB9AY4FvioK2YMdfmyMrer5R8mGFyuaLLFfSRo8EoyNdht3"},{"alias":"bootstrap5","public_key":"edpkv8EUUH68jmo3f7Um5PezmfGrRF24gnfLpH3sVNwJnV5bVCxL2n","public_key_hash":"tz1ddb9NMYHZi5UzPdzTZMYQQZoMub195zgv","secret_key_uri":"unencrypted:edsk4QLrcijEffxV31gGdN2HU7UpyJjA8drFoNcmnB28n89YjPNRFm"}]}}}]
What
Why
How
Manually testing the MR
Set a sink on a sandboxed node (http://tezos.gitlab.io/user/logging.html#sink-configuration) and run a baker. Look for the delegates_used.v0 event.
One can set a sink for the baker with TEZOS_EVENTS_CONFIG="file-descriptor-path:///tmp/sink?section-prefix=*:debug&fresh=true" octez-baker-alpha run with local node /tmp/lapin --without-dal
Checklist
-
Document the interface of any function added or modified (see the coding guidelines) -
Document any change to the user interface, including configuration parameters (see node configuration) -
Provide automatic testing (see the testing guide). -
For new features and bug fixes, add an item in the appropriate changelog ( docs/protocols/alpha.rstfor the protocol and the environment,CHANGES.rstat the root of the repository for everything else). -
Select suitable reviewers using the Reviewersfield below. -
Select as Assigneethe next person who should take action on that MR