# Issue with 0x2::poseidon::poseidon\_bn254\_internal Failing on Chain but Passing Locally

**URL:** <https://forums.sui.io/t/issue-with-0x2-poseidon-bn254-internal-failing-on-chain-but-passing-locally/47742>\
**Category:** Move\
**Tags:** sui, testnet\
**Created:** [March 20, 2025, 11:19am UTC](https://forums.sui.io/t/issue-with-0x2-poseidon-bn254-internal-failing-on-chain-but-passing-locally/47742 "2025-03-20T11:19:24Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![medivh\_20185](https://dub1.discourse-cdn.com/sui/user_avatar/forums.sui.io/medivh_20185/32/31276_2.png) [@medivh\_20185](https://forums.sui.io/u/medivh_20185)\
**Post date:** [March 20, 2025, 11:19am UTC](https://forums.sui.io/t/issue-with-0x2-poseidon-bn254-internal-failing-on-chain-but-passing-locally/47742/1 "2025-03-20T11:19:24Z")

</div>

I’m encountering an issue when publishing a Move contract on the Sui network (Testnet). The error occurs in the function 0x2::poseidon::poseidon\_bn254\_internal, with the following message:

```auto
st command aborted within function '0x0000000000000000000000000000000000000000000000000000000000000002::poseidon::poseidon_bn254_internal' at instruction 0 with code 1

```

Here’s the context:

- Local Testing: The contract builds and tests successfully locally using sui move build and sui move test. No errors or warnings.

- On-Chain: When I run sui client publish --gas-budget 100000000, it fails with the above error.

I’m wondering if anyone has successfully used 0x2::poseidon::poseidon\_bn254\_internal on-chain (e.g., Testnet or Devnet)? Could this be related to stricter parameter validation on-chain, a version mismatch with the standard library, or something else?

For reference:

- Sui CLI version: 1.45.1

- Network: Testnet

- My contract calls poseidon\_bn254\_internal with a vector input (e.g., 32 bytes), and it works fine locally.

Any insights or suggestions would be greatly appreciated! If needed, I can share more details about my contract code or the full error log.

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![alanvu](https://avatars.discourse-cdn.com/v4/letter/a/73ab20/32.png) [@alanvu](https://forums.sui.io/u/alanvu)\
**Post date:** [March 22, 2025, 6:45am UTC](https://forums.sui.io/t/issue-with-0x2-poseidon-bn254-internal-failing-on-chain-but-passing-locally/47742/2 "2025-03-22T06:45:54Z")

</div>

I think the Poseidon hash function is only available in Sui Devnet.  
In the protocol config file

```auto
       if chain != Chain::Mainnet && chain != Chain::Testnet {
                        cfg.feature_flags.enable_poseidon = true;
                        cfg.poseidon_bn254_cost_base = Some(260);
                        cfg.poseidon_bn254_cost_per_block = Some(10);
                    }

```

Details in this file: crates/sui-protocol-config/src/lib.rs line 2734, MystenLabs/sui Github repo.

---

<div class="post-metadata">

**Author:** ![medivh\_20185](https://dub1.discourse-cdn.com/sui/user_avatar/forums.sui.io/medivh_20185/32/31276_2.png) [@medivh\_20185](https://forums.sui.io/u/medivh_20185)\
**Post date:** [March 24, 2025, 2:09am UTC](https://forums.sui.io/t/issue-with-0x2-poseidon-bn254-internal-failing-on-chain-but-passing-locally/47742/3 "2025-03-24T02:09:49Z")

</div>

Thank you for your answer, but why is such an important explanation not mentioned in the document? Also, when will this feature be available on the mainnet? Where can I get relevant information?

---

<div class="post-metadata">

**Author:** ![alanvu](https://avatars.discourse-cdn.com/v4/letter/a/73ab20/32.png) [@alanvu](https://forums.sui.io/u/alanvu)\
**Post date:** [March 27, 2025, 6:57am UTC](https://forums.sui.io/t/issue-with-0x2-poseidon-bn254-internal-failing-on-chain-but-passing-locally/47742/4 "2025-03-27T06:57:53Z")

</div>

I don’t know, either! 😅
