Skip to content

Commit

Permalink
Merge branch 'master' into lars/aeson-2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
chessai committed Oct 4, 2023
2 parents 6051731 + 667121e commit 8033042
Show file tree
Hide file tree
Showing 20 changed files with 246 additions and 159 deletions.
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,25 @@
# `chainweb-node` Changelog

## 2.21 (2023-10-05)

This version replaces all previous versions. Any prior version will stop working
on **2023-10-19T00:00:00Z**. Node administrators must upgrade to this version before
that date.

This version will expire on **2023-12-13T:00:00Z**.

To upgrade, pull the latest docker image or download the binary and restart the node.

Changes:

* Support for WebAuthN signatures in Pact keyset guards. (#1729, see [https://github.com/kadena-io/pact](Pact) #1139)
* Updated to Pact 4.9. (numerous, see [Pact
changelog](https://github.com/kadena-io/pact/releases/tag/v4.9))

Internal Changes:
* Updated from tls package version 1.7.1 to 1.9. (#1734)
* Updated from base64-bytestring package version 1.0.0.3 to 1.2.1.0. (#1729)

## 2.20 (2023-08-28)

This version replaces all previous versions. Any prior version will stop working
Expand Down
24 changes: 12 additions & 12 deletions bench/Chainweb/Pact/Backend/ForkingBench.hs
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ data Resources
, blockHeaderDb :: !BlockHeaderDb
, pactService :: !(Async (), PactQueue)
, mainTrunkBlocks :: ![T3 ParentHeader BlockHeader PayloadWithOutputs]
, coinAccounts :: !(MVar (Map Account (NonEmpty SomeKeyPairCaps)))
, coinAccounts :: !(MVar (Map Account (NonEmpty Ed25519KeyPairCaps)))
, nonceCounter :: !(IORef Word64)
, txPerBlock :: !(IORef Int)
, sqlEnv :: !SQLiteEnv
Expand Down Expand Up @@ -314,7 +314,7 @@ withResources rdb trunkLength logLevel f = C.envWithCleanup create destroy unwra

-- | Mempool Access
--
testMemPoolAccess :: IORef Int -> MVar (Map Account (NonEmpty SomeKeyPairCaps)) -> IO MemPoolAccess
testMemPoolAccess :: IORef Int -> MVar (Map Account (NonEmpty Ed25519KeyPairCaps)) -> IO MemPoolAccess
testMemPoolAccess txsPerBlock accounts = do
hs <- newIORef []
return $ mempty
Expand Down Expand Up @@ -363,7 +363,7 @@ testMemPoolAccess txsPerBlock accounts = do
Right tx -> return tx
return $! txs

mkTransferCaps :: ReceiverName -> Amount -> (Account, NonEmpty SomeKeyPairCaps) -> (Account, NonEmpty SomeKeyPairCaps)
mkTransferCaps :: ReceiverName -> Amount -> (Account, NonEmpty Ed25519KeyPairCaps) -> (Account, NonEmpty Ed25519KeyPairCaps)
mkTransferCaps (ReceiverName (Account r)) (Amount m) (s@(Account ss),ks) = (s, (caps <$) <$> ks)
where
caps = [gas,tfr]
Expand Down Expand Up @@ -392,7 +392,7 @@ createCoinAccount
:: ChainwebVersion
-> PublicMeta
-> String
-> IO (NonEmpty SomeKeyPairCaps, Command Text)
-> IO (NonEmpty Ed25519KeyPairCaps, Command Text)
createCoinAccount v meta name = do
sender00Keyset <- NEL.fromList <$> getKeyset "sender00"
nameKeyset <- NEL.fromList <$> getKeyset name
Expand All @@ -405,12 +405,12 @@ createCoinAccount v meta name = do
isSenderAccount name' =
elem name' (map getAccount coinAccountNames)

getKeyset :: String -> IO [SomeKeyPairCaps]
getKeyset :: String -> IO [Ed25519KeyPairCaps]
getKeyset s
| isSenderAccount s = do
keypair <- stockKey (T.pack s)
mkKeyPairs [keypair]
| otherwise = (\k -> [(k, [])]) <$> genKeyPair defaultScheme
| otherwise = (\k -> [(k, [])]) <$> genKeyPair

attachCaps s rcvr m ks = (caps <$) <$> ks
where
Expand All @@ -435,7 +435,7 @@ stockKey s = do
stockKeyFile :: ByteString
stockKeyFile = $(embedFile "pact/genesis/devnet/keys.yaml")

createCoinAccounts :: ChainwebVersion -> PublicMeta -> IO (NonEmpty (Account, NonEmpty SomeKeyPairCaps, Command Text))
createCoinAccounts :: ChainwebVersion -> PublicMeta -> IO (NonEmpty (Account, NonEmpty Ed25519KeyPairCaps, Command Text))
createCoinAccounts v meta = traverse (go <*> createCoinAccount v meta) names
where
go a m = do
Expand All @@ -448,8 +448,8 @@ names = NEL.map safeCapitalize . NEL.fromList $ Prelude.take 2 $ words "mary eli
accountNames :: NonEmpty Account
accountNames = Account <$> names

formatB16PubKey :: SomeKeyPair -> Text
formatB16PubKey = toB16Text . formatPublicKey
formatB16PubKey :: Ed25519KeyPair -> Text
formatB16PubKey = toB16Text . getPublic

safeCapitalize :: String -> String
safeCapitalize = maybe [] (uncurry (:) . bimap toUpper (Prelude.map toLower)) . Data.List.uncons
Expand All @@ -464,7 +464,7 @@ validateCommand cmdText = case verifyCommand cmdBS of

mkRandomCoinContractRequest
:: Bool
-> M.Map Account (NonEmpty SomeKeyPairCaps)
-> M.Map Account (NonEmpty Ed25519KeyPairCaps)
-> IO CoinContractRequest
mkRandomCoinContractRequest transfersPred kacts = do
request <- bool (randomRIO @Int (0, 1)) (return 1) transfersPred
Expand Down Expand Up @@ -495,7 +495,7 @@ data CoinContractRequest
| CoinTransferAndCreate SenderName ReceiverName Guard Amount
deriving Show

newtype Guard = Guard (NonEmpty SomeKeyPairCaps)
newtype Guard = Guard (NonEmpty Ed25519KeyPairCaps)
newtype SenderName = SenderName Account
newtype ReceiverName = ReceiverName Account

Expand Down Expand Up @@ -536,7 +536,7 @@ distinctAccounts xs = pick xs >>= go
createCoinContractRequest
:: ChainwebVersion
-> PublicMeta
-> NEL.NonEmpty SomeKeyPairCaps
-> NEL.NonEmpty Ed25519KeyPairCaps
-> CoinContractRequest
-> IO (Command Text)
createCoinContractRequest v meta ks request =
Expand Down
24 changes: 12 additions & 12 deletions cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ package yet-another-logger
source-repository-package
type: git
location: https://github.com/kadena-io/pact.git
tag: 030e255bc2cae38fd67dd9a1c24956ac59fe894c
--sha256: 15vrq9iznj0r39p44yrxxcvzihqkqnlii6556q4cq5lxyc8z4knd
tag: 0c9cfe5e88659c762289f24c8be54ed8c5b13251
--sha256: 11kznkm05j3797g87qz4skh5q21pxsh4lh2qvp50lac6m2fcgwj3

source-repository-package
type: git
Expand Down Expand Up @@ -114,6 +114,13 @@ source-repository-package
tag: b66e3a04c20f753213fe7e5115a95b3fe34109f9
--sha256: 0dca5pl56nz8ijnqavnpxw5f47qmpalszd5w0ag8bq3fd0l3839m

-- Required for non-canonical decode in base64-bytestring (remove after 2.20 fork)
source-repository-package
type: git
location: https://github.com/emilypi/base64-bytestring-kadena
tag: 174af3523616c8fe01449da5ccbb9f16df097ac3
--sha256: sha256-kVFIy+Aj3TNJpsM1Cs/5uGmzeWwHKYWjjCQ+L1/XOj8=

-- -------------------------------------------------------------------------- --
-- Relaxed Bounds

Expand Down Expand Up @@ -158,13 +165,6 @@ allow-newer: base-compat-batteries:*
-- -------------------------------------------------------------------------- --
-- Upper Bounds

-- required by pact
-- these upper bounds are required in order to not break payload validation
constraints: base16-bytestring <1
constraints: base64-bytestring <1.1

-- we have to add these because the old versions that we use would prevent
-- us to use recent versions of other packages
allow-newer: base64-bytestring:*
allow-newer: base16-bytestring:*

allow-newer: webauthn:these
allow-newer: webauthn:time
allow-newer: webauthn:aeson
Loading

0 comments on commit 8033042

Please sign in to comment.