Skip to content

Commit 7028c43

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

File tree

1 file changed

+17
-12
lines changed

1 file changed

+17
-12
lines changed

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

Lines changed: 17 additions & 12 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,30 @@ 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
147149

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.
150+
## Method of transition
151151

152-
# Approach
153-
154-
The new api should be created adjacant to the existing one.
152+
The new API will be implemented in `cardano-api`, adjacant to the existing one.
155153
We then slowly replace the use of the existing api in cardano-api, eventually deprecating the "old" api.
156154

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`.
155+
The new API will be used by `cardano-cli` as the first client by modifying the `cardano-cli` code to use the new API
156+
exclusively and lessons their will influence the evolution of the new API.
160157

161158
# Consequences
162159

160+
## Upsides
161+
163162
- Less boiler plate in cardano-api and in users' codebases
164163
- Clearer defined boundaries as to new functionality being introduced due to a new era
165164
- Lower maintenance overhead
166165
- The need for an era agnostic api with respect to update proposals (these change on the Babbage/Conway boundary)
167166

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

0 commit comments

Comments
 (0)