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

Display extra pages in goal info commands #2763

Merged
merged 2 commits into from
Aug 18, 2021

Conversation

jasonpaulos
Copy link
Member

Summary

With this PR, the commands goal app info, goal account info, and goal account list --info now display the number of extra pages an application has.

For example, the following were executed on a private network where apps 1, 2, 3, 4 have 1, 2, 3, 0 extra pages, respectively.

$ goal app info --app-id 3 -d DATA_DIR
Application ID:        3
Creator:               U4SKWGT6KYRA3DCMVPJLMMMNCP35UOYBFMQLEHLYDHO4C4N7GU7LLNQUHU
Approval hash:         Q7ODX32ILHMGO6KPSELVTO7RCVOUZ37RWYHISAWER7GVARJGKTWEWD37AM
Clear hash:            P7GEWDXXW5IONRW6XRIRVPJCT2XXEQGOBGG65VJPBUOYZEJCBZWTPHS3VQ
Extra program pages:   3
Max global byteslices: 2
Max global integers:   1
Max local byteslices:  4
Max local integers:    3
$ goal account info -a U4SKWGT6KYRA3DCMVPJLMMMNCP35UOYBFMQLEHLYDHO4C4N7GU7LLNQUHU -d DATA_DIR
Created Assets:
        <none>
Held Assets:
        <none>
Created Apps:
        ID 1, 1 extra page, global state used 0/1 uints, 0/2 byte slices
        ID 2, 2 extra pages, global state used 0/1 uints, 0/2 byte slices
        ID 3, 3 extra pages, global state used 0/1 uints, 0/2 byte slices
        ID 4, global state used 0/1 uints, 0/2 byte slices
Opted In Apps:
        <none>
$ goal account list --info -d DATA_DIR
[offline]       EHF6QYU3HCUUXIZAMPJ5RZWNDT37Y72NHVZ4XHWMYILPXWVU7G2G4PX32I   EHF6QYU3HCUUXIZAMPJ5RZWNDT37Y72NHVZ4XHWMYILPXWVU7G2G4PX32I   4000024000000000 microAlgos
Created Assets:
...
[offline]       U4SKWGT6KYRA3DCMVPJLMMMNCP35UOYBFMQLEHLYDHO4C4N7GU7LLNQUHU   U4SKWGT6KYRA3DCMVPJLMMMNCP35UOYBFMQLEHLYDHO4C4N7GU7LLNQUHU   1000006000004997 microAlgos     [created app IDs: 1, 2, 3, 4]
Created Assets:
        <none>
Held Assets:
        <none>
Created Apps:
        ID 1, 1 extra page, global state used 0/1 uints, 0/2 byte slices
        ID 2, 2 extra pages, global state used 0/1 uints, 0/2 byte slices
        ID 3, 3 extra pages, global state used 0/1 uints, 0/2 byte slices
        ID 4, global state used 0/1 uints, 0/2 byte slices
Opted In Apps:
        <none>

Test Plan

Modified existing e2e test and expect test. (I know expect tests aren't currently running, but it passed locally.)

@codecov-commenter
Copy link

codecov-commenter commented Aug 18, 2021

Codecov Report

Merging #2763 (d9417a5) into master (66e54d9) will decrease coverage by 0.02%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2763      +/-   ##
==========================================
- Coverage   47.12%   47.09%   -0.03%     
==========================================
  Files         349      349              
  Lines       56326    56348      +22     
==========================================
- Hits        26541    26535       -6     
- Misses      26814    26838      +24     
- Partials     2971     2975       +4     
Impacted Files Coverage Δ
cmd/goal/account.go 14.41% <0.00%> (-0.37%) ⬇️
cmd/goal/accountsList.go 0.00% <0.00%> (ø)
cmd/goal/application.go 12.79% <0.00%> (-0.08%) ⬇️
ledger/roundlru.go 90.56% <0.00%> (-5.67%) ⬇️
ledger/blockqueue.go 82.18% <0.00%> (-2.88%) ⬇️
ledger/acctupdates.go 62.13% <0.00%> (-0.34%) ⬇️
network/wsPeer.go 74.65% <0.00%> (+0.27%) ⬆️
catchup/service.go 70.12% <0.00%> (+0.77%) ⬆️
cmd/tealdbg/debugger.go 73.86% <0.00%> (+1.00%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 66e54d9...d9417a5. Read the comment docs.

Copy link
Contributor

@jannotti jannotti left a comment

Choose a reason for hiding this comment

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

It seems good to me, assuming I've properly understood why there's so much churn around unrelated things (because of upgrade to v2, I'm assuming).

if [[ $RES != *"${PROGHASH}"* ]]; then
date '+app-extra-pages-test FAIL the application info should succeed %Y%m%d_%H%M%S'
date '+app-extra-pages-test FAIL the application approval program hash is incorrect %Y%m%d_%H%M%S'
Copy link
Contributor

Choose a reason for hiding this comment

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

Might be nice to migrate toward doing this at the top of e2e .sh programs

filename=$(basename "$0")
scriptname="${filename%.*}"
date "+${scriptname} start %Y%m%d_%H%M%S"

So you can use $scriptname here (and elsewhere). No big deal, just makes copying testing for modification easier.

@@ -31,7 +31,7 @@ import (
"github.com/algorand/go-algorand/config"
"github.com/algorand/go-algorand/crypto"
"github.com/algorand/go-algorand/crypto/passphrase"
v1 "github.com/algorand/go-algorand/daemon/algod/api/spec/v1"
generatedV2 "github.com/algorand/go-algorand/daemon/algod/api/server/v2/generated"
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you summarize what we're doing with versioning that forces changes in this PR? We don't have to increment the version for changes like this, right? Maybe you're just migrating to the new version that we previously had to do?

Copy link
Member Author

Choose a reason for hiding this comment

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

Actually I had to upgrade to using the v2 endpoint because v1 does not return extra pages values for accounts.

for _, createdAsset := range createdAssets {
name := "<unnamed>"
if createdAsset.Params.Name != nil {
_, name = unicodePrintable(*createdAsset.Params.Name)
Copy link
Member Author

Choose a reason for hiding this comment

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

It may be unnecessary to pipe the string fields through unicodePrintable after #2555, but I've left them in just in case.

@jannotti jannotti merged commit d7e9240 into algorand:master Aug 18, 2021
@jasonpaulos jasonpaulos deleted the goal-display-extra-pages branch August 18, 2021 16:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants