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

fix(protocol): fix tests in pnpm test:genesis #14716

Closed
davidtaikocha opened this issue Sep 19, 2023 · 4 comments · Fixed by #14813
Closed

fix(protocol): fix tests in pnpm test:genesis #14716

davidtaikocha opened this issue Sep 19, 2023 · 4 comments · Fixed by #14813
Assignees

Comments

@davidtaikocha
Copy link
Member

image
@dantaik
Copy link
Contributor

dantaik commented Sep 25, 2023

@davidtaikocha I see a different error on branch contestable-zkrollup. Could you fix it?

➜  protocol git:(main) pnpm test:genesis

> @taiko/[email protected] test:genesis /Users/d/Projects/taiko/taiko-mono/packages/protocol
> ./genesis/generate_genesis.test.sh

Starting generate_genesis tests...

> @taiko/[email protected] compile /Users/d/Projects/taiko/taiko-mono/packages/protocol
> forge build

[⠊] Compiling...
[⠢] Compiling 169 files with 0.8.20
[⠒] Solc 0.8.20 finished in 16.94s
Compiler run successful!

> @taiko/[email protected] generate:genesis /Users/d/Projects/taiko/taiko-mono/packages/protocol
> ts-node ./utils/generate_genesis/main.ts "/Users/d/Projects/taiko/taiko-mono/packages/protocol/genesis/test_config.json"

config: {
  contractOwner: '0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266',
  contractAdmin: '0x70997970C51812dc3A010C7d01b50e0d17dc79C8',
  chainId: 167,
  seedAccounts: [
    { '0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266': 1024 },
    { '0x70997970C51812dc3A010C7d01b50e0d17dc79C8': 1024 },
    { '0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC': 1024 },
    { '0x90F79bf6EB2c4f870365E785982E1f101E93b906': 1024 },
    { '0x15d34AAf54267DB7D7c367839AAf71A00a2C6A65': 1024 },
    { '0x9965507D1a55bcC2695C58ba16FB37d819B0A4dc': 1024 },
    { '0x976EA74026E726554dB657fA54763abd0C3a0aa9': 1024 },
    { '0x14dC79964da2C08b23698B3D3cc7Ca32193d9955': 1024 },
    { '0x23618e81E3f5cdF7f54C3d65f7FBc0aBf5B21E8f': 1024 },
    { '0xa0Ee7A142d267C1f36714E4a8F75612F20a79720': 1024 },
    { '0xBcd4042DE499D14e55001CcbB24a551F3b954096': 1024 },
    { '0x71bE63f3384f5fb98995898A86B02Fb2426c5788': 1024 },
    { '0xFABB0ac9d68B0B445fB7357272Ff202C5651694a': 1024 },
    { '0x1CBd3b2770909D4e10f157cABC84C7264073C9Ec': 1024 },
    { '0xdF3e18d64BC6A983f673Ab319CCaE4f1a57C7097': 1024 },
    { '0xcd3B766CCDd6AE721141F452C550Ca635964ce71': 1024 },
    { '0x2546BcD3c84621e976D8185a91A922aE77ECEc30': 1024 },
    { '0xbDA5747bFD65F08deb54cb465eB87D40e51B197E': 1024 },
    { '0xdD2FD4581271e230360230F9337D5c0430Bf44C0': 1024 },
    { '0x8626f6940E2eb28930eFb4CeF49B2d1F2C9C1199': 1024 },
    [length]: 20
  ],
  contractAddresses: {
    ProxiedTaikoL2: '0x0000777700000000000000000000000000000001',
    ProxiedERC20Vault: '0x0000777700000000000000000000000000000002',
    ProxiedEtherVault: '0x0000777700000000000000000000000000000003',
    ProxiedBridge: '0x0000777700000000000000000000000000000004',
    RegularERC20: '0x0000777700000000000000000000000000000005',
    ProxiedAddressManager: '0x0000777700000000000000000000000000000006',
    ProxiedSignalService: '0x0000777700000000000000000000000000000007',
    ProxiedERC721Vault: '0x0000777700000000000000000000000000000008',
    ProxiedERC1155Vault: '0x0000777700000000000000000000000000000009',
    TaikoL2Proxy: '0x1000777700000000000000000000000000000001',
    ERC20VaultProxy: '0x1000777700000000000000000000000000000002',
    EtherVaultProxy: '0x1000777700000000000000000000000000000003',
    BridgeProxy: '0x1000777700000000000000000000000000000004',
    AddressManagerProxy: '0x1000777700000000000000000000000000000006',
    SignalServiceProxy: '0x1000777700000000000000000000000000000007',
    ERC721VaultProxy: '0x1000777700000000000000000000000000000008',
    ERC1155VaultProxy: '0x1000777700000000000000000000000000000009'
  },
  param1559: {
    yscale: '1679526101464767541687441923934',
    xscale: '6977415078',
    gasIssuedPerSecond: '2666666',
    gasExcess: '9695997576'
  },
  predeployERC20: true
}
start deploy ProxiedTaikoL2 contract
seedAccountAddress: 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266
premintBalance: 1024000000000000000000
seedAccountAddress: 0x70997970C51812dc3A010C7d01b50e0d17dc79C8
premintBalance: 1024000000000000000000
seedAccountAddress: 0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC
premintBalance: 1024000000000000000000
seedAccountAddress: 0x90F79bf6EB2c4f870365E785982E1f101E93b906
premintBalance: 1024000000000000000000
seedAccountAddress: 0x15d34AAf54267DB7D7c367839AAf71A00a2C6A65
premintBalance: 1024000000000000000000
seedAccountAddress: 0x9965507D1a55bcC2695C58ba16FB37d819B0A4dc
premintBalance: 1024000000000000000000
seedAccountAddress: 0x976EA74026E726554dB657fA54763abd0C3a0aa9
premintBalance: 1024000000000000000000
seedAccountAddress: 0x14dC79964da2C08b23698B3D3cc7Ca32193d9955
premintBalance: 1024000000000000000000
seedAccountAddress: 0x23618e81E3f5cdF7f54C3d65f7FBc0aBf5B21E8f
premintBalance: 1024000000000000000000
seedAccountAddress: 0xa0Ee7A142d267C1f36714E4a8F75612F20a79720
premintBalance: 1024000000000000000000
seedAccountAddress: 0xBcd4042DE499D14e55001CcbB24a551F3b954096
premintBalance: 1024000000000000000000
seedAccountAddress: 0x71bE63f3384f5fb98995898A86B02Fb2426c5788
premintBalance: 1024000000000000000000
seedAccountAddress: 0xFABB0ac9d68B0B445fB7357272Ff202C5651694a
premintBalance: 1024000000000000000000
seedAccountAddress: 0x1CBd3b2770909D4e10f157cABC84C7264073C9Ec
premintBalance: 1024000000000000000000
seedAccountAddress: 0xdF3e18d64BC6A983f673Ab319CCaE4f1a57C7097
premintBalance: 1024000000000000000000
seedAccountAddress: 0xcd3B766CCDd6AE721141F452C550Ca635964ce71
premintBalance: 1024000000000000000000
seedAccountAddress: 0x2546BcD3c84621e976D8185a91A922aE77ECEc30
premintBalance: 1024000000000000000000
seedAccountAddress: 0xbDA5747bFD65F08deb54cb465eB87D40e51B197E
premintBalance: 1024000000000000000000
seedAccountAddress: 0xdD2FD4581271e230360230F9337D5c0430Bf44C0
premintBalance: 1024000000000000000000
seedAccountAddress: 0x8626f6940E2eb28930eFb4CeF49B2d1F2C9C1199
premintBalance: 1024000000000000000000
{
  etherVaultBalance: BigNumber {
    _hex: '0xfffffffffffffba9c6e7dbb0bfffffff',
    _isBigNumber: true
  }
}


pre-computed addresses:
{
  LibTrieProof: '0x380ac40E71560dea56Dfa29a4972358389c831B8',
  LibBridgeRetry: '0x27b16538FBC472024B19884eD54a78299078a9C8',
  LibBridgeProcess: '0xE34dAe62DAeCFc80dF0015f40B85636Cb81ccf1A',
  LibVaultUtils: '0x0351D6b4C35A2119F84A597DEA1d89DD8bFf7b8b',
  ProxiedAddressManager: '0x0000777700000000000000000000000000000006',
  ProxiedTaikoL2: '0x0000777700000000000000000000000000000001',
  ProxiedBridge: '0x0000777700000000000000000000000000000004',
  ProxiedERC20Vault: '0x0000777700000000000000000000000000000002',
  ProxiedERC721Vault: '0x0000777700000000000000000000000000000008',
  ProxiedERC1155Vault: '0x0000777700000000000000000000000000000009',
  ProxiedEtherVault: '0x0000777700000000000000000000000000000003',
  ProxiedSignalService: '0x0000777700000000000000000000000000000007',
  TaikoL2Proxy: '0x1000777700000000000000000000000000000001',
  BridgeProxy: '0x1000777700000000000000000000000000000004',
  ERC20VaultProxy: '0x1000777700000000000000000000000000000002',
  ERC721VaultProxy: '0x1000777700000000000000000000000000000008',
  ERC1155VaultProxy: '0x1000777700000000000000000000000000000009',
  EtherVaultProxy: '0x1000777700000000000000000000000000000003',
  SignalServiceProxy: '0x1000777700000000000000000000000000000007',
  AddressManagerProxy: '0x1000777700000000000000000000000000000006'
}
generating genesis.alloc for LibTrieProof
HardhatError: HH700: Artifact for contract "LibTrieProof" not found.
    at Artifacts._handleWrongArtifactForContractName (/Users/d/Projects/taiko/taiko-mono/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/hardhat/src/internal/artifacts.ts:733:11)
    at Artifacts._getArtifactPathFromFiles (/Users/d/Projects/taiko/taiko-mono/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/hardhat/src/internal/artifacts.ts:864:19)
    at Artifacts._getArtifactPathSync (/Users/d/Projects/taiko/taiko-mono/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/hardhat/src/internal/artifacts.ts:600:21)
    at Artifacts.readArtifactSync (/Users/d/Projects/taiko/taiko-mono/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/hardhat/src/internal/artifacts.ts:76:31)
    at getStorageLayout (/Users/d/Projects/taiko/taiko-mono/node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected]__fjok5qcxs3xayufgz7rmdb2fwq/node_modules/@defi-wonderland/smock/src/utils/storage.ts:73:56)
    at deployTaikoL2 (/Users/d/Projects/taiko/taiko-mono/packages/protocol/utils/generate_genesis/taikoL2.ts:81:46)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async main (/Users/d/Projects/taiko/taiko-mono/packages/protocol/utils/generate_genesis/main.ts:50:18)
cat: /Users/d/Projects/taiko/taiko-mono/packages/protocol/genesis/../deployments/genesis_alloc.json: No such file or directory
 ELIFECYCLE  Command failed with exit code 1.

@adaki2004
Copy link
Contributor

adaki2004 commented Sep 25, 2023

@dantaik pnpm compile && pnpm compile:hardhat && pnpm test:genesis i think - (as David sent this to me earlier last week)

@davidtaikocha
Copy link
Member Author

@davidtaikocha I see a different error. Could you fix it?

➜  protocol git:(main) pnpm test:genesis

> @taiko/[email protected] test:genesis /Users/d/Projects/taiko/taiko-mono/packages/protocol
> ./genesis/generate_genesis.test.sh

Starting generate_genesis tests...

> @taiko/[email protected] compile /Users/d/Projects/taiko/taiko-mono/packages/protocol
> forge build

[⠊] Compiling...
[⠢] Compiling 169 files with 0.8.20
[⠒] Solc 0.8.20 finished in 16.94s
Compiler run successful!

> @taiko/[email protected] generate:genesis /Users/d/Projects/taiko/taiko-mono/packages/protocol
> ts-node ./utils/generate_genesis/main.ts "/Users/d/Projects/taiko/taiko-mono/packages/protocol/genesis/test_config.json"

config: {
  contractOwner: '0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266',
  contractAdmin: '0x70997970C51812dc3A010C7d01b50e0d17dc79C8',
  chainId: 167,
  seedAccounts: [
    { '0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266': 1024 },
    { '0x70997970C51812dc3A010C7d01b50e0d17dc79C8': 1024 },
    { '0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC': 1024 },
    { '0x90F79bf6EB2c4f870365E785982E1f101E93b906': 1024 },
    { '0x15d34AAf54267DB7D7c367839AAf71A00a2C6A65': 1024 },
    { '0x9965507D1a55bcC2695C58ba16FB37d819B0A4dc': 1024 },
    { '0x976EA74026E726554dB657fA54763abd0C3a0aa9': 1024 },
    { '0x14dC79964da2C08b23698B3D3cc7Ca32193d9955': 1024 },
    { '0x23618e81E3f5cdF7f54C3d65f7FBc0aBf5B21E8f': 1024 },
    { '0xa0Ee7A142d267C1f36714E4a8F75612F20a79720': 1024 },
    { '0xBcd4042DE499D14e55001CcbB24a551F3b954096': 1024 },
    { '0x71bE63f3384f5fb98995898A86B02Fb2426c5788': 1024 },
    { '0xFABB0ac9d68B0B445fB7357272Ff202C5651694a': 1024 },
    { '0x1CBd3b2770909D4e10f157cABC84C7264073C9Ec': 1024 },
    { '0xdF3e18d64BC6A983f673Ab319CCaE4f1a57C7097': 1024 },
    { '0xcd3B766CCDd6AE721141F452C550Ca635964ce71': 1024 },
    { '0x2546BcD3c84621e976D8185a91A922aE77ECEc30': 1024 },
    { '0xbDA5747bFD65F08deb54cb465eB87D40e51B197E': 1024 },
    { '0xdD2FD4581271e230360230F9337D5c0430Bf44C0': 1024 },
    { '0x8626f6940E2eb28930eFb4CeF49B2d1F2C9C1199': 1024 },
    [length]: 20
  ],
  contractAddresses: {
    ProxiedTaikoL2: '0x0000777700000000000000000000000000000001',
    ProxiedERC20Vault: '0x0000777700000000000000000000000000000002',
    ProxiedEtherVault: '0x0000777700000000000000000000000000000003',
    ProxiedBridge: '0x0000777700000000000000000000000000000004',
    RegularERC20: '0x0000777700000000000000000000000000000005',
    ProxiedAddressManager: '0x0000777700000000000000000000000000000006',
    ProxiedSignalService: '0x0000777700000000000000000000000000000007',
    ProxiedERC721Vault: '0x0000777700000000000000000000000000000008',
    ProxiedERC1155Vault: '0x0000777700000000000000000000000000000009',
    TaikoL2Proxy: '0x1000777700000000000000000000000000000001',
    ERC20VaultProxy: '0x1000777700000000000000000000000000000002',
    EtherVaultProxy: '0x1000777700000000000000000000000000000003',
    BridgeProxy: '0x1000777700000000000000000000000000000004',
    AddressManagerProxy: '0x1000777700000000000000000000000000000006',
    SignalServiceProxy: '0x1000777700000000000000000000000000000007',
    ERC721VaultProxy: '0x1000777700000000000000000000000000000008',
    ERC1155VaultProxy: '0x1000777700000000000000000000000000000009'
  },
  param1559: {
    yscale: '1679526101464767541687441923934',
    xscale: '6977415078',
    gasIssuedPerSecond: '2666666',
    gasExcess: '9695997576'
  },
  predeployERC20: true
}
start deploy ProxiedTaikoL2 contract
seedAccountAddress: 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266
premintBalance: 1024000000000000000000
seedAccountAddress: 0x70997970C51812dc3A010C7d01b50e0d17dc79C8
premintBalance: 1024000000000000000000
seedAccountAddress: 0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC
premintBalance: 1024000000000000000000
seedAccountAddress: 0x90F79bf6EB2c4f870365E785982E1f101E93b906
premintBalance: 1024000000000000000000
seedAccountAddress: 0x15d34AAf54267DB7D7c367839AAf71A00a2C6A65
premintBalance: 1024000000000000000000
seedAccountAddress: 0x9965507D1a55bcC2695C58ba16FB37d819B0A4dc
premintBalance: 1024000000000000000000
seedAccountAddress: 0x976EA74026E726554dB657fA54763abd0C3a0aa9
premintBalance: 1024000000000000000000
seedAccountAddress: 0x14dC79964da2C08b23698B3D3cc7Ca32193d9955
premintBalance: 1024000000000000000000
seedAccountAddress: 0x23618e81E3f5cdF7f54C3d65f7FBc0aBf5B21E8f
premintBalance: 1024000000000000000000
seedAccountAddress: 0xa0Ee7A142d267C1f36714E4a8F75612F20a79720
premintBalance: 1024000000000000000000
seedAccountAddress: 0xBcd4042DE499D14e55001CcbB24a551F3b954096
premintBalance: 1024000000000000000000
seedAccountAddress: 0x71bE63f3384f5fb98995898A86B02Fb2426c5788
premintBalance: 1024000000000000000000
seedAccountAddress: 0xFABB0ac9d68B0B445fB7357272Ff202C5651694a
premintBalance: 1024000000000000000000
seedAccountAddress: 0x1CBd3b2770909D4e10f157cABC84C7264073C9Ec
premintBalance: 1024000000000000000000
seedAccountAddress: 0xdF3e18d64BC6A983f673Ab319CCaE4f1a57C7097
premintBalance: 1024000000000000000000
seedAccountAddress: 0xcd3B766CCDd6AE721141F452C550Ca635964ce71
premintBalance: 1024000000000000000000
seedAccountAddress: 0x2546BcD3c84621e976D8185a91A922aE77ECEc30
premintBalance: 1024000000000000000000
seedAccountAddress: 0xbDA5747bFD65F08deb54cb465eB87D40e51B197E
premintBalance: 1024000000000000000000
seedAccountAddress: 0xdD2FD4581271e230360230F9337D5c0430Bf44C0
premintBalance: 1024000000000000000000
seedAccountAddress: 0x8626f6940E2eb28930eFb4CeF49B2d1F2C9C1199
premintBalance: 1024000000000000000000
{
  etherVaultBalance: BigNumber {
    _hex: '0xfffffffffffffba9c6e7dbb0bfffffff',
    _isBigNumber: true
  }
}


pre-computed addresses:
{
  LibTrieProof: '0x380ac40E71560dea56Dfa29a4972358389c831B8',
  LibBridgeRetry: '0x27b16538FBC472024B19884eD54a78299078a9C8',
  LibBridgeProcess: '0xE34dAe62DAeCFc80dF0015f40B85636Cb81ccf1A',
  LibVaultUtils: '0x0351D6b4C35A2119F84A597DEA1d89DD8bFf7b8b',
  ProxiedAddressManager: '0x0000777700000000000000000000000000000006',
  ProxiedTaikoL2: '0x0000777700000000000000000000000000000001',
  ProxiedBridge: '0x0000777700000000000000000000000000000004',
  ProxiedERC20Vault: '0x0000777700000000000000000000000000000002',
  ProxiedERC721Vault: '0x0000777700000000000000000000000000000008',
  ProxiedERC1155Vault: '0x0000777700000000000000000000000000000009',
  ProxiedEtherVault: '0x0000777700000000000000000000000000000003',
  ProxiedSignalService: '0x0000777700000000000000000000000000000007',
  TaikoL2Proxy: '0x1000777700000000000000000000000000000001',
  BridgeProxy: '0x1000777700000000000000000000000000000004',
  ERC20VaultProxy: '0x1000777700000000000000000000000000000002',
  ERC721VaultProxy: '0x1000777700000000000000000000000000000008',
  ERC1155VaultProxy: '0x1000777700000000000000000000000000000009',
  EtherVaultProxy: '0x1000777700000000000000000000000000000003',
  SignalServiceProxy: '0x1000777700000000000000000000000000000007',
  AddressManagerProxy: '0x1000777700000000000000000000000000000006'
}
generating genesis.alloc for LibTrieProof
HardhatError: HH700: Artifact for contract "LibTrieProof" not found.
    at Artifacts._handleWrongArtifactForContractName (/Users/d/Projects/taiko/taiko-mono/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/hardhat/src/internal/artifacts.ts:733:11)
    at Artifacts._getArtifactPathFromFiles (/Users/d/Projects/taiko/taiko-mono/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/hardhat/src/internal/artifacts.ts:864:19)
    at Artifacts._getArtifactPathSync (/Users/d/Projects/taiko/taiko-mono/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/hardhat/src/internal/artifacts.ts:600:21)
    at Artifacts.readArtifactSync (/Users/d/Projects/taiko/taiko-mono/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/hardhat/src/internal/artifacts.ts:76:31)
    at getStorageLayout (/Users/d/Projects/taiko/taiko-mono/node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected]__fjok5qcxs3xayufgz7rmdb2fwq/node_modules/@defi-wonderland/smock/src/utils/storage.ts:73:56)
    at deployTaikoL2 (/Users/d/Projects/taiko/taiko-mono/packages/protocol/utils/generate_genesis/taikoL2.ts:81:46)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async main (/Users/d/Projects/taiko/taiko-mono/packages/protocol/utils/generate_genesis/main.ts:50:18)
cat: /Users/d/Projects/taiko/taiko-mono/packages/protocol/genesis/../deployments/genesis_alloc.json: No such file or directory
 ELIFECYCLE  Command failed with exit code 1.

I guess its because the hardhat artifacts are out-dated since right now the L2 genesis generation still needs the hardhat complier, since its using smock library to get the storage layout and fill them. so i guess pnpm compile && pnpm compile:hardhat && pnpm test:genesis command will fix that issue, can give a try

@adaki2004
Copy link
Contributor

@davidtaikocha davidtaikocha linked a pull request Sep 25, 2023 that will close this issue
@github-project-automation github-project-automation bot moved this from 📝 Todo to ✅ Done in Taiko Project Board Sep 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants