aptos-core icon indicating copy to clipboard operation
aptos-core copied to clipboard

[aptos-cli] Use onchain packages instead of git packages

Open gregnazario opened this issue 3 years ago • 11 comments

Description

Default to using the onchain package system instead of git

Test Plan

TBD


This change is Reviewable

gregnazario avatar Aug 23 '22 22:08 gregnazario

@wrwg looks like the aptos path doesn't work for me in my local testing. Need to probably debug it

gregnazario avatar Aug 25 '22 00:08 gregnazario

@wrwg looks like the aptos path doesn't work for me in my local testing. Need to probably debug it

Alright I think it needs a smoke test. Parts of this is tested e2e but not all of it. I will add one these days and debug.

wrwg avatar Aug 25 '22 00:08 wrwg

@wrwg looks like the aptos path doesn't work for me in my local testing. Need to probably debug it

Alright I think it needs a smoke test. Parts of this is tested e2e but not all of it. I will add one these days and debug.

Wait a sec. I think I know what the problem is.

wrwg avatar Aug 25 '22 00:08 wrwg

@wrwg looks like the aptos path doesn't work for me in my local testing. Need to probably debug it

Alright I think it needs a smoke test. Parts of this is tested e2e but not all of it. I will add one these days and debug.

Wait a sec. I think I know what the problem is.

This has not been called

wrwg avatar Aug 25 '22 00:08 wrwg

This has not been called

This looks like it's called before every command, but let me see if I move it around it will fix some things

gregnazario avatar Aug 25 '22 15:08 gregnazario

This has not been called

This looks like it's called before every command, but let me see if I move it around it will fix some things

One can see that the issue if somewhere in the logs it complains about an unknown property in the Move.toml. That is the new property upgrade_policy in the toml. As long as that registration has not happened, this warning will appear.

wrwg avatar Aug 25 '22 15:08 wrwg

Feels like there's probably three possibilities here:

  • Github
  • Local checkout
  • Onchain

I'm not sure it is safe to prefer one over the other. Both this and the current approach are problematic for testing or devs without network access.

The most reliable you can do is the chain URL. While it requires to be online, this is only the case for the initial setup. After that a local cache exists for the package which will not be updated until you ask for it (move clean). The later is possible because we never have breaking changes -- every older metadata about the chain is valid as long as you don't miss any new features.

wrwg avatar Sep 12 '22 04:09 wrwg

Feels like there's probably three possibilities here:

  • Github
  • Local checkout
  • Onchain

I'm not sure it is safe to prefer one over the other. Both this and the current approach are problematic for testing or devs without network access.

The most reliable you can do is the chain URL. While it requires to be online, this is only the case for the initial setup. After that a local cache exists for the package which will not be updated until you ask for it (move clean). The later is possible because we never have breaking changes -- every older metadata about the chain is valid as long as you don't miss any new features.

We probably, however, need to revisit all this caching code considering different networks addressed simultaneously from a dev box (so some kind of chain profiles). I think @gregnazario is already looking into this.

wrwg avatar Sep 12 '22 04:09 wrwg

Feels like there's probably three possibilities here:

  • Github
  • Local checkout
  • Onchain

I'm not sure it is safe to prefer one over the other. Both this and the current approach are problematic for testing or devs without network access.

The most reliable you can do is the chain URL. While it requires to be online, this is only the case for the initial setup. After that a local cache exists for the package which will not be updated until you ask for it (move clean). The later is possible because we never have breaking changes -- every older metadata about the chain is valid as long as you don't miss any new features.

We probably, however, need to revisit all this caching code considering different networks addressed simultaneously from a dev box (so some kind of chain profiles). I think @gregnazario is already looking into this.

I'm not doing any more looking into packages right now. Just making it so the git packages properly refresh during caching

gregnazario avatar Sep 12 '22 04:09 gregnazario

can we make this happen?

davidiw avatar Sep 25 '22 19:09 davidiw

can we make this happen?

The remaining problem was that Greg and I discussed what we do with existing Move.toml which points to a file. Lets say the Move.toml of aptos-framework points to aptos-stdlib on disk. Now we publish this to chain. Should the dependencies of the Move.toml be automatically upgraded to also point on-chain? Greg was suggesting yes. I took a look at it but it appeared a bit odd to rewrite those deps. Another position would be that aptos-framework should already by default refer to on-chain aptos-stdlib. But this doesn't reflect how we develop.

So its a bit of an open conceptual (and coding) question. Auditing stopped me from looking further. Note aptos move download can be used today to get packages from chain.

wrwg avatar Sep 25 '22 19:09 wrwg

This issue is stale because it has been open 45 days with no activity. Remove the stale label, comment or push a commit - otherwise this will be closed in 15 days.

github-actions[bot] avatar Dec 06 '22 02:12 github-actions[bot]

Closing for now, as we need to work through other ways to handle these onchain dependencies

gregnazario avatar Dec 06 '22 20:12 gregnazario