Skip to content

Commit

Permalink
Update the conway genesis parameters
Browse files Browse the repository at this point in the history
Still investigating why the fees aren't right, even though it's using
the right pparams (Conway) now.
  • Loading branch information
noonio authored and ch1bo committed Aug 7, 2024
1 parent 89335f3 commit 87cc7ba
Show file tree
Hide file tree
Showing 3 changed files with 289 additions and 28 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ hspec-results.md
/docs/static/haddock/

# demo
devnet
/devnet
.env
logs
acks
Expand Down
302 changes: 279 additions & 23 deletions hydra-cluster/config/devnet/genesis-conway.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
"genDelegs": {},
"poolVotingThresholds": {
"committeeNormal": 0.51,
"committeeNoConfidence": 0.51,
Expand All @@ -8,34 +7,291 @@
"ppSecurityGroup": 0.51
},
"dRepVotingThresholds": {
"motionNoConfidence": 0.51,
"committeeNormal": 0.51,
"committeeNoConfidence": 0.51,
"updateToConstitution": 0.51,
"hardForkInitiation": 0.51,
"ppNetworkGroup": 0.51,
"ppEconomicGroup": 0.51,
"ppTechnicalGroup": 0.51,
"ppGovGroup": 0.51,
"treasuryWithdrawal": 0.51
"motionNoConfidence": 0.67,
"committeeNormal": 0.67,
"committeeNoConfidence": 0.6,
"updateToConstitution": 0.75,
"hardForkInitiation": 0.6,
"ppNetworkGroup": 0.67,
"ppEconomicGroup": 0.67,
"ppTechnicalGroup": 0.67,
"ppGovGroup": 0.75,
"treasuryWithdrawal": 0.67
},
"committeeMinSize": 0,
"committeeMaxTermLength": 200,
"govActionLifetime": 10,
"govActionDeposit": 1000000000,
"dRepDeposit": 2000000,
"committeeMaxTermLength": 365,
"govActionLifetime": 30,
"govActionDeposit": 100000000000,
"dRepDeposit": 500000000,
"dRepActivity": 20,
"minFeeRefScriptCostPerByte": 15,
"plutusV3CostModel": [
100788,
420,
1,
1,
1000,
173,
0,
1,
1000,
59957,
4,
1,
11183,
32,
201305,
8356,
4,
16000,
100,
16000,
100,
16000,
100,
16000,
100,
16000,
100,
16000,
100,
100,
100,
16000,
100,
94375,
32,
132994,
32,
61462,
4,
72010,
178,
0,
1,
22151,
32,
91189,
769,
4,
2,
85848,
123203,
7305,
-900,
1716,
549,
57,
85848,
0,
1,
1,
1000,
42921,
4,
2,
24548,
29498,
38,
1,
898148,
27279,
1,
51775,
558,
1,
39184,
1000,
60594,
1,
141895,
32,
83150,
32,
15299,
32,
76049,
1,
13169,
4,
22100,
10,
28999,
74,
1,
28999,
74,
1,
43285,
552,
1,
44749,
541,
1,
33852,
32,
68246,
32,
72362,
32,
7243,
32,
7391,
32,
11546,
32,
85848,
123203,
7305,
-900,
1716,
549,
57,
85848,
0,
1,
90434,
519,
0,
1,
74433,
32,
85848,
123203,
7305,
-900,
1716,
549,
57,
85848,
0,
1,
1,
85848,
123203,
7305,
-900,
1716,
549,
57,
85848,
0,
1,
955506,
213312,
0,
2,
270652,
22588,
4,
1457325,
64566,
4,
20467,
1,
4,
0,
141992,
32,
100788,
420,
1,
1,
81663,
32,
59498,
32,
20142,
32,
24588,
32,
20744,
32,
25933,
32,
24623,
32,
43053543,
10,
53384111,
14333,
10,
43574283,
26308,
10,
16000,
100,
16000,
100,
962335,
18,
2780678,
6,
442008,
1,
52538055,
3756,
18,
267929,
18,
76433006,
8868,
18,
52948122,
18,
1995836,
36,
3227919,
12,
901022,
1,
166917843,
4307,
36,
284546,
36,
158221314,
26549,
36,
74698472,
36,
333849714,
1,
254006273,
72,
2174038,
72,
2261318,
64571,
4,
207616,
8310,
4,
1293828,
28716,
63,
0,
1,
1006041,
43623,
251,
0,
1
],
"constitution": {
"anchor": {
"url": "",
"dataHash": "0000000000000000000000000000000000000000000000000000000000000000"
}
"anchor": {
"dataHash": "ca41a91f399259bcefe57f9858e91f6d00e1a38d6d9c63d4052914ea7bd70cb2",
"url": "ipfs://bafkreifnwj6zpu3ixa4siz2lndqybyc5wnnt3jkwyutci4e2tmbnj3xrdm"
},
"script": "fa24fb305126805cf2164c161d852a0e7330cf988f1fe558cf7d4a64"
},
"committee": {
"members": {
"scriptHash-ff9babf23fef3f54ec29132c07a8e23807d7b395b143ecd8ff79f4c7": 1000
},
"threshold": 0
},
"minFeeRefScriptCostPerByte": 15,
"plutusV3CostModel":[]
"threshold": {
"numerator": 2,
"denominator": 3
}
}
}
13 changes: 9 additions & 4 deletions hydra-node/src/Hydra/Chain/Direct/Wallet.hs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ import Cardano.Ledger.Val (invert)
import Cardano.Slotting.EpochInfo (EpochInfo)
import Cardano.Slotting.Time (SystemStart (..))
import Control.Arrow (left)
import Control.Concurrent.Class.MonadSTM (check, newTVarIO, readTVarIO, writeTVar)
import Control.Concurrent.Class.MonadSTM (check, newTVarIO, writeTVar)
import Control.Lens (view, (%~), (.~), (^.))
import Data.List qualified as List
import Data.Map.Strict ((!))
Expand Down Expand Up @@ -139,6 +139,7 @@ data TinyWallet m = TinyWallet
data SomePParams
= BabbagePParams (PParams Babbage)
| ConwayPParams (PParams Conway)
deriving (Show)

data WalletInfoOnChain = WalletInfoOnChain
{ walletUTxO :: Map TxIn TxOut
Expand Down Expand Up @@ -180,10 +181,14 @@ newTinyWallet tracer networkId (vk, sk) queryWalletInfo queryEpochInfo = do
, sign = Api.signTx sk
, coverFee = \lookupUTxO partialTx -> do
let ledgerLookupUTxO = unUTxO $ toLedgerUTxO lookupUTxO
-- FIXME: We should query pparams here. If not, we likely will have
-- wrong fee estimation should they change in between.
-- We query pparams here again as it's possible that a hardfork occurred
-- and the pparams changed.
-- FIXME: Only query the pparams again, not the entire wallet info
currentWalletInfo@WalletInfoOnChain{walletUTxO, pparams, systemStart} <- queryWalletInfo QueryTip address
epochInfo <- queryEpochInfo
WalletInfoOnChain{walletUTxO, pparams, systemStart} <- readTVarIO walletInfoVar
atomically $ writeTVar walletInfoVar currentWalletInfo

putStrLn $ "Current PParams: " <> show pparams
pure $
case pparams of
BabbagePParams pp ->
Expand Down

0 comments on commit 87cc7ba

Please sign in to comment.