user2853: Is it correct that the length of a Plutus time slot is one second?
I recall that at one point it was twenty seconds, but I understand that that is no longer the case. Where in the Plutus codebase can I find the answer?
Is this the code?: https://github.com/input-output-hk/plutus/blob/2c8161ad142f56b14611cc0f66b0a2803016fe37/plutus-ledger/src/Ledger/TimeSlot.hs#L58

user1894: According to the official documentation a time slot is one second.

The Cardano blockchain uses the Ouroboros Praos protocol to facilitate consensus on the chain. Ouroboros Praos divides time into epochs. Each Cardano epoch consists of a number of slots, where each slot lasts for one second. A Cardano epoch currently includes 432,000 slots (5 days). In any slot, zero or more block-producing nodes might be nominated to be the slot leader. On average, one node is expected to be nominated every 20 seconds, for a total of 21,600 nominations per epoch. If randomly elected slot leaders produce blocks, one of them will be added to the chain. Other candidate blocks will be discarded.

I think where you got the 20 seconds from was the block producer node nomination process, which is about 20 seconds on average.
TLDR; One slot = one second.
EDIT:

There is one slight complication with this, and that is that Ouroboros, the consensus protocol powering Cardano doesn’t use POSIX time, it uses slots. But Plutus uses real time, so we need to be able to convert back and forth between real time and slots. This is no problem so long as the slot time is fixed. Right now it is one second, so right now it is easy.


However, this could change in the future. There could be a hard fork with some parameter change that would change the slot time. We can’t know that in advance. We don’t know what the slot length will be in ten years, for example.

EDIT TLDR; One slot = one second. For now.

2853: <p>Is it correct that the length of a Plutus time slot is one second?
I recall that at one point it was twenty seconds, but I understand that that is no longer the case. Where in the Plutus codebase can I find the answer?</p>
<p>Is this the code?: <a href="https://github.com/input-output-hk/plutus/blob/2c8161ad142f56b14611cc0f66b0a2803016fe37/plutus-ledger/src/Ledger/TimeSlot.hs#L58" rel="noreferrer">https://github.com/input-output-hk/plutus/blob/2c8161ad142f56b14611cc0f66b0a2803016fe37/plutus-ledger/src/Ledger/TimeSlot.hs#L58</a></p>
 1894: <p>According to the <a href="https://docs.cardano.org/new-to-cardano/cardano-nodes#howdoesitwork?" rel="nofollow noreferrer">official documentation</a> a time slot is one second.</p>
<blockquote>
<p>The Cardano blockchain uses the Ouroboros Praos protocol to facilitate consensus on the chain. Ouroboros Praos divides time into epochs. Each Cardano epoch consists of a number of slots, where each slot lasts for one second. A Cardano epoch currently includes 432,000 slots (5 days). In any slot, zero or more block-producing nodes might be nominated to be the slot leader. On average, one node is expected to be nominated every 20 seconds, for a total of 21,600 nominations per epoch. If randomly elected slot leaders produce blocks, one of them will be added to the chain. Other candidate blocks will be discarded.</p>
</blockquote>
<p>I think where you got the 20 seconds from was the block producer node nomination process, which is about 20 seconds on average.</p>
<p>TLDR; One slot = one second.</p>
<p>EDIT:</p>
<blockquote>
<p>There is one slight complication with this, and that is that Ouroboros, the consensus protocol powering Cardano doesn’t use POSIX time, it uses slots. But Plutus uses real time, so we need to be able to convert back and forth between real time and slots. This is no problem so long as the slot time is fixed. Right now it is one second, so right now it is easy.</p>
</blockquote>
<blockquote>
<p>However, this could change in the future. There could be a hard fork with some parameter change that would change the slot time. We can’t know that in advance. We don’t know what the slot length will be in ten years, for example.</p>
</blockquote>
<p>EDIT TLDR; One slot = one second. For now.</p>
