Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EPIC: Derive PigeonOperator Keys for signing from Validator Key and use Fee Grant #857

Closed
taariq opened this issue Oct 10, 2023 · 0 comments
Assignees
Labels

Comments

@taariq
Copy link
Member

taariq commented Oct 10, 2023

Pigeon no longer trips over itself with account sequence mismatch errors, but there is still a use case where these errors occur. When any other user or app uses the same key, the errors have a risk of occurring.

To solve this, we want Pigeon to have its own key(s). There is more information in the epic here: https://www.notion.so/volumefi/EPIC-06-16-23-Upgrade-Pigeon-Performance-for-Successful-Bot-execution-and-reduce-failures-55c35cbbe29f4a5899456e7a566f6a16?pvs=4#416def9723774ba8a9f0b859239a094e

@taariq taariq added the pigeon label Oct 10, 2023
byte-bandit added a commit to palomachain/pigeon that referenced this issue Nov 10, 2023
# Related Github tickets

- VolumeFi/paloma#857
- VolumeFi/paloma#934
- palomachain/paloma#1025

# Background

In order to support multiple signing keys for Pigeons, we recently released a change for Paloma that introduced message metadata fields for all Paloma messages, allowing Pigeons to define signers other than the creator address.

This change includes:

- Removing lens as a dependency, replacing it with a slimmed down in-house solution called `ion`
- Support to define multiple signature keys in the pigeon config, see below for additional details
- Automatic key rotation when sending messages to Paloma
- Automatic metadata injection into messages
- Introducing `validator-key` as a configuration field for the paloma chain inside Pigeon. This used to be the `signing-key` field, which remains to be supported for now

The new signing keys are completely optional. In case there's no change to the configuration, Pigeon will read the old existing `signature-key` field and use it for both the message creator and signer when injecting metadata. See below on how to enable support for multiple signing keys.

Going forward, we'll be referring to the old `signing-key` as `validator-key`.

#### Support for multiple signing keys

By default, Pigeon will use your validator key to sign any transactions sent to Paloma. In high throughput environments, this may lead to `account sequence mismatch` errors.
It's possible to define more than one signing key to be used in rotation to combat this issue. In order to do so, you will need to create a number of new keys and register them with Pigeon like this:

```bash
# First, create a number of new keys. You may create an arbitrary amount of keys.
palomad keys add pigeon-operator-alpha
palomad keys add pigeon-operator-bravo
palomad keys add pigeon-operator-charlie

# Second, your new addresses will need to receive an active feegrant from your validator address.
# This step is very important. It's not enough to simply fund those addresses manually.
# The active feegrant is considered a "permission" to send transactions from your validator address".
palomad tx feegrant grant $VALIDATOR_ADDRESS pigeon-operator-alpha --fees 500ugrain -y
palomad tx feegrant grant $VALIDATOR_ADDRESS pigeon-operator-bravo --fees 500ugrain -y
palomad tx feegrant grant $VALIDATOR_ADDRESS pigeon-operator-charlie --fees 500ugrain -y
```

After creating your signing keys, all you need to do is register them with Pigeon by adding the following to your pigeon config. Make sure to restart the service after making these changes.

```yaml
paloma:
  signing-keys:
    - pigeon-operator-alpha
    - pigeon-operator-bravo
    - pigeon-operator-charlie
```

# Testing completed

- [x] test coverage exists or has been added/updated
- [x] tested in a private testnet

# Breaking changes

- [x] I have checked my code for breaking changes

---

* feat: support multiple signing keys with rotation

* fix: use master address when sending messages

* fix: dead lock on mutex acquisition

* feat: add fee grant

* chore: add logging

* feat: inject message metadata

* fix: retrieve signer address for metadata

* fix: remove superfluous logging

* feat: remove locking from paloma calls

* fix: use paloma wrapper constructor

* chore: remove all lens dependencies

* fix: CI pipeline

* chore: move signature keys configuration to paloma only

* chore: update go.mod paloma reference

* doc: update README
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants