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

MASP indexer integration #1120

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open

Conversation

mateuszjasiuk
Copy link
Collaborator

@mateuszjasiuk mateuszjasiuk commented Sep 17, 2024

I don't think there is an easy way to test this for now :/ But I think as long as this does not break other features we can merge it.

Okay!
Make sure you test against 0.44.0
So to test shielded sync w/o masp indexer you can:

  • shield some nam using CLI(localnet example)
target/debug/namada wallet gen --shielded --alias albert-shielded --base-dir .namada/validator-0
target/debug/namada wallet gen-payment-addr --alias albert-pa1 --key albert-shielded --base-dir .namada/validator-0
target/debug/namada client shield --source albert --target albert-pa1 --token nam --amount 1000  --base-dir .namada/validator-0
# To get the viewing key
target/debug/namada wallet find --alias albert-shielded --base-dir .namada/validator-0
  • Add this to App.tsx in namadillo(with missing imports)
  useEffect(() => {
    const shieldedSync = async (): Promise<void> => {
      const vk =
        "YOUR_VK";
      const sdk = await getSdkInstance();
      await sdk.rpc.shieldedSync([vk]);
    };

    // eslint-disable-next-line @typescript-eslint/no-explicit-any
    (window as any).shieldedSync = shieldedSync;
  });
  • run await window.shieldedSync() in namadillo console, you should see progress logged
  • 👀

image

To test with masp indexer you can do the same setup but also run masp_indexer locally.

  • running instructions
  • if you want to run masp indexer alongsinde indexer(it's a bit of a headache for now) you need to change ports :/ I will change ports in regular indexer soon so there are no conflicts during development
    command: ["postgres", "-c", "listen_addresses=0.0.0.0", "-c", "max_connections=200", "-p", "5433"]
    expose:
      - "5433" # Publishes 5432 to other containers but NOT to host machine
    ports:
      - "5433:5433"
# AND
    ports:
      - 5000:5001
 # AND ALL
      DATABASE_URL: postgres://postgres:password@postgres:5433/masp_indexer_local
  • paste MASP indexer url
    image
  • wait for commitment tree to get indexed
  • retest

CLEAR CONTEXT MANUALLY BETWEEN TESTS, JUST REMOVE IT FROM IDB
ALSO currently I;m getting this :(

Caused by:
    Could not deserialize the notes map JSON response at height 3017: error decoding response body: missing field `batch_index` at line 1 column 89

@mateuszjasiuk mateuszjasiuk changed the title feat: code compiles WIP: MASP indexer integration Sep 17, 2024
Base automatically changed from feat/1098-add-remaining-transfer-types to main September 17, 2024 10:19
@mateuszjasiuk mateuszjasiuk force-pushed the feat/masp-indexer-integration branch 7 times, most recently from 5828d30 to ebb576d Compare September 19, 2024 12:17
built_txs.push(tx);
}

// Get wrapper args
let first_tx = built_txs
.get(0)
.first()
Copy link
Collaborator

Choose a reason for hiding this comment

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

thanks, I thought I had updated all of these :D

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I've recently setup clippy, it shows all that stuff :D

@@ -761,6 +765,8 @@ pub fn ibc_transfer_tx_args(
channel_id,
timeout_height,
timeout_sec_offset,
// TODO: false for now
disposable_signing_key: false,
Copy link
Collaborator

Choose a reason for hiding this comment

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

What do you think about mapping this to the types/args before we release? I could do a follow-up PR that adds any potential args we may want soon to our types package, that way we wouldn't have to worry about any breaking APIs after we publish. Unless there's not a use-case we'll need for this. I can look into that!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think we can add it when we start testing transfers

@mateuszjasiuk mateuszjasiuk changed the title WIP: MASP indexer integration MASP indexer integration Sep 30, 2024
@mateuszjasiuk mateuszjasiuk marked this pull request as ready for review September 30, 2024 12:25
@@ -124,11 +124,11 @@ mod tests {
.expect("Deriving from ExtendedKeys should not fail");

Copy link
Collaborator

Choose a reason for hiding this comment

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

Weird, I'm now getting a build warning on this file, though not sure why it's happening on this branch:

warning: field `0` is never read
  --> src/crypto/zip32.rs:15:27
   |
15 | pub struct ExtSpendingKey(pub(crate) ExtendedSpendingKey);
   |            -------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |            |
   |            field in this struct

Not sure that we're using that type any more. Not a big deal on this PR, just noting!

Copy link
Collaborator

@jurevans jurevans left a comment

Choose a reason for hiding this comment

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

Code LGTM! Was able to test this locally, works great! I think it's fine to point to that rev for now, we can later point to the next tag that has the fixes we need.

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.

2 participants