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

@metaplex-foundation/umi-uploader-irys seems not to work anymore since removal of Deprecated RPC Methods #144

Open
BenoistP opened this issue Aug 23, 2024 · 4 comments

Comments

@BenoistP
Copy link

BenoistP commented Aug 23, 2024

Hello,

@metaplex-foundation/umi-uploader-irys depends on an old solana/web3.js version
which calls getRecentBlockhash that has been deprecated since a while and seems now completely discarded

https://github.com/metaplex-foundation/umi/blob/main/packages/umi-uploader-irys/package.json
"@solana/web3.js": "^1.72.0",

image

https://solana-labs.github.io/solana-web3.js/classes/Connection.html#getRecentBlockhash

File upload does not work anymore whatever the rpc used.

https://solanacompass.com/learn/Changelog/solana-changelog-jul-3-rpc-deprecations-actions-and-blinks#removal-of-deprecated-rpc-methods-in-version-20

Probably the same issue should affect bundler
https://github.com/metaplex-foundation/umi/blob/main/packages/umi-uploader-bundlr/package.json

@BenoistP BenoistP changed the title @metaplex-foundation/umi-uploader-irys seems not to work anymore since @metaplex-foundation/umi-uploader-irys seems not to work anymore since removal of Deprecated RPC Methods Aug 23, 2024
@blockiosaurus
Copy link
Contributor

Thanks! The bundlr package is deprecated but it looks like the Irys uploader is dependent on an old version. I'll update it.

@VintageWander
Copy link

I have the same issue as well, currently you have to monkey patch the code for now, add this somewhere in your code
Reference to the same issue: #143

// Monkey patch the Connection prototype
Connection.prototype.getRecentBlockhash = async function (commitment) {
  try {
    const { blockhash, lastValidBlockHeight } = await this.getLatestBlockhash(
      commitment
    );
    const recentPrioritizationFees = await this.getRecentPrioritizationFees();
    const averageFee =
      recentPrioritizationFees.length > 0
        ? recentPrioritizationFees.reduce(
            (sum, fee) => sum + fee.prioritizationFee,
            0
          ) / recentPrioritizationFees.length
        : 5000;

    return {
      blockhash,
      feeCalculator: {
        lamportsPerSignature: averageFee,
      },
    };
  } catch (e) {
    throw new Error("failed to get recent blockhash: " + e);
  }
};

@blockiosaurus
Copy link
Contributor

This should be patched in the newest beta release. A full release will go out this week.
https://www.npmjs.com/package/@metaplex-foundation/umi-uploader-irys/v/0.10.0-beta.0

@BenoistP
Copy link
Author

Thanks you all guys, awesome support !

BenoistP added a commit to Solana-Turing-Groupe14/solana-nextjs-starter-alyra-turing-grp-14 that referenced this issue Aug 26, 2024
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

3 participants