> Aztec.nr API reference, v6.0.0 (mainnet and testnet). Index: https://docs.aztec.network/aztec-nr-api/v6.0.0/llms.txt

# Function allow_phase_change

Module: `noir_aztec::macros::functions`

```rust
pub comptime fn allow_phase_change(f: FunctionDefinition)
```

An `allow_phase_change` function will allow transitioning from the non-revertible to the revertible phase during its execution.

This is an advanced feature that is typically only required for account contract entrypoints that handle transaction fee payment.

## Note Retrieval

When notes are read e.g. via [`crate::note::note_getter::get_notes`](/aztec-nr-api/v6.0.0/noir_aztec/note/note_getter/fn.get_notes.md), a [`ConfirmedNote`](/aztec-nr-api/v6.0.0/noir_aztec/note/struct.ConfirmedNote.md) value is returned which includes note metadata, notably whether the note was created in a previous transaction (a settled note) or in the current one (a pending note), either in the current or previous phase. Because `allow_phase_change` functions can change phases, this metadata can be left stale, e.g. it is possible to read a pending current phase note and then change phases, resulting in the note being `PENDING_PREVIOUS_PHASE` instead.

Such a note would be rejected by the kernels if it was tried to be nullified, as the metadata is incorrect. It is therefore important to not allow [`ConfirmedNote`](/aztec-nr-api/v6.0.0/noir_aztec/note/struct.ConfirmedNote.md), [`HintedNote`](/aztec-nr-api/v6.0.0/noir_aztec/note/struct.HintedNote.md) or [`NoteMetadata`](/aztec-nr-api/v6.0.0/noir_aztec/note/note_metadata/struct.NoteMetadata.md) values to cross the phase barrier caused by [`crate::context::PrivateContext::end_setup`](/aztec-nr-api/v6.0.0/noir_aztec/context/struct.PrivateContext.md#end_setup).
