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

a3p integration for liquidation visibility #6

Open
Jorge-Lopes opened this issue Feb 9, 2024 · 3 comments
Open

a3p integration for liquidation visibility #6

Jorge-Lopes opened this issue Feb 9, 2024 · 3 comments

Comments

@Jorge-Lopes
Copy link
Collaborator

Jorge-Lopes commented Feb 9, 2024

Current status:

  • I provided the vaultFactory proposal, permit and bundle to the assets directory (9179306)
  • Start developing the test-liquidation-visibility.js using as guide the test-crabble-start.js and add-collateral.test (ad0fae5)

Note: in order to run the eval.sh script it is necessary to first start the agd, ( @alexanderem49 that is the source of the time-out error you were facing ).
For this purpose I end up have 2 open terminals and run the start_agd script in one and the eval in the other.
I think the run_eval script would be able to run both processes but it was confusing to follow the log messages.

Task: confirm with @anilhelvaci if this is the correct flow to setup the env and execute the test

@Jorge-Lopes
Copy link
Collaborator Author

Jorge-Lopes commented Feb 12, 2024

Error: RPC error -32600 - Invalid Request: error reading request body: http: request body too large

Context

After starting the container built using the ghcr.io/agoric/agoric-3-proposals image, we intent to test a proposal for updating the vaultFactory contract.

When installing the contract bundle (generated by executing agoric run <vaultFactory-proposal-builder>) the error Error: RPC error -32600 - Invalid Request: error reading request body: http: request body too large is triggered. The complete logs are provided bellow.

I have made sure that the bundle I provided in the assets directory is the one generated by the agoric run command, as it can be verified by the vaultFactory core-eval.

The same behaviour does not happens when I install the bundles on a local chain launched using the start-local-chain.sh script of the agoric-cli pkg, which I verified via the storage viewer.

This error message point me to the issue #28, but the proposed work around was not useful for me.

I am not sure if this issue can be related with the issue #17

Error message

Chain Logs:
agd --chain-id agoriclocal --keyring-backend test --from agoric1s8lmczw37rz7qendxa2pc88qrlmhn4gsda8vn4  tx swingset install-bundle @/usr/src/a3p/proposals/b:liquidation-visibility/assets/bundle-vaultFactory.json --gas auto --broadcast-mode block --yes --output json
Error: RPC error -32600 - Invalid Request: error reading request body: http: request body too large
Usage:
  agd tx swingset install-bundle <JSON>/@<FILE>/- [flags]

