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

[Protocol] Centralized Proof & Tokenomics param updating #486

Merged
merged 61 commits into from
May 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
c5a5ac1
refactor: claim message test helper
bryanchriswhite Apr 17, 2024
7696abf
scaffold: message `UpdateParam` --module proof --signer authority par…
bryanchriswhite Apr 17, 2024
8442333
chore: add JSON tag to params fields
bryanchriswhite Apr 22, 2024
d047355
chore: disable autocli for update-param proof module subcommand
bryanchriswhite Apr 22, 2024
d9a9a5f
refactor: proof module param update msg
bryanchriswhite Apr 22, 2024
532aefc
chore: inject genesis authz state during localnet_regenesis
bryanchriswhite Apr 22, 2024
f6a596c
chore: add param update make targets
bryanchriswhite Apr 22, 2024
a343dc7
scaffold: message update-param --module tokenomics --signer authority…
bryanchriswhite Apr 22, 2024
9fa374a
feat: implement proof module individual param update handler
bryanchriswhite Apr 22, 2024
e00b689
fix: scaffold template naming inconsistency
bryanchriswhite Apr 22, 2024
eeedc1f
refactor: tokenomics module update param msg
bryanchriswhite Apr 22, 2024
77170f2
chore: add tokenomics update param msg to authz genesis grants
bryanchriswhite Apr 22, 2024
07219de
feat: implement tokenomics update param msg handler
bryanchriswhite Apr 22, 2024
a1ee581
chore: comment out tokenomics update param subcommand autocli config
bryanchriswhite Apr 22, 2024
2dea723
chore: lint
bryanchriswhite Apr 22, 2024
b7a04d7
chore: add update_tokenomics_compute_units_to_tokens_multiplier make …
bryanchriswhite Apr 22, 2024
1ff5274
fix: revert scaffold re-formatting
bryanchriswhite Apr 22, 2024
3eae567
chore: lint
bryanchriswhite Apr 22, 2024
54436bc
wip: add E2E tests
bryanchriswhite Apr 23, 2024
99f167a
wip: E2E test; exec tx JSON is difficult
bryanchriswhite Apr 23, 2024
c9955c2
Merge branch 'main' into issues/322/proof-of-concept
Olshansk Apr 24, 2024
b08a74a
fix: use JSON strings for consistency w/ codec
bryanchriswhite Apr 24, 2024
9939388
chore: regenerate pulsar files
bryanchriswhite Apr 24, 2024
69d4c46
wip: E2E test touch-up
bryanchriswhite Apr 24, 2024
9b0ffbb
Merge branch 'main' into issues/322/proof-of-concept
Olshansk Apr 24, 2024
d515b6f
Reviewed everything except for e2e/tests/update_params_test.go
Olshansk Apr 25, 2024
cefd1c0
Brought back accidently removed parameter
Olshansk Apr 25, 2024
93c3826
WIP - reviewing update_params_test.go
Olshansk Apr 25, 2024
63a5a28
chore: add `MsgUpdateParams` grants for all modules
bryanchriswhite Apr 25, 2024
7f30695
Merge remote-tracking branch 'pokt/main' into issues/322/proof-of-con…
bryanchriswhite Apr 29, 2024
f165be1
chore: review feedback improvements & cleanup
bryanchriswhite Apr 29, 2024
c2d58ef
chore: review feedback improvements
bryanchriswhite Apr 29, 2024
dfe83a6
Merge branch 'main' into issues/322/proof-of-concept
bryanchriswhite Apr 29, 2024
818ed9f
chore: lint
bryanchriswhite Apr 29, 2024
606ae3a
chore: review feedback improvements
bryanchriswhite May 2, 2024
e5ecf61
Merge branch 'main' into issues/322/proof-of-concept
bryanchriswhite May 2, 2024
7388066
chore: regenerate openapi.yml
bryanchriswhite May 3, 2024
07840c8
Merge remote-tracking branch 'pokt/main' into issues/322/proof-of-con…
bryanchriswhite May 6, 2024
009e2d3
wip: test: update params E2E is green
bryanchriswhite May 6, 2024
65819f0
chore: review improvements
bryanchriswhite May 10, 2024
6636cd5
Merge remote-tracking branch 'pokt/main' into issues/322/proof-of-con…
bryanchriswhite May 10, 2024
e451a42
fix: add missing build constraints
bryanchriswhite May 13, 2024
ec5b7bf
chore: review improvements
bryanchriswhite May 13, 2024
f31b645
chore: review improvements
bryanchriswhite May 13, 2024
c0dea35
chore: review improvements
bryanchriswhite May 13, 2024
3496920
Merge remote-tracking branch 'pokt/main' into issues/322/proof-of-con…
bryanchriswhite May 13, 2024
7bf03fb
use localnet_regenesis in developer container image
okdas May 13, 2024
74ba295
add writable dir for keys
okdas May 14, 2024
3faba62
remove accidenatlly pushed file
okdas May 14, 2024
2739eca
troubleshoot the test
okdas May 14, 2024
529ef3e
copy resolving symlinks
okdas May 14, 2024
7f85009
remove debug commands
okdas May 14, 2024
d3d682f
chore: review improvements
bryanchriswhite May 15, 2024
b72f9e4
Merge remote-tracking branch 'pokt/main' into issues/322/proof-of-con…
bryanchriswhite May 15, 2024
f8b7d0f
chore: review improvements
bryanchriswhite May 15, 2024
3db689b
Merge branch 'main' into issues/322/proof-of-concept
bryanchriswhite May 15, 2024
284e860
fix: app authority issue
bryanchriswhite May 15, 2024
40147b7
chore: review feedback improvements
bryanchriswhite May 15, 2024
4fa821d
fix: step sentence updated
bryanchriswhite May 15, 2024
86fe8bc
fix: load test uses authz to update params
bryanchriswhite May 15, 2024
ac122b0
fix: step sentence updated
bryanchriswhite May 15, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 45 additions & 37 deletions .github/workflows-helpers/run-e2e-test-job-template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,44 +11,52 @@ spec:
pokt.network/purpose: e2e-tests
spec:
containers:
- name: e2e-tests
image: ghcr.io/pokt-network/poktrolld:${IMAGE_TAG}
command: ["/bin/sh"]
args:
- "-c"
- |
poktrolld q gateway list-gateway --node=$POCKET_NODE && \
poktrolld q application list-application --node=$POCKET_NODE && \
poktrolld q supplier list-supplier --node=$POCKET_NODE && \
make acc_initialize_pubkeys && \
go test -v ./e2e/tests/... -tags=e2e
env:
- name: POCKET_NODE
value: tcp://${NAMESPACE}-validator-poktrolld:36657
- name: VALIDATOR_RPC_ENDPOINT
value: ${NAMESPACE}-validator-poktrolld:36657
- name: E2E_DEBUG_OUTPUT
value: "false" # Flip to true to see the command and result of the execution
- name: POKTROLLD_HOME
value: /root/.poktroll
- name: APPGATE_SERVER_URL
value: http://${NAMESPACE}-appgate-server:80
- name: GATEWAY_URL
value: http://${NAMESPACE}-gateway:80
volumeMounts:
- mountPath: /root/.poktroll/keyring-test/
name: keys-volume
- mountPath: /root/.poktroll/config/
name: configs-volume
- name: e2e-tests
image: ghcr.io/pokt-network/poktrolld:${IMAGE_TAG}
command: ["/bin/sh"]
args:
- "-c"
- |
# Copy files from the secret to the writable directory
cp -Lr /tmp/keys/* /root/.poktroll/keyring-test/ && \
echo "Listing /root/.poktroll/keyring-test/ after copying:"
ls -l /root/.poktroll/keyring-test/ && \
poktrolld q gateway list-gateway --node=$POCKET_NODE && \
poktrolld q application list-application --node=$POCKET_NODE && \
poktrolld q supplier list-supplier --node=$POCKET_NODE && \
make acc_initialize_pubkeys && \
go test -v ./e2e/tests/... -tags=e2e
env:
- name: POCKET_NODE
value: tcp://${NAMESPACE}-validator-poktrolld:36657
- name: VALIDATOR_RPC_ENDPOINT
value: ${NAMESPACE}-validator-poktrolld:36657
- name: E2E_DEBUG_OUTPUT
value: "false" # Flip to true to see the command and result of the execution
- name: POKTROLLD_HOME
value: /root/.poktroll
- name: APPGATE_SERVER_URL
value: http://${NAMESPACE}-appgate-server:80
- name: GATEWAY_URL
value: http://${NAMESPACE}-gateway:80
volumeMounts:
- mountPath: /root/.poktroll/keyring-test/
name: writable-keys-volume
- mountPath: /root/.poktroll/config/
name: configs-volume
- mountPath: /tmp/keys
name: non-writable-keys-volume
readOnly: true
restartPolicy: Never
volumes:
- secret:
defaultMode: 420
secretName: keys-${IMAGE_TAG}
name: keys-volume
- configMap:
defaultMode: 420
name: configs-${IMAGE_TAG}
name: configs-volume
- name: writable-keys-volume
emptyDir: {}
- name: non-writable-keys-volume
secret:
secretName: keys-${IMAGE_TAG}
- configMap:
defaultMode: 420
name: configs-${IMAGE_TAG}
name: configs-volume
serviceAccountName: default
backoffLimit: 0
15 changes: 15 additions & 0 deletions .github/workflows/reviewdog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,21 @@ jobs:
fail_on_error: true
pattern: TODO_IN_THIS_

# Prevent the use of `sed` in helper scripts. This ensures compatibility across
# Darwin and Linux systems.
check_sed:
name: Check sed
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pokt-network/action-fail-on-found@v1
with:
github_token: ${{ secrets.github_token }}
reporter: github-pr-review
level: error
fail_on_error: true
pattern: sed -i .*

# Ensure that we are using polylog (via logger.) instead of the golang's stdlib
# log package.
check_stdlog_in_off_chain_package:
Expand Down
8 changes: 6 additions & 2 deletions Dockerfile.dev
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ FROM golang:1.22.2 as base
RUN apt update && \
apt-get install -y \
ca-certificates net-tools kubernetes-client \
curl jq make vim less dnsutils
curl jq yq make vim less dnsutils

# enable faster module downloading.
ENV GOPROXY https://proxy.golang.org
Expand All @@ -17,7 +17,11 @@ WORKDIR /poktroll

RUN mv /poktroll/bin/ignite /usr/bin/ && mv /poktroll/bin/poktrolld /usr/bin/

RUN ignite chain init --skip-proto
# These are helpful for testing locally:
# RUN mv bin/poktrolld /usr/bin/
# RUN mv bin/ignite /usr/bin/

RUN make localnet_regenesis

# TODO_TECHDEBT(@okdas): Ports are not documented as they will soon be changed with a document to follow
EXPOSE 8545
Expand Down
45 changes: 32 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ APPLICATION_MODULE_ADDRESS = pokt1rl3gjgzexmplmds3tq3r3yk84zlwdl6djzgsvm
SUPPLIER_MODULE_ADDRESS = pokt1j40dzzmn6cn9kxku7a5tjnud6hv37vesr5ccaa
GATEWAY_MODULE_ADDRESS = pokt1f6j7u6875p2cvyrgjr0d2uecyzah0kget9vlpl
SERVICE_MODULE_ADDRESS = pokt1nhmtqf4gcmpxu0p6e53hpgtwj0llmsqpxtumcf
GOV_ADDRESS = pokt10d07y265gmmuvt4z0w9aw880jnsr700j8yv32t
# PNF acts on behalf of the DAO and who AUTHZ must delegate to
PNF_ADDRESS = pokt1eeeksh2tvkh7wzmfrljnhw4wrhs55lcuvmekkw

MODULES := application gateway pocket service session supplier proof tokenomics

BRANCH := $(shell git rev-parse --abbrev-ref HEAD)
COMMIT := $(shell git log -1 --format='%H')
Expand Down Expand Up @@ -304,10 +309,13 @@ localnet_down: ## Delete resources created by localnet
localnet_regenesis: check_yq acc_initialize_pubkeys_warn_message ## Regenerate the localnet genesis file
# NOTE: intentionally not using --home <dir> flag to avoid overwriting the test keyring
@echo "Initializing chain..."
@set -e ;\
ignite chain init --skip-proto ;\
cp -r ${HOME}/.poktroll/keyring-test $(POKTROLLD_HOME) ;\
cp -r ${HOME}/.poktroll/config $(POKTROLLD_HOME)/ ;\
@set -e
@ignite chain init --skip-proto
AUTH_CONTENT=$$(cat ./tools/scripts/authz/dao_genesis_authorizations.json | jq -r tostring); \
$(SED) -i -E 's!^(\s*)"authorization": (\[\]|null)!\1"authorization": '$$AUTH_CONTENT'!' ${HOME}/.poktroll/config/genesis.json;

@cp -r ${HOME}/.poktroll/keyring-test $(POKTROLLD_HOME)
@cp -r ${HOME}/.poktroll/config $(POKTROLLD_HOME)/

.PHONY: send_relay
send_relay:
Expand Down Expand Up @@ -726,11 +734,10 @@ acc_balance_total_supply: ## Query the total supply of the network
.PHONY: acc_initialize_pubkeys
acc_initialize_pubkeys: ## Make sure the account keeper has public keys for all available accounts
$(eval ADDRESSES=$(shell make -s ignite_acc_list | grep pokt | awk '{printf "%s ", $$2}' | sed 's/.$$//'))
$(eval PNF_ADDR=pokt1eeeksh2tvkh7wzmfrljnhw4wrhs55lcuvmekkw)
$(foreach addr, $(ADDRESSES),\
echo $(addr);\
poktrolld tx bank send \
$(addr) $(PNF_ADDR) 1000upokt \
$(addr) $(PNF_ADDRESS) 1000upokt \
--yes \
--home=$(POKTROLLD_HOME) \
--node $(POCKET_NODE) \
Expand Down Expand Up @@ -790,15 +797,27 @@ claim_list_session: ## List all the claims ending at a specific session (specifi
### Params ###
##############

MODULES := application gateway pocket service session supplier tokenomics
# TODO_CONSIDERATION: additional factoring (e.g. POKTROLLD_FLAGS).
PARAM_FLAGS = --home=$(POKTROLLD_HOME) --keyring-backend test --from $(PNF_ADDRESS) --node $(POCKET_NODE)

.PHONY: update_tokenomics_params_all
params_update_tokenomics_all: ## Update the tokenomics module params
poktrolld tx authz exec ./tools/scripts/params/tokenomics_all.json $(PARAM_FLAGS)

.PHONY: params_update_tokenomics_compute_units_to_tokens_multiplier
params_update_tokenomics_compute_units_to_tokens_multiplier: ## Update the tokenomics module params
poktrolld tx authz exec ./tools/scripts/params/tokenomics_compute_units_to_tokens_multiplier.json $(PARAM_FLAGS)

.PHONY: params_update_proof_all
params_update_proof_all: ## Update the proof module params
poktrolld tx authz exec ./tools/scripts/params/proof_all.json $(PARAM_FLAGS)

# TODO_IMPROVE(#322): Improve once we decide how to handle parameter updates
.PHONY: update_tokenomics_params
update_tokenomics_params: ## Update the tokenomics module params
poktrolld --home=$(POKTROLLD_HOME) tx tokenomics update-params 43 --keyring-backend test --from pnf --node $(POCKET_NODE) --chain-id $(CHAIN_ID)
.PHONY: params_update_proof_min_relay_difficulty_bits
params_update_proof_min_relay_difficulty_bits: ## Update the proof module params
poktrolld tx authz exec ./tools/scripts/params/proof_min_relay_difficulty_bits.json $(PARAM_FLAGS)

.PHONY: query_all_params
query_all_params: check_jq ## Query the params from all available modules
.PHONY: params_query_all
params_query_all: check_jq ## Query the params from all available modules
@for module in $(MODULES); do \
echo "~~~ Querying $$module module params ~~~"; \
poktrolld query $$module params --node $(POCKET_NODE) --output json | jq; \
Expand Down
44 changes: 23 additions & 21 deletions api/poktroll/application/params.pulsar.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 6 additions & 4 deletions api/poktroll/proof/params.pulsar.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading