Skip to content

Commit 83c3f13

Browse files
authored
Merge branch 'master' into nhussein11/fix-faq
2 parents 783c94f + 7bf160a commit 83c3f13

File tree

3 files changed

+83
-7
lines changed

3 files changed

+83
-7
lines changed

develop/smart-contracts/faqs.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ Choose a parachain if:
3838

3939
### What's the difference between Polkadot Hub smart contracts and other EVM chains?
4040

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:
4242

4343
- **Performance**: RISC-V register-based architecture vs. stack-based EVM.
4444
- **Resource metering**: Three dimensions (`ref_time`, `proof_size`, `storage_deposit`) vs. single gas metric.
@@ -94,7 +94,7 @@ PolkaVM deployment differs from EVM:
9494
- _Two-step process_: Upload code, then instantiate contracts.
9595
- _Runtime code generation_ is not supported.
9696

97-
### What Solidity features are not supported?
97+
### Which Solidity features are not supported?
9898

9999
Limited support for:
100100

@@ -146,10 +146,10 @@ PolkaVM uses dynamic gas scaling:
146146
- Don't hardcode gas values—use flexible calculations.
147147
- Cross-contract calls ignore gas limits—implement proper access controls.
148148

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?
150150

151151
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.
152152

153153
### I found a bug, where can I log it?
154154

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.

llms.txt

Lines changed: 41 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7651,7 +7651,7 @@ Choose a parachain if:
76517651

76527652
### What's the difference between Polkadot Hub smart contracts and other EVM chains?
76537653

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:
76557655

76567656
- **Performance**: RISC-V register-based architecture vs. stack-based EVM.
76577657
- **Resource metering**: Three dimensions (`ref_time`, `proof_size`, `storage_deposit`) vs. single gas metric.
@@ -7707,7 +7707,7 @@ PolkaVM deployment differs from EVM:
77077707
- _Two-step process_: Upload code, then instantiate contracts.
77087708
- _Runtime code generation_ is not supported.
77097709

7710-
### What Solidity features are not supported?
7710+
### Which Solidity features are not supported?
77117711

77127712
Limited support for:
77137713

@@ -7759,7 +7759,7 @@ PolkaVM uses dynamic gas scaling:
77597759
- Don't hardcode gas values—use flexible calculations.
77607760
- Cross-contract calls ignore gas limits—implement proper access controls.
77617761

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?
77637763

77647764
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.
77657765

@@ -23002,6 +23002,44 @@ Once a block author selects transactions from the pool, the transactions are exe
2300223002

2300323003
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.
2300423004

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 |
23032+
|-------|----------------|------|-----------|-------|---------------------|-------------------------------|
23033+
| 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+
2300523043
## Additional Resources
2300623044

2300723045
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.

polkadot-protocol/parachain-basics/blocks-transactions-fees/transactions.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,44 @@ Once a block author selects transactions from the pool, the transactions are exe
210210

211211
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.
212212

213+
## Transaction Mortality
214+
215+
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.
216+
217+
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.
218+
219+
- **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.
220+
221+
- **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.
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+
## Unique Identifiers for Extrinsics
228+
229+
Transaction hashes are **not unique identifiers** in Polkadot SDK-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:
238+
239+
| Block | Extrinsic Index | Hash | Origin | Nonce | Call | Result |
240+
|-------|----------------|------|-----------|-------|---------------------|-------------------------------|
241+
| 100 | 0 | 0x01 | Account A | 0 | Transfer 5 DOT to B | Account A reaped |
242+
| 150 | 5 | 0x02 | Account B | 4 | Transfer 7 DOT to A | Account A created (nonce = 0) |
243+
| 200 | 2 | 0x01 | Account A | 0 | Transfer 5 DOT to B | Successful transaction |
244+
245+
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 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.
248+
249+
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.
250+
213251
## Additional Resources
214252

215253
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

Comments
 (0)