helper_test.go 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505
  1. // Copyright 2016 The go-ethereum Authors
  2. // This file is part of the go-ethereum library.
  3. //
  4. // The go-ethereum library is free software: you can redistribute it and/or modify
  5. // it under the terms of the GNU Lesser General Public License as published by
  6. // the Free Software Foundation, either version 3 of the License, or
  7. // (at your option) any later version.
  8. //
  9. // The go-ethereum library is distributed in the hope that it will be useful,
  10. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. // GNU Lesser General Public License for more details.
  13. //
  14. // You should have received a copy of the GNU Lesser General Public License
  15. // along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
  16. // This file contains some shares testing functionality, common to multiple
  17. // different files and modules being tested.
  18. package les
  19. import (
  20. "context"
  21. "crypto/rand"
  22. "math/big"
  23. "sync"
  24. "testing"
  25. "time"
  26. "github.com/ethereum/go-ethereum/accounts/abi/bind"
  27. "github.com/ethereum/go-ethereum/accounts/abi/bind/backends"
  28. "github.com/ethereum/go-ethereum/common"
  29. "github.com/ethereum/go-ethereum/common/mclock"
  30. "github.com/ethereum/go-ethereum/consensus/ethash"
  31. "github.com/ethereum/go-ethereum/contracts/checkpointoracle/contract"
  32. "github.com/ethereum/go-ethereum/core"
  33. "github.com/ethereum/go-ethereum/core/rawdb"
  34. "github.com/ethereum/go-ethereum/core/types"
  35. "github.com/ethereum/go-ethereum/crypto"
  36. "github.com/ethereum/go-ethereum/eth"
  37. "github.com/ethereum/go-ethereum/ethdb"
  38. "github.com/ethereum/go-ethereum/event"
  39. "github.com/ethereum/go-ethereum/les/flowcontrol"
  40. "github.com/ethereum/go-ethereum/light"
  41. "github.com/ethereum/go-ethereum/p2p"
  42. "github.com/ethereum/go-ethereum/p2p/enode"
  43. "github.com/ethereum/go-ethereum/params"
  44. )
  45. var (
  46. bankKey, _ = crypto.GenerateKey()
  47. bankAddr = crypto.PubkeyToAddress(bankKey.PublicKey)
  48. bankFunds = big.NewInt(1000000000000000000)
  49. userKey1, _ = crypto.GenerateKey()
  50. userKey2, _ = crypto.GenerateKey()
  51. userAddr1 = crypto.PubkeyToAddress(userKey1.PublicKey)
  52. userAddr2 = crypto.PubkeyToAddress(userKey2.PublicKey)
  53. testContractCode = common.Hex2Bytes("606060405260cc8060106000396000f360606040526000357c01000000000000000000000000000000000000000000000000000000009004806360cd2685146041578063c16431b914606b57603f565b005b6055600480803590602001909190505060a9565b6040518082815260200191505060405180910390f35b60886004808035906020019091908035906020019091905050608a565b005b80600060005083606481101560025790900160005b50819055505b5050565b6000600060005082606481101560025790900160005b5054905060c7565b91905056")
  54. testContractAddr common.Address
  55. testContractCodeDeployed = testContractCode[16:]
  56. testContractDeployed = uint64(2)
  57. testEventEmitterCode = common.Hex2Bytes("60606040523415600e57600080fd5b7f57050ab73f6b9ebdd9f76b8d4997793f48cf956e965ee070551b9ca0bb71584e60405160405180910390a160358060476000396000f3006060604052600080fd00a165627a7a723058203f727efcad8b5811f8cb1fc2620ce5e8c63570d697aef968172de296ea3994140029")
  58. // Checkpoint registrar relative
  59. registrarAddr common.Address
  60. signerKey, _ = crypto.GenerateKey()
  61. signerAddr = crypto.PubkeyToAddress(signerKey.PublicKey)
  62. )
  63. var (
  64. // The block frequency for creating checkpoint(only used in test)
  65. sectionSize = big.NewInt(512)
  66. // The number of confirmations needed to generate a checkpoint(only used in test).
  67. processConfirms = big.NewInt(4)
  68. //
  69. testBufLimit = uint64(1000000)
  70. testBufRecharge = uint64(1000)
  71. )
  72. /*
  73. contract test {
  74. uint256[100] data;
  75. function Put(uint256 addr, uint256 value) {
  76. data[addr] = value;
  77. }
  78. function Get(uint256 addr) constant returns (uint256 value) {
  79. return data[addr];
  80. }
  81. }
  82. */
  83. // prepareTestchain pre-commits specified number customized blocks into chain.
  84. func prepareTestchain(n int, backend *backends.SimulatedBackend) {
  85. var (
  86. ctx = context.Background()
  87. signer = types.HomesteadSigner{}
  88. )
  89. for i := 0; i < n; i++ {
  90. switch i {
  91. case 0:
  92. // deploy checkpoint contract
  93. registrarAddr, _, _, _ = contract.DeployCheckpointOracle(bind.NewKeyedTransactor(bankKey), backend, []common.Address{signerAddr}, sectionSize, processConfirms, big.NewInt(1))
  94. // bankUser transfers some ether to user1
  95. nonce, _ := backend.PendingNonceAt(ctx, bankAddr)
  96. tx, _ := types.SignTx(types.NewTransaction(nonce, userAddr1, big.NewInt(10000), params.TxGas, nil, nil), signer, bankKey)
  97. backend.SendTransaction(ctx, tx)
  98. case 1:
  99. bankNonce, _ := backend.PendingNonceAt(ctx, bankAddr)
  100. userNonce1, _ := backend.PendingNonceAt(ctx, userAddr1)
  101. // bankUser transfers more ether to user1
  102. tx1, _ := types.SignTx(types.NewTransaction(bankNonce, userAddr1, big.NewInt(1000), params.TxGas, nil, nil), signer, bankKey)
  103. backend.SendTransaction(ctx, tx1)
  104. // user1 relays ether to user2
  105. tx2, _ := types.SignTx(types.NewTransaction(userNonce1, userAddr2, big.NewInt(1000), params.TxGas, nil, nil), signer, userKey1)
  106. backend.SendTransaction(ctx, tx2)
  107. // user1 deploys a test contract
  108. tx3, _ := types.SignTx(types.NewContractCreation(userNonce1+1, big.NewInt(0), 200000, big.NewInt(0), testContractCode), signer, userKey1)
  109. backend.SendTransaction(ctx, tx3)
  110. testContractAddr = crypto.CreateAddress(userAddr1, userNonce1+1)
  111. // user1 deploys a event contract
  112. tx4, _ := types.SignTx(types.NewContractCreation(userNonce1+2, big.NewInt(0), 200000, big.NewInt(0), testEventEmitterCode), signer, userKey1)
  113. backend.SendTransaction(ctx, tx4)
  114. case 2:
  115. // bankUser transfer some ether to signer
  116. bankNonce, _ := backend.PendingNonceAt(ctx, bankAddr)
  117. tx1, _ := types.SignTx(types.NewTransaction(bankNonce, signerAddr, big.NewInt(1000000000), params.TxGas, nil, nil), signer, bankKey)
  118. backend.SendTransaction(ctx, tx1)
  119. // invoke test contract
  120. data := common.Hex2Bytes("C16431B900000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001")
  121. tx2, _ := types.SignTx(types.NewTransaction(bankNonce+1, testContractAddr, big.NewInt(0), 100000, nil, data), signer, bankKey)
  122. backend.SendTransaction(ctx, tx2)
  123. case 3:
  124. // invoke test contract
  125. bankNonce, _ := backend.PendingNonceAt(ctx, bankAddr)
  126. data := common.Hex2Bytes("C16431B900000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000002")
  127. tx, _ := types.SignTx(types.NewTransaction(bankNonce, testContractAddr, big.NewInt(0), 100000, nil, data), signer, bankKey)
  128. backend.SendTransaction(ctx, tx)
  129. }
  130. backend.Commit()
  131. }
  132. }
  133. // testIndexers creates a set of indexers with specified params for testing purpose.
  134. func testIndexers(db ethdb.Database, odr light.OdrBackend, config *light.IndexerConfig) []*core.ChainIndexer {
  135. var indexers [3]*core.ChainIndexer
  136. indexers[0] = light.NewChtIndexer(db, odr, config.ChtSize, config.ChtConfirms)
  137. indexers[1] = eth.NewBloomIndexer(db, config.BloomSize, config.BloomConfirms)
  138. indexers[2] = light.NewBloomTrieIndexer(db, odr, config.BloomSize, config.BloomTrieSize)
  139. // make bloomTrieIndexer as a child indexer of bloom indexer.
  140. indexers[1].AddChildIndexer(indexers[2])
  141. return indexers[:]
  142. }
  143. // newTestProtocolManager creates a new protocol manager for testing purposes,
  144. // with the given number of blocks already known, potential notification
  145. // channels for different events and relative chain indexers array.
  146. func newTestProtocolManager(lightSync bool, blocks int, odr *LesOdr, indexers []*core.ChainIndexer, peers *peerSet, db ethdb.Database, ulcServers []string, ulcFraction int, testCost uint64, clock mclock.Clock) (*ProtocolManager, *backends.SimulatedBackend, error) {
  147. var (
  148. evmux = new(event.TypeMux)
  149. engine = ethash.NewFaker()
  150. gspec = core.Genesis{
  151. Config: params.AllEthashProtocolChanges,
  152. Alloc: core.GenesisAlloc{bankAddr: {Balance: bankFunds}},
  153. }
  154. pool txPool
  155. chain BlockChain
  156. exitCh = make(chan struct{})
  157. )
  158. gspec.MustCommit(db)
  159. if peers == nil {
  160. peers = newPeerSet()
  161. }
  162. // create a simulation backend and pre-commit several customized block to the database.
  163. simulation := backends.NewSimulatedBackendWithDatabase(db, gspec.Alloc, 100000000)
  164. prepareTestchain(blocks, simulation)
  165. // initialize empty chain for light client or pre-committed chain for server.
  166. if lightSync {
  167. chain, _ = light.NewLightChain(odr, gspec.Config, engine, nil)
  168. } else {
  169. chain = simulation.Blockchain()
  170. pool = core.NewTxPool(core.DefaultTxPoolConfig, gspec.Config, simulation.Blockchain())
  171. }
  172. // Create contract registrar
  173. indexConfig := light.TestServerIndexerConfig
  174. if lightSync {
  175. indexConfig = light.TestClientIndexerConfig
  176. }
  177. config := &params.CheckpointOracleConfig{
  178. Address: crypto.CreateAddress(bankAddr, 0),
  179. Signers: []common.Address{signerAddr},
  180. Threshold: 1,
  181. }
  182. var reg *checkpointOracle
  183. if indexers != nil {
  184. getLocal := func(index uint64) params.TrustedCheckpoint {
  185. chtIndexer := indexers[0]
  186. sectionHead := chtIndexer.SectionHead(index)
  187. return params.TrustedCheckpoint{
  188. SectionIndex: index,
  189. SectionHead: sectionHead,
  190. CHTRoot: light.GetChtRoot(db, index, sectionHead),
  191. BloomRoot: light.GetBloomTrieRoot(db, index, sectionHead),
  192. }
  193. }
  194. reg = newCheckpointOracle(config, getLocal)
  195. }
  196. pm, err := NewProtocolManager(gspec.Config, nil, indexConfig, ulcServers, ulcFraction, lightSync, NetworkId, evmux, peers, chain, pool, db, odr, nil, reg, exitCh, new(sync.WaitGroup), func() bool { return true })
  197. if err != nil {
  198. return nil, nil, err
  199. }
  200. // Registrar initialization could failed if checkpoint contract is not specified.
  201. if pm.reg != nil {
  202. pm.reg.start(simulation)
  203. }
  204. // Set up les server stuff.
  205. if !lightSync {
  206. srv := &LesServer{lesCommons: lesCommons{protocolManager: pm, chainDb: db}}
  207. pm.server = srv
  208. pm.servingQueue = newServingQueue(int64(time.Millisecond*10), 1)
  209. pm.servingQueue.setThreads(4)
  210. srv.defParams = flowcontrol.ServerParams{
  211. BufLimit: testBufLimit,
  212. MinRecharge: testBufRecharge,
  213. }
  214. srv.testCost = testCost
  215. srv.fcManager = flowcontrol.NewClientManager(nil, clock)
  216. }
  217. pm.Start(1000)
  218. return pm, simulation, nil
  219. }
  220. // newTestProtocolManagerMust creates a new protocol manager for testing purposes,
  221. // with the given number of blocks already known, potential notification channels
  222. // for different events and relative chain indexers array. In case of an error, the
  223. // constructor force-fails the test.
  224. func newTestProtocolManagerMust(t *testing.T, lightSync bool, blocks int, odr *LesOdr, indexers []*core.ChainIndexer, peers *peerSet, db ethdb.Database, ulcServers []string, ulcFraction int) (*ProtocolManager, *backends.SimulatedBackend) {
  225. pm, backend, err := newTestProtocolManager(lightSync, blocks, odr, indexers, peers, db, ulcServers, ulcFraction, 0, &mclock.System{})
  226. if err != nil {
  227. t.Fatalf("Failed to create protocol manager: %v", err)
  228. }
  229. return pm, backend
  230. }
  231. // testPeer is a simulated peer to allow testing direct network calls.
  232. type testPeer struct {
  233. net p2p.MsgReadWriter // Network layer reader/writer to simulate remote messaging
  234. app *p2p.MsgPipeRW // Application layer reader/writer to simulate the local side
  235. *peer
  236. }
  237. // newTestPeer creates a new peer registered at the given protocol manager.
  238. func newTestPeer(t *testing.T, name string, version int, pm *ProtocolManager, shake bool, testCost uint64) (*testPeer, <-chan error) {
  239. // Create a message pipe to communicate through
  240. app, net := p2p.MsgPipe()
  241. // Generate a random id and create the peer
  242. var id enode.ID
  243. rand.Read(id[:])
  244. peer := pm.newPeer(version, NetworkId, p2p.NewPeer(id, name, nil), net)
  245. // Start the peer on a new thread
  246. errc := make(chan error, 1)
  247. go func() {
  248. select {
  249. case pm.newPeerCh <- peer:
  250. errc <- pm.handle(peer)
  251. case <-pm.quitSync:
  252. errc <- p2p.DiscQuitting
  253. }
  254. }()
  255. tp := &testPeer{
  256. app: app,
  257. net: net,
  258. peer: peer,
  259. }
  260. // Execute any implicitly requested handshakes and return
  261. if shake {
  262. var (
  263. genesis = pm.blockchain.Genesis()
  264. head = pm.blockchain.CurrentHeader()
  265. td = pm.blockchain.GetTd(head.Hash(), head.Number.Uint64())
  266. )
  267. tp.handshake(t, td, head.Hash(), head.Number.Uint64(), genesis.Hash(), testCost)
  268. }
  269. return tp, errc
  270. }
  271. func newTestPeerPair(name string, version int, pm, pm2 *ProtocolManager) (*peer, <-chan error, *peer, <-chan error) {
  272. // Create a message pipe to communicate through
  273. app, net := p2p.MsgPipe()
  274. // Generate a random id and create the peer
  275. var id enode.ID
  276. rand.Read(id[:])
  277. peer := pm.newPeer(version, NetworkId, p2p.NewPeer(id, name, nil), net)
  278. peer2 := pm2.newPeer(version, NetworkId, p2p.NewPeer(id, name, nil), app)
  279. // Start the peer on a new thread
  280. errc := make(chan error, 1)
  281. errc2 := make(chan error, 1)
  282. go func() {
  283. select {
  284. case pm.newPeerCh <- peer:
  285. errc <- pm.handle(peer)
  286. case <-pm.quitSync:
  287. errc <- p2p.DiscQuitting
  288. }
  289. }()
  290. go func() {
  291. select {
  292. case pm2.newPeerCh <- peer2:
  293. errc2 <- pm2.handle(peer2)
  294. case <-pm2.quitSync:
  295. errc2 <- p2p.DiscQuitting
  296. }
  297. }()
  298. return peer, errc, peer2, errc2
  299. }
  300. // handshake simulates a trivial handshake that expects the same state from the
  301. // remote side as we are simulating locally.
  302. func (p *testPeer) handshake(t *testing.T, td *big.Int, head common.Hash, headNum uint64, genesis common.Hash, testCost uint64) {
  303. var expList keyValueList
  304. expList = expList.add("protocolVersion", uint64(p.version))
  305. expList = expList.add("networkId", uint64(NetworkId))
  306. expList = expList.add("headTd", td)
  307. expList = expList.add("headHash", head)
  308. expList = expList.add("headNum", headNum)
  309. expList = expList.add("genesisHash", genesis)
  310. sendList := make(keyValueList, len(expList))
  311. copy(sendList, expList)
  312. expList = expList.add("serveHeaders", nil)
  313. expList = expList.add("serveChainSince", uint64(0))
  314. expList = expList.add("serveStateSince", uint64(0))
  315. expList = expList.add("serveRecentState", uint64(core.TriesInMemory-4))
  316. expList = expList.add("txRelay", nil)
  317. expList = expList.add("flowControl/BL", testBufLimit)
  318. expList = expList.add("flowControl/MRR", testBufRecharge)
  319. expList = expList.add("flowControl/MRC", testCostList(testCost))
  320. if err := p2p.ExpectMsg(p.app, StatusMsg, expList); err != nil {
  321. t.Fatalf("status recv: %v", err)
  322. }
  323. if err := p2p.Send(p.app, StatusMsg, sendList); err != nil {
  324. t.Fatalf("status send: %v", err)
  325. }
  326. p.fcParams = flowcontrol.ServerParams{
  327. BufLimit: testBufLimit,
  328. MinRecharge: testBufRecharge,
  329. }
  330. }
  331. // close terminates the local side of the peer, notifying the remote protocol
  332. // manager of termination.
  333. func (p *testPeer) close() {
  334. p.app.Close()
  335. }
  336. // TestEntity represents a network entity for testing with necessary auxiliary fields.
  337. type TestEntity struct {
  338. db ethdb.Database
  339. rPeer *peer
  340. tPeer *testPeer
  341. peers *peerSet
  342. pm *ProtocolManager
  343. backend *backends.SimulatedBackend
  344. // Indexers
  345. chtIndexer *core.ChainIndexer
  346. bloomIndexer *core.ChainIndexer
  347. bloomTrieIndexer *core.ChainIndexer
  348. }
  349. // newServerEnv creates a server testing environment with a connected test peer for testing purpose.
  350. func newServerEnv(t *testing.T, blocks int, protocol int, waitIndexers func(*core.ChainIndexer, *core.ChainIndexer, *core.ChainIndexer)) (*TestEntity, func()) {
  351. db := rawdb.NewMemoryDatabase()
  352. indexers := testIndexers(db, nil, light.TestServerIndexerConfig)
  353. pm, b := newTestProtocolManagerMust(t, false, blocks, nil, indexers, nil, db, nil, 0)
  354. peer, _ := newTestPeer(t, "peer", protocol, pm, true, 0)
  355. cIndexer, bIndexer, btIndexer := indexers[0], indexers[1], indexers[2]
  356. cIndexer.Start(pm.blockchain.(*core.BlockChain))
  357. bIndexer.Start(pm.blockchain.(*core.BlockChain))
  358. // Wait until indexers generate enough index data.
  359. if waitIndexers != nil {
  360. waitIndexers(cIndexer, bIndexer, btIndexer)
  361. }
  362. return &TestEntity{
  363. db: db,
  364. tPeer: peer,
  365. pm: pm,
  366. backend: b,
  367. chtIndexer: cIndexer,
  368. bloomIndexer: bIndexer,
  369. bloomTrieIndexer: btIndexer,
  370. }, func() {
  371. peer.close()
  372. // Note bloom trie indexer will be closed by it parent recursively.
  373. cIndexer.Close()
  374. bIndexer.Close()
  375. }
  376. }
  377. // newClientServerEnv creates a client/server arch environment with a connected les server and light client pair
  378. // for testing purpose.
  379. func newClientServerEnv(t *testing.T, blocks int, protocol int, waitIndexers func(*core.ChainIndexer, *core.ChainIndexer, *core.ChainIndexer), newPeer bool) (*TestEntity, *TestEntity, func()) {
  380. db, ldb := rawdb.NewMemoryDatabase(), rawdb.NewMemoryDatabase()
  381. peers, lPeers := newPeerSet(), newPeerSet()
  382. dist := newRequestDistributor(lPeers, make(chan struct{}), &mclock.System{})
  383. rm := newRetrieveManager(lPeers, dist, nil)
  384. odr := NewLesOdr(ldb, light.TestClientIndexerConfig, rm)
  385. indexers := testIndexers(db, nil, light.TestServerIndexerConfig)
  386. lIndexers := testIndexers(ldb, odr, light.TestClientIndexerConfig)
  387. cIndexer, bIndexer, btIndexer := indexers[0], indexers[1], indexers[2]
  388. lcIndexer, lbIndexer, lbtIndexer := lIndexers[0], lIndexers[1], lIndexers[2]
  389. odr.SetIndexers(lcIndexer, lbtIndexer, lbIndexer)
  390. pm, b := newTestProtocolManagerMust(t, false, blocks, nil, indexers, peers, db, nil, 0)
  391. lpm, lb := newTestProtocolManagerMust(t, true, 0, odr, lIndexers, lPeers, ldb, nil, 0)
  392. startIndexers := func(clientMode bool, pm *ProtocolManager) {
  393. if clientMode {
  394. lcIndexer.Start(pm.blockchain.(*light.LightChain))
  395. lbIndexer.Start(pm.blockchain.(*light.LightChain))
  396. } else {
  397. cIndexer.Start(pm.blockchain.(*core.BlockChain))
  398. bIndexer.Start(pm.blockchain.(*core.BlockChain))
  399. }
  400. }
  401. startIndexers(false, pm)
  402. startIndexers(true, lpm)
  403. // Execute wait until function if it is specified.
  404. if waitIndexers != nil {
  405. waitIndexers(cIndexer, bIndexer, btIndexer)
  406. }
  407. var (
  408. peer, lPeer *peer
  409. err1, err2 <-chan error
  410. )
  411. if newPeer {
  412. peer, err1, lPeer, err2 = newTestPeerPair("peer", protocol, pm, lpm)
  413. select {
  414. case <-time.After(time.Millisecond * 100):
  415. case err := <-err1:
  416. t.Fatalf("peer 1 handshake error: %v", err)
  417. case err := <-err2:
  418. t.Fatalf("peer 2 handshake error: %v", err)
  419. }
  420. }
  421. return &TestEntity{
  422. db: db,
  423. pm: pm,
  424. rPeer: peer,
  425. peers: peers,
  426. backend: b,
  427. chtIndexer: cIndexer,
  428. bloomIndexer: bIndexer,
  429. bloomTrieIndexer: btIndexer,
  430. }, &TestEntity{
  431. db: ldb,
  432. pm: lpm,
  433. rPeer: lPeer,
  434. peers: lPeers,
  435. backend: lb,
  436. chtIndexer: lcIndexer,
  437. bloomIndexer: lbIndexer,
  438. bloomTrieIndexer: lbtIndexer,
  439. }, func() {
  440. // Note bloom trie indexers will be closed by their parents recursively.
  441. cIndexer.Close()
  442. bIndexer.Close()
  443. lcIndexer.Close()
  444. lbIndexer.Close()
  445. }
  446. }