Compiler error: Stack too deep

https://ethereum.stackexchange.com/questions/144949/compiler-error-stack-too-deep

I am getting this error when trying to deploy my smart contract using zkSync but on a different chain (Polygon Mumbai):

CompilerError: Stack too deep. Try compiling with `--via-ir` (cli) or the equivalent `viaIR: true` (standard JSON) while enabling the optimizer. Otherwise, try removing local variables.
   --> @matterlabs/zksync-contracts/l2/system-contracts/BootloaderUtilities.sol:103:34:
    |
103 |             uint256 listLength = encodedNonce.length +
    |                                  ^^^^^^^^^^^^
Error HH600: Compilation failed

This are all my files:

hardhat.config.ts

import "@matterlabs/hardhat-zksync-deploy";
import "@matterlabs/hardhat-zksync-solc";
const { pk } = require('./.secrets.json');
module.exports = {
  zksolc: {
    version: "1.3.1",
    compilerSource: "binary",
    settings: {},
  },
  defaultNetwork: "zkSyncTestnet",
  networks: {
    zkSyncTestnet: {
      url: "https://zksync2-testnet.zksync.dev",
      ethNetwork: "goerli", // Can also be the RPC URL of the network (e.g. `https://goerli.infura.io/v3/<API_KEY>`)
      zksync: true,
      accounts: [pk]
    },
    mumbai: {
      url: "https://matic-mumbai.chainstacklabs.com/",
      chainId: 80001,
      gasPrice: "auto",
      accounts: [pk],
      zksync: false
    }
  },
  solidity: {
    version: "0.8.17",
    settings: {
      optimizer: {
        enabled: true,
        runs: 200,
      },
    },
  },
};

Greeter.sol

//SPDX-License-Identifier: Unlicense
pragma solidity ^0.8.0;
contract Greeter {
    string private greeting;
    constructor(string memory _greeting) {
        greeting = _greeting;
    }
    function greet() public view returns (string memory) {
        return greeting;
    }
    function setGreeting(string memory _greeting) public {
        greeting = _greeting;
    }
}

deploy.ts

import { Wallet } from "zksync-web3";
import { HardhatRuntimeEnvironment } from "hardhat/types";
import { Deployer } from "@matterlabs/hardhat-zksync-deploy";
import { pk } from "../.secrets.json";
// An example of a deploy script that will deploy and call a simple contract.
export default async function (hre: HardhatRuntimeEnvironment) {
  console.log(`Running deploy script for the Greeter contract`);
  // Initialize the wallet.
  const wallet = new Wallet(pk);
  // Create deployer object and load the artifact of the contract you want to deploy.
  const deployer = new Deployer(hre, wallet);
  const artifact = await deployer.loadArtifact("Greeter");
  // Estimate contract deployment fee
  const greeting = "Hi there!";
  //const deploymentFee = await deployer.estimateDeployFee(artifact, [greeting]);
  const greeterContract = await deployer.deploy(artifact, [greeting]);
  //obtain the Constructor Arguments
  console.log("constructor args:" + greeterContract.interface.encodeDeploy([greeting]));
  // Show the contract info.
  const contractAddress = greeterContract.address;
  console.log(`${artifact.contractName} was deployed to ${contractAddress}`);
}

What is the format of the private key required to deploy using deploy-zksync?

https://ethereum.stackexchange.com/questions/144875/what-is-the-format-of-the-private-key-required-to-deploy-using-deploy-zksync

I am trying to deploy a very basic smart contract using zkSync. This is the code, from they docs:

deploy.ts

import { Wallet, utils } from "zksync-web3";
import * as ethers from "ethers";
import { HardhatRuntimeEnvironment } from "hardhat/types";
import { Deployer } from "@matterlabs/hardhat-zksync-deploy";
import { mnemonic } from "../.secrets.json";
// An example of a deploy script that will deploy and call a simple contract.
export default async function (hre: HardhatRuntimeEnvironment) {
  console.log(`Running deploy script for the Greeter contract`);
  // Initialize the wallet.
  const wallet = new Wallet("<WALLET-PRIVATE-KEY>");
  // Create deployer object and load the artifact of the contract you want to deploy.
  const deployer = new Deployer(hre, wallet);
  const artifact = await deployer.loadArtifact("Greeter");
  // Estimate contract deployment fee
  const greeting = "Hi there!";
  const deploymentFee = await deployer.estimateDeployFee(artifact, [greeting]);
  // OPTIONAL: Deposit funds to L2
  // Comment this block if you already have funds on zkSync.
  const depositHandle = await deployer.zkWallet.deposit({
    to: deployer.zkWallet.address,
    token: utils.ETH_ADDRESS,
    amount: deploymentFee.mul(2),
  });
  // Wait until the deposit is processed on zkSync
  await depositHandle.wait();
  // Deploy this contract. The returned object will be of a `Contract` type, similarly to ones in `ethers`.
  // `greeting` is an argument for contract constructor.
  const parsedFee = ethers.utils.formatEther(deploymentFee.toString());
  console.log(`The deployment is estimated to cost ${parsedFee} ETH`);
  const greeterContract = await deployer.deploy(artifact, [greeting]);
  //obtain the Constructor Arguments
  console.log("constructor args:" + greeterContract.interface.encodeDeploy([greeting]));
  // Show the contract info.
  const contractAddress = greeterContract.address;
  console.log(`${artifact.contractName} was deployed to ${contractAddress}`);
}

They say to replace "<WALLET-PRIVATE-KEY>" with the private key of the wallet I want to use for development.

What is the format I should use for that PK?

If I use the mnemonic I get this error:

Error: invalid hexlify value (argument="value", value="xyz", code=INVALID_ARGUMENT, version=bytes/5.7.0)

If I use the private key you get from metamask, I get this error:

Error: Bytecode length in 32-byte words must be odd

What is it the actual format of this PK?

Is it possible to use zkSync in Polygon Mumbai?

https://ethereum.stackexchange.com/questions/144874/is-it-possible-to-use-zksync-in-polygon-mumbai

I am setting up a project using zkSync and I am seeing that, in the hardhat.config.ts file, the supported network is zkSyncTestnet.

hardhat.config.ts

import "@matterlabs/hardhat-zksync-deploy";
    import "@matterlabs/hardhat-zksync-solc";
    
    module.exports = {
      zksolc: {
        version: "1.3.1",
        compilerSource: "binary",
        settings: {},
      },
      defaultNetwork: "zkSyncTestnet",
    
      networks: {
        zkSyncTestnet: {
          url: "https://zksync2-testnet.zksync.dev",
          ethNetwork: "goerli", // Can also be the RPC URL of the network (e.g. `https://goerli.infura.io/v3/<API_KEY>`)
          zksync: true,
        },
      },
      solidity: {
        version: "0.8.17",
      },
    };

Is it possible to use Polygon Mumbai for this?