Flags:
  -a, --account-number uint      The account number of the signing account (offline mode only)
  -b, --broadcast-mode string    Transaction broadcasting mode (sync|async|block) (default "sync")
      --compress                 Compress the bundle in transit (default true)
      --dry-run                  ignore the --gas flag and perform a simulation of a transaction, but don't broadcast it (when enabled, the local Keybase is not accessible)
      --fee-account string       Fee account pays fees for the transaction instead of deducting from the signer
      --fees string              Fees to pay along with transaction; eg: 10uatom
      --from string              Name or address of private key with which to sign
      --gas string               gas limit to set per-transaction; set to "auto" to calculate sufficient gas automatically (default 200000)
      --gas-adjustment float     adjustment factor to be multiplied against the estimate returned by the tx simulation; if the gas limit is set manually this flag is ignored  (default 1)
      --gas-prices string        Gas prices in decimal format to determine the transaction fee (e.g. 0.1uatom)
      --generate-only            Build an unsigned transaction and write it to STDOUT (when enabled, the local Keybase is not accessible)
  -h, --help                     help for install-bundle
      --keyring-backend string   Select keyring's backend (os|file|kwallet|pass|test|memory) (default "os")
      --keyring-dir string       The client Keyring directory; if omitted, the default 'home' directory will be used
      --ledger                   Use a connected Ledger device
      --node string              <host>:<port> to tendermint rpc interface for this chain (default "tcp://localhost:26657")
      --note string              Note to add a description to the transaction (previously --memo)
      --offline                  Offline mode (does not allow any online functionality
  -o, --output string            Output format (text|json) (default "json")
  -s, --sequence uint            The sequence number of the signing account (offline mode only)
      --sign-mode string         Choose sign mode (direct|amino-json), this is an advanced feature
      --timeout-height uint      Set a block timeout height to prevent the tx from being committed past a certain height
  -y, --yes                      Skip tx broadcasting prompt confirmation

Global Flags:
      --chain-id string     The network chain ID
      --home string         directory for config and data (default "/root/.agoric")
      --log_format string   The logging format (json|plain) (default "plain")
      --log_level string    The logging level (trace|debug|info|warn|error|fatal|panic) (default "info")
      --trace               print out full stack trace on errors

@Jorge-Lopes
Copy link
Collaborator Author

Jorge-Lopes commented Feb 14, 2024

Follow up on the issue described above

A lead to a possible solution was discussed on office hours, that pointed to a possible source of this error could be the bundle be larger than 1MB. See Agoric/dapp-offer-up#28.

To test this case I used the test-build-proposal.js for the created vaultFactory proposal-builder.

Based on the test result, we can assume that this is not the issue

yarn test test/liquidationVisibility/test-proposal.js
yarn run v1.22.19
$ ava test/liquidationVisibility/test-proposal.js

agoric: run: running /Users/jorgelopes/Documents/GitHub/Agoric/sow6/liquidation-visibility/agoric-sdk-liquidation-visibility/packages/builders/scripts/inter-protocol/liquidationVisibility/proposal-builder.js
  ✔ proposal builder generates compressed bundles less than 1MB (5.5s)
    ℹ agoric run stdout: agoric: run: Deploy script will run with Node.js ESM
      bundle-source --cache-js /Users/jorgelopes/Documents/GitHub/Agoric/sow6/liquidation-visibility/agoric-sdk-liquidation-visibility/packages/builders/scripts/inter-protocol/liquidationVisibility/bundles /Users/jorgelopes/Documents/GitHub/Agoric/sow6/liquidation-visibility/agoric-sdk-liquidation-visibility/packages/inter-protocol/src/vaultFactory/vaultFactory.js vaultFactory
      creating vaultFactory-permit.json
      creating vaultFactory.js
      You can now run a governance submission command like:
        agd tx gov submit-proposal swingset-core-eval vaultFactory-permit.json vaultFactory.js \
          --title="Enable <something>" --description="Evaluate vaultFactory.js" --deposit=1000000ubld \
          --gas=auto --gas-adjustment=1.2
      Remember to install bundles before submitting the proposal:
        agd tx swingset install-bundle @/Users/jorgelopes/.agoric/cache/b1-5302546fafc63a2ef36142fb50c2333eb5e6775f6eebb725d1e3ce83aad7b27b3341992d9d83488383bfd19784b241fccc29a8cb9eeb9ebf33059b3976ff9b22.json
        agd tx swingset install-bundle @/Users/jorgelopes/.agoric/cache/b1-91a1a9da1dfa3bc6d3a8918cc6ff013869ebdf4b8df64ebd70e745289e32a382fc5850ce1b717b26b7707bdc861fb62aa2e840038d95f8082f8bb2656a01afce.json
      
      Object <[Object: null prototype] {}> { initial: 0, total: 1 }
      
    ℹ {
        bundleId: 'b1-5302546fafc63a2ef36142fb50c2333eb5e6775f6eebb725d1e3ce83aad7b27b3341992d9d83488383bfd19784b241fccc29a8cb9eeb9ebf33059b3976ff9b22',
        compressedSize: '0.50689697265625 MB',
      }
    ℹ {
        bundleId: 'b1-91a1a9da1dfa3bc6d3a8918cc6ff013869ebdf4b8df64ebd70e745289e32a382fc5850ce1b717b26b7707bdc861fb62aa2e840038d95f8082f8bb2656a01afce',
        compressedSize: '0.39804744720458984 MB',
      }
  ─

  1 test passed

As an experiment, I passed the --compress flag (which should be set as true by default) to the tx swingset install-bundle command. But the result was still the same.

agd --chain-id agoriclocal --keyring-backend test --from agoric1s8lmczw37rz7qendxa2pc88qrlmhn4gsda8vn4 tx swingset install-bundle @/usr/src/a3p/proposals/b:liquidation-visibility/assets/bundle-vaultFactory.json --compress --gas auto --broadcast-mode block --yes --output json
Error: RPC error -32600 - Invalid Request: error reading request body: http: request body too large
Usage:
  agd tx swingset install-bundle <JSON>/@<FILE>/- [flags]

@Jorge-Lopes
Copy link
Collaborator Author

The following commit seems to fix the issue faa0773

Although there was some inconsistent behaviours while I was testing with different approaches.
If I can replicate those results I will share it here as well.

Nonetheless, @alexanderem49 the update above will be enough for you to continue extending the integration test coverage

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

No branches or pull requests

1 participant