You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: develop/smart-contracts/faqs.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -38,7 +38,7 @@ Choose a parachain if:
38
38
39
39
### What's the difference between Polkadot Hub smart contracts and other EVM chains?
40
40
41
-
Polkadot Hub uses [PolkaVM](/polkadot-protocol/smart-contract-basics/polkavm-design){target=\_blank} instead of traditional EVM:
41
+
Polkadot Hub contracts run on [PolkaVM](/polkadot-protocol/smart-contract-basics/polkavm-design){target=\_blank} instead of EVM:
42
42
43
43
-**Performance**: RISC-V register-based architecture vs. stack-based EVM.
44
44
-**Resource metering**: Three dimensions (`ref_time`, `proof_size`, `storage_deposit`) vs. single gas metric.
@@ -94,7 +94,7 @@ PolkaVM deployment differs from EVM:
94
94
-_Two-step process_: Upload code, then instantiate contracts.
95
95
-_Runtime code generation_ is not supported.
96
96
97
-
### What Solidity features are not supported?
97
+
### Which Solidity features are not supported?
98
98
99
99
Limited support for:
100
100
@@ -146,10 +146,10 @@ PolkaVM uses dynamic gas scaling:
146
146
- Don't hardcode gas values—use flexible calculations.
147
147
- Cross-contract calls ignore gas limits—implement proper access controls.
148
148
149
-
### I deployed a contract with metamask, and got a `code size` error - why?
149
+
### I deployed a contract with MetaMask, and got a `code size` error - why?
150
150
151
151
The latest MetaMask update affects the extension’s ability to deploy large contracts. Check the [Wallets](/develop/smart-contracts/wallets){target=\_blank} page for more details.
152
152
153
153
### I found a bug, where can I log it?
154
154
155
-
Please log any bugs in the [`contracts-issues`](https://github.com/paritytech/contract-issues/issues){target=\_blank} repository so developers are aware of them and can address them.
155
+
Please log any bugs in the [`contracts-issues`](https://github.com/paritytech/contract-issues/issues){target=\_blank} repository so developers are aware of them and can address them.
Copy file name to clipboardExpand all lines: llms.txt
+41-3Lines changed: 41 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -7651,7 +7651,7 @@ Choose a parachain if:
7651
7651
7652
7652
### What's the difference between Polkadot Hub smart contracts and other EVM chains?
7653
7653
7654
-
Polkadot Hub uses [PolkaVM](/polkadot-protocol/smart-contract-basics/polkavm-design){target=\_blank} instead of traditional EVM:
7654
+
Polkadot Hub contracts run on [PolkaVM](/polkadot-protocol/smart-contract-basics/polkavm-design){target=\_blank} instead of EVM:
7655
7655
7656
7656
- **Performance**: RISC-V register-based architecture vs. stack-based EVM.
7657
7657
- **Resource metering**: Three dimensions (`ref_time`, `proof_size`, `storage_deposit`) vs. single gas metric.
@@ -7707,7 +7707,7 @@ PolkaVM deployment differs from EVM:
7707
7707
- _Two-step process_: Upload code, then instantiate contracts.
7708
7708
- _Runtime code generation_ is not supported.
7709
7709
7710
-
### What Solidity features are not supported?
7710
+
### Which Solidity features are not supported?
7711
7711
7712
7712
Limited support for:
7713
7713
@@ -7759,7 +7759,7 @@ PolkaVM uses dynamic gas scaling:
7759
7759
- Don't hardcode gas values—use flexible calculations.
7760
7760
- Cross-contract calls ignore gas limits—implement proper access controls.
7761
7761
7762
-
### I deployed a contract with metamask, and got a `code size` error - why?
7762
+
### I deployed a contract with MetaMask, and got a `code size` error - why?
7763
7763
7764
7764
The latest MetaMask update affects the extension’s ability to deploy large contracts. Check the [Wallets](/develop/smart-contracts/wallets){target=\_blank} page for more details.
7765
7765
@@ -23002,6 +23002,44 @@ Once a block author selects transactions from the pool, the transactions are exe
23002
23002
23003
23003
Events are also written to storage. Runtime logic should not emit an event before performing the associated actions. If the associated transaction fails after the event was emitted, the event will not revert.
23004
23004
23005
+
## Transaction Mortality
23006
+
23007
+
Transactions in the network can be configured as either mortal (with expiration) or immortal (without expiration). Every transaction payload contains a block checkpoint (reference block number and hash) and an era/validity period that determines how many blocks after the checkpoint the transaction remains valid.
23008
+
23009
+
When a transaction is submitted, the network validates it against these parameters. If the transaction is not included in a block within the specified validity window, it is automatically removed from the transaction queue.
23010
+
23011
+
- **Mortal transactions**: have a finite lifespan and will expire after a specified number of blocks. For example, a transaction with a block checkpoint of 1000 and a validity period of 64 blocks will be valid from blocks 1000 to 1064.
23012
+
23013
+
- **Immortal transactions**: never expire and remain valid indefinitely. To create an immortal transaction, set the block checkpoint to 0 (genesis block), use the genesis hash as a reference, and set the validity period to 0.
23014
+
23015
+
However, immortal transactions pose significant security risks through replay attacks. If an account is reaped (balance drops to zero, account removed) and later re-funded, malicious actors can replay old immortal transactions.
23016
+
23017
+
The blockchain maintains only a limited number of prior block hashes for reference validation, called `BlockHashCount`. If your validity period exceeds `BlockHashCount`, the effective validity period becomes the minimum of your specified period and the block hash count.
23018
+
23019
+
## Unique Identifiers for Extrinsics
23020
+
23021
+
Transaction hashes are **not unique identifiers** in Polkadot SDK-based chains.
23022
+
23023
+
Key differences from traditional blockchains:
23024
+
23025
+
- Transaction hashes serve only as fingerprints of transaction information
23026
+
- Multiple valid transactions can share the same hash
23027
+
- Hash uniqueness assumptions lead to serious issues
23028
+
23029
+
For example, when an account is reaped (removed due to insufficient balance) and later recreated, it resets to nonce 0, allowing identical transactions to be valid at different points:
23030
+
23031
+
| Block | Extrinsic Index | Hash | Origin | Nonce | Call | Result |
| 100 | 0 | 0x01 | Account A | 0 | Transfer 5 DOT to B | Account A reaped |
23034
+
| 150 | 5 | 0x02 | Account B | 4 | Transfer 7 DOT to A | Account A created (nonce = 0) |
23035
+
| 200 | 2 | 0x01 | Account A | 0 | Transfer 5 DOT to B | Successful transaction |
23036
+
23037
+
Notice that blocks 100 and 200 contain transactions with identical hashes (0x01) but are completely different, valid operations occurring at different times.
23038
+
23039
+
Additional complexity comes from Polkadot SDK's origin abstraction. Origins can represent collectives, governance bodies, or other non-account entities that don't maintain nonces like regular accounts and might dispatch identical calls multiple times with the same hash values. Each execution occurs in different chain states with different results.
23040
+
23041
+
The correct way to uniquely identify an extrinsic on a Polkadot SDK-based chain is to use the block ID (height or hash) and the extrinsic index. Since the Polkadot SDK defines blocks as headers plus ordered arrays of extrinsics, the index position within a canonical block provides guaranteed uniqueness.
23042
+
23005
23043
## Additional Resources
23006
23044
23007
23045
For a video overview of the lifecycle of transactions and the types of transactions that exist, see the [Transaction lifecycle](https://www.youtube.com/watch?v=3pfM0GOp02c){target=\_blank} seminar from Parity Tech.
-**Immortaltransactions**:neverexpireandremainvalidindefinitely.Tocreateanimmortaltransaction, settheblockcheckpointto0 (genesisblock), use the genesis hash as a reference, and set the validity period to 0.
222
+
223
+
However, immortal transactions pose significant security risks through replay attacks.If an account is reaped (balance drops to zero, account removed) and later re-funded, malicious actors can replay old immortal transactions.
224
+
225
+
The blockchain maintains only a limited number of prior block hashes for reference validation, called `BlockHashCount`.If your validity period exceeds `BlockHashCount`, the effective validity period becomes the minimum of your specified period and the block hash count.
226
+
227
+
## UniqueIdentifiersforExtrinsics
228
+
229
+
Transaction hashes are **not unique identifiers**inPolkadotSDK-based chains.
230
+
231
+
Key differences from traditional blockchains:
232
+
233
+
-Transaction hashes serve only as fingerprints of transaction information
234
+
-Multiple valid transactions can share the same hash
235
+
-Hash uniqueness assumptions lead to serious issues
236
+
237
+
For example, when an account is reaped (removed due to insufficient balance) and later recreated, it resets to nonce 0, allowing identical transactions to be valid at different points:
Notice that blocks 100 and 200 contain transactions with identical hashes (0x01) but are completely different, valid operations occurring at different times.
246
+
247
+
Additional complexity comes from PolkadotSDK's origin abstraction.Origins can represent collectives, governance bodies, or other non-account entities that don't maintain nonces like regular accounts and might dispatch identical calls multiple times with the same hash values.Each execution occurs in different chain states with different results.
248
+
249
+
The correct way to uniquely identify an extrinsic on a PolkadotSDK-based chain is to use the block ID (height or hash) and the extrinsic index.Since the PolkadotSDK defines blocks as headers plus ordered arrays of extrinsics, the index position within a canonical block provides guaranteed uniqueness.
250
+
213
251
## AdditionalResources
214
252
215
253
For a video overview of the lifecycle of transactions and the types of transactions that exist, see the [Transaction lifecycle](https://www.youtube.com/watch?v=3pfM0GOp02c){target=\_blank} seminar from Parity Tech.
0 commit comments