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

registry: Add ProveFreshness consensus layer transaction #4916

Merged
merged 1 commit into from
Sep 1, 2022

Conversation

peternose
Copy link
Contributor

@peternose peternose commented Aug 30, 2022

Add ProveFreshness consensus layer transaction

This is needed for Client node TEE freshness verification and should be implemented in the following manner.

We can add a (carefully parameter-gated) new transaction (e.g. registry.ProveFreshness) that accepts a fixed-size binary blob of 32 bytes and always succeeds without doing any processing or state changes. It should cost a reasonable amount of gas.

The enablement parameter should be part of the existing tee_features consensus parameter group and be a boolean called freshness_proofs. If it is set to true the new transaction is processed otherwise it is handled as a non-existing transaction (e.g. exactly as currently to avoid breaking consensus before the activation proposal passes).

The existing consensus-tee-pcs migration should be updated to enable the freshness_proofs feature and configure the default gas cost.

Test

Tested locally (sub-command gen_prove_freshness will be added latter to the CLI repository).

oasis-node registry node gen_prove_freshness \
  --transaction.fee.gas 1000 \
  --transaction.fee.amount 0 \
  --transaction.file=tx.txt \
  --genesis.file ../genesis.json \
  --debug.dont_blame_oasis \
  --debug.allow_test_keys \
  --log.level=DEBUG \
  --assume_yes

oasis-node consensus submit_tx --transaction.file tx.txt

If proofs are not enabled, I get the following error.

level=error ts=2022-08-31T06:55:44.773530442Z caller=grpc.go:242 module=grpc/client msg="request failed" method=/oasis-core.Consensus/SubmitTx req_seq=1 rsp=null err="registry: invalid argument"
level=error ts=2022-08-31T06:55:44.773585673Z caller=consensus.go:129 module=cmd/consensus msg="failed to submit transaction" err="registry: invalid argument"

@peternose peternose added c:registry Category: entity/node/runtime registry service golang labels Aug 30, 2022
@peternose peternose force-pushed the peternose/feature/freshness-proofs branch from a29b8ba to 8dd294c Compare August 30, 2022 12:55
@peternose peternose force-pushed the peternose/feature/freshness-proofs branch from 8dd294c to 95f4fcf Compare August 31, 2022 07:24
@codecov
Copy link

codecov bot commented Aug 31, 2022

Codecov Report

Merging #4916 (7a87fdb) into master (5a149fc) will increase coverage by 0.09%.
The diff coverage is 71.92%.

@@            Coverage Diff             @@
##           master    #4916      +/-   ##
==========================================
+ Coverage   66.60%   66.69%   +0.09%     
==========================================
  Files         464      464              
  Lines       50981    51028      +47     
==========================================
+ Hits        33955    34033      +78     
+ Misses      12834    12818      -16     
+ Partials     4192     4177      -15     
Impacted Files Coverage Δ
go/common/node/tee.go 100.00% <ø> (ø)
go/consensus/tendermint/apps/registry/registry.go 61.36% <30.00%> (-2.58%) ⬇️
...consensus/tendermint/apps/registry/transactions.go 54.50% <41.66%> (-0.33%) ⬇️
go/oasis-node/cmd/genesis/genesis.go 53.76% <75.00%> (-0.04%) ⬇️
go/consensus/tendermint/tests/genesis/genesis.go 92.90% <100.00%> (+0.31%) ⬆️
go/genesis/api/api.go 73.91% <100.00%> (ø)
go/registry/api/api.go 57.46% <100.00%> (+0.12%) ⬆️
go/registry/tests/tester.go 92.56% <100.00%> (+0.07%) ⬆️
go/upgrade/migrations/consensus_tee_pcs.go 75.00% <100.00%> (+2.27%) ⬆️
go/worker/keymanager/worker.go 65.31% <100.00%> (+0.21%) ⬆️
... and 37 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@peternose peternose marked this pull request as ready for review August 31, 2022 09:30
@peternose peternose requested a review from kostko August 31, 2022 09:30
Copy link
Member

@kostko kostko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly looks good, I would just avoid adding the CLI subcommands to oasis-node.

go/oasis-node/cmd/registry/node/node.go Outdated Show resolved Hide resolved
@peternose peternose force-pushed the peternose/feature/freshness-proofs branch from 95f4fcf to 146ab37 Compare August 31, 2022 21:01
@peternose peternose force-pushed the peternose/feature/freshness-proofs branch from 146ab37 to 7a87fdb Compare September 1, 2022 15:54
@peternose peternose merged commit 0807389 into master Sep 1, 2022
@peternose peternose deleted the peternose/feature/freshness-proofs branch September 1, 2022 18:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c:registry Category: entity/node/runtime registry service golang
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants