Skip to content

Commit 4482133

Browse files
author
John Ky
committed
Restructure to conform with ADR-0
1 parent 6b2d51f commit 4482133

File tree

1 file changed

+14
-13
lines changed

1 file changed

+14
-13
lines changed

docs/ADR-004-Support-only-for-mainnet-and-upcoming-eras.md

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,10 @@ However, the only test QA performs across the eras are hardforks.
3636
Therefore we don't need to expose all the era specific functionality for each era, rather we need to maintain the ability to submit hardfork update proposals across the eras i.e Byron -> latest era.
3737

3838
Users consuming `cardano-api` are only interested in functionality relevant to mainnet and the upcoming era if they want to experiment with new features on a testnet.
39-
Therefore rather than maintaining a potentially never ending enumeration of eras, I propose to maintain only the era on mainnet and the upcoming era that will be hardforked to in the future.
39+
40+
# Decision
41+
42+
Rather than maintaining a potentially never ending enumeration of eras, we will maintain only the era on mainnet and the upcoming era that will be hardforked to in the future.
4043

4144
## Code
4245

@@ -76,7 +79,7 @@ instance UseEra ConwayEra where
7679
useEra = ConwayEra
7780
```
7881

79-
### Deprecation of an era
82+
## Deprecation of an era
8083

8184
The following is an example of how a user would consume the api and how a user would see a deprecation of an era
8285

@@ -143,28 +146,26 @@ If users for some reason want this, we can direct them to use the ledger's api d
143146
The next stage after deprecation period, should be **removal of the deprecated constructor**.
144147
The deprecation period should be long enough to give enough time for `cardano-api` consumers to update their codebase to the post-hardfork era.
145148

146-
## Downsides
147-
148-
`cardano-api` users will be limited up to only two eras exposed from `cardano-api`.
149-
This will force them to keep up-to-date their code after the hardfork.
150-
This may turn out to be a disruptive process, but necessary to make the code using `cardano-api` healthy.
151-
152-
# Approach
149+
## Method of transition
153150

154151
The new api should be created adjacant to the existing one.
155152
We then slowly replace the use of the existing api in cardano-api, eventually deprecating the "old" api.
156153

157-
# Decision
158-
159-
The ADR gets adopted in `cardano-api` and `cardano-cli`. There may be minor tweaks as it is rolled out in `cardano-cli`.
160-
161154
# Consequences
162155

156+
## Upsides
157+
163158
- Less boiler plate in cardano-api and in users' codebases
164159
- Clearer defined boundaries as to new functionality being introduced due to a new era
165160
- Lower maintenance overhead
166161
- The need for an era agnostic api with respect to update proposals (these change on the Babbage/Conway boundary)
167162

163+
## Downsides
164+
165+
`cardano-api` users will be limited up to only two eras exposed from `cardano-api`.
166+
This will force them to keep up-to-date their code after the hardfork.
167+
This may turn out to be a disruptive process, but necessary to make the code using `cardano-api` healthy.
168+
168169
# References
169170
- 1: [ShelleyBasedEra](https://github.com/IntersectMBO/cardano-api/blob/873397bfe0436c224c593f456a3bc237ee0af0c8/cardano-api/internal/Cardano/Api/Eon/ShelleyBasedEra.hs#L123)
170171
- 2: [CardanoEra](https://github.com/IntersectMBO/cardano-api/blob/873397bfe0436c224c593f456a3bc237ee0af0c8/cardano-api/internal/Cardano/Api/Eras/Core.hs#L256)

0 commit comments

Comments
 (0)