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

VP update using actions enum written by txs to a temp storage #2934

Merged
merged 34 commits into from
Apr 12, 2024

Conversation

tzemanovic
Copy link
Member

@tzemanovic tzemanovic commented Mar 21, 2024

Describe your changes

closes #2629

VPs that are being updated to check action authorization:

  • PoS
  • gov
  • pgf
  • multitoken (also try to replace the special "redirect from the write log)

Additionally, we can simplify logic in:

  • vp_implicit
  • vp_user

Indicate on which release or other PRs this topic is based on

based on #2928 + #2940 + #2848

diffs:

Checklist before merging to draft

  • I have added a changelog
  • Git history is in acceptable state

Copy link

codecov bot commented Mar 21, 2024

Codecov Report

Attention: Patch coverage is 25.54363% with 2705 lines in your changes are missing coverage. Please review.

Project coverage is 53.00%. Comparing base (2ba001d) to head (9ffcd2e).
Report is 135 commits behind head on main.

Files Patch % Lines
crates/namada/src/ledger/governance/mod.rs 0.00% 493 Missing ⚠️
crates/sdk/src/migrations.rs 0.00% 277 Missing ⚠️
crates/namada/src/ledger/pos/vp.rs 0.00% 215 Missing ⚠️
crates/apps/src/lib/node/ledger/storage/rocksdb.rs 21.18% 160 Missing ⚠️
crates/namada/src/ledger/native_vp/masp.rs 0.00% 155 Missing ⚠️
crates/namada/src/ledger/pgf/mod.rs 0.00% 137 Missing ⚠️
crates/apps/src/lib/cli.rs 0.00% 117 Missing ⚠️
crates/vp_prelude/src/lib.rs 34.10% 85 Missing ⚠️
crates/namada/src/vm/host_env.rs 52.22% 75 Missing ⚠️
crates/tx_prelude/src/proof_of_stake.rs 0.00% 70 Missing ⚠️
... and 97 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2934      +/-   ##
==========================================
- Coverage   53.88%   53.00%   -0.88%     
==========================================
  Files         308      313       +5     
  Lines      100154   102459    +2305     
==========================================
+ Hits        53966    54309     +343     
- Misses      46188    48150    +1962     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@tzemanovic tzemanovic force-pushed the tomas/tx-actions branch 4 times, most recently from a3a8069 to 1e36094 Compare March 21, 2024 18:02
@tzemanovic tzemanovic changed the title PoS VP update using actions enum written by txs to a temp storage VP update using actions enum written by txs to a temp storage Mar 25, 2024
sug0 and others added 6 commits March 25, 2024 13:20
This change permits error messages to be encoded in the `Err` branch of
`Result` types, to facilitate debugging in case of software problems,
and to improve the user experience in Namada.
* origin/tiago/wasm-errs-ux:
  Changelog for #2940
  Remove explicit out-of-gas checks during VP execution
  Rebuild wasms for tests
  Return a result of unit from VPs rather than of bools
  Extend bools and results with new helper methods
  Changelog for #2852
  Remove `eyre` from Ethereum Bridge Pool VP
  Remove `eyre` from NUT VP
  Remove `eyre` from Ethereum Bridge VP
  Remove `eyre` from Ethereum Bridge param errs
  Add a simple allocated storage err
@tzemanovic tzemanovic force-pushed the tomas/tx-actions branch 3 times, most recently from a75bd9c to 4cc8cbd Compare March 26, 2024 22:17
* tomas/ibc-tx-simplify:
  changelog: add #2848
  ibc/tx: rm compatibility wrapper
@@ -506,33 +511,12 @@ impl WriteLog {

// get changed keys grouped by the address
for key in changed_keys.iter() {
// for token keys, trigger Multitoken VP and the owner's VP
//
// TODO: this should not be a special case, as it is error prone.
Copy link
Member Author

Choose a reason for hiding this comment

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

this is now checked in crates/namada/src/ledger/native_vp/multitoken.rs

@@ -145,6 +145,20 @@ where
all_tokens.extend(dec_mints.keys().cloned());

all_tokens.iter().try_for_each(|token| {
if token.is_internal()
Copy link
Member Author

Choose a reason for hiding this comment

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

this replaces the special token addresses "redirect" from crates/state/src/write_log.rs

Copy link
Collaborator

@brentstone brentstone left a comment

Choose a reason for hiding this comment

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

PoS lgtm!

tzemanovic added a commit that referenced this pull request Apr 9, 2024
* origin/tomas/tx-actions:
  changelog: add #2934
  wasm/vp_implicit+vp_user: re-order to read the main entrypoint first
  IBC: insert NUT token as verifier in IBC transfer
  wasm/vp_implicit+vp_user: update using tx action
  vp_prelude: re-export tx mod
  multitoken: replace write_log specialization with standard VP rules
  pgf: add tx actions to check authorization
  gov: add tx actions to check authorization
  write_log: skip temp storage keys in changed keys set
  native_vp/PoS: update to use actions from txs
  tx_prelude/pos: push tx actions to indicate to VP
  namada/vm/host_env: add `tx_read_temp`
  tx,vp_prelude,native_vp: impl tx action Read/Write traits
  tx: add actions to indicate them from tx to VPs
  core/address: add `InternalAddress::TempStorage`
  Changelog for #2940
  Remove explicit out-of-gas checks during VP execution
  Rebuild wasms for tests
  Return a result of unit from VPs rather than of bools
tzemanovic added a commit that referenced this pull request Apr 10, 2024
* origin/tomas/tx-actions:
  changelog: add #2934
  wasm/vp_implicit+vp_user: re-order to read the main entrypoint first
  IBC: insert NUT token as verifier in IBC transfer
  wasm/vp_implicit+vp_user: update using tx action
  vp_prelude: re-export tx mod
  multitoken: replace write_log specialization with standard VP rules
  pgf: add tx actions to check authorization
  gov: add tx actions to check authorization
  write_log: skip temp storage keys in changed keys set
  native_vp/PoS: update to use actions from txs
  tx_prelude/pos: push tx actions to indicate to VP
  namada/vm/host_env: add `tx_read_temp`
  tx,vp_prelude,native_vp: impl tx action Read/Write traits
  tx: add actions to indicate them from tx to VPs
  core/address: add `InternalAddress::TempStorage`
  Changelog for #2940
  Remove explicit out-of-gas checks during VP execution
  Rebuild wasms for tests
  Return a result of unit from VPs rather than of bools
@tzemanovic tzemanovic merged commit da61fe3 into main Apr 12, 2024
16 of 19 checks passed
@tzemanovic tzemanovic deleted the tomas/tx-actions branch April 12, 2024 10:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

only use the first address of a storage key to invoke VP
4 participants