From 0baf804422460335c21677a99293fc71d3e70fad Mon Sep 17 00:00:00 2001 From: Nicholas Pettas Date: Mon, 29 Jan 2024 16:08:03 -0800 Subject: [PATCH 1/2] add update network version test file for the simulator --- docker/networksimulator/README.md | 15 +++++++ docker/networksimulator/generate.py | 2 +- .../update_network_version.py | 44 +++++++++++++++++++ 3 files changed, 60 insertions(+), 1 deletion(-) create mode 100644 docker/networksimulator/update_network_version.py diff --git a/docker/networksimulator/README.md b/docker/networksimulator/README.md index ac666716a..e4a697135 100644 --- a/docker/networksimulator/README.md +++ b/docker/networksimulator/README.md @@ -115,3 +115,18 @@ python3 test.py 5 --no-wait --validator 2 python3 test.py --help ``` +## Rolling out partial upgrades + +First, build the new docker image with the changes you want to test. + +```shell +docker-compose build +``` + +Then, you can upgrade the nodes one at a time. + +```shell +docker-compose up -d --build --no-deps node2 +docker-compose up -d --build --no-deps node3 +docker-compose up -d --build --no-deps node4 +``` diff --git a/docker/networksimulator/generate.py b/docker/networksimulator/generate.py index 4ecfbb280..85617ced6 100644 --- a/docker/networksimulator/generate.py +++ b/docker/networksimulator/generate.py @@ -5,7 +5,7 @@ DEFAULT_IP_BASE = '172.16.239.0' DEFAULT_NUM_NODES = 3 DEFAULT_STARTING_PORT = 7050 -DEFAULT_FLAGS = "--testnet --metrics --metrics.addr 0.0.0.0 --http --http.port 8545 --http.addr 0.0.0.0 --http.vhosts '*' --http.corsdomain '*' --ws --ws.addr 0.0.0.0 --ws.port 8546 --ws.origins '*' --verbosity 3 " +DEFAULT_FLAGS = "--testnet --syncmode full --gcmode archive --metrics --metrics.addr 0.0.0.0 --http --http.port 8545 --http.addr 0.0.0.0 --http.vhosts '*' --http.corsdomain '*' --ws --ws.addr 0.0.0.0 --ws.port 8546 --ws.origins '*' --verbosity 3 " BOOT_NODE_KEY = "4b20a091f6389ca9ee1492187cc2d775511fa1e0801bf1f787b3a14f961530b1" BOOT_NODE_PUB_KEY = "d06482f636e5c68586215f9ab9dfda270d38bf468195fc2e767d5d74b5fc7ab4faffc46028aa360b723ce53ded022949a8a6b1c96013d8ec1771f4ed448518b4" diff --git a/docker/networksimulator/update_network_version.py b/docker/networksimulator/update_network_version.py new file mode 100644 index 000000000..1175aec8b --- /dev/null +++ b/docker/networksimulator/update_network_version.py @@ -0,0 +1,44 @@ +import json + +from web3 import Web3, HTTPProvider +from web3.middleware import construct_sign_and_send_raw_middleware +from time import time +import os +import argparse +import threading +import logging +import datetime + +RPC_URL = os.environ.get('RPC_URL') # add rpc url here + + +logging.basicConfig(level=logging.INFO, format='%(asctime)s %(levelname)s %(message)s') +logging.Formatter.formatTime = (lambda self, record, datefmt=None: + datetime.datetime.fromtimestamp(record.created, datetime.timezone.utc) + .astimezone() + .isoformat(sep="T", timespec="milliseconds")) + + +# These are fake validators keys for testing purposes only +# do not use them in production +PRIVATE_KEY = "0x163f5f0f9a621d72fedd85ffca3d08d131ab4e812181e0d30ffd1c885d20aac7" + + +w3 = Web3(HTTPProvider("http://localhost:8545")) +acct1 = w3.eth.account.from_key(PRIVATE_KEY) + +w3.middleware_onion.add(construct_sign_and_send_raw_middleware(acct1)) + +bytecode = '0x608060405234801561001057600080fd5b506004361061018d5760003560e01c806366e7ea0f116100e3578063b9cc6b1c1161008c578063e08d7e6611610066578063e08d7e6614610702578063f2fde38b14610772578063fd1b6ec1146107985761018d565b8063b9cc6b1c1461062c578063c0c53b8b1461069c578063d6a0c7af146106d45761018d565b80638da5cb5b116100bd5780638da5cb5b146105c95780638f32d59b146105ed578063a4066fbe146106095761018d565b806366e7ea0f14610569578063715018a61461059557806379bead381461059d5761018d565b8063242a6e3f116101455780634ddaf8f21161011f5780634ddaf8f21461033f5780634feb92f314610365578063592fe0c0146104035761018d565b8063242a6e3f14610285578063267ab446146102fc5780634b64e492146103195761018d565b806318f628d41161017657806318f628d4146101ce5780631cef4fab146102265780631e702f83146102625761018d565b806307aaf344146101925780630aeeca00146101b1575b600080fd5b6101af600480360360208110156101a857600080fd5b50356107c6565b005b6101af600480360360208110156101c757600080fd5b5035610969565b6101af60048036036101208110156101e557600080fd5b506001600160a01b038135169060208101359060408101359060608101359060808101359060a08101359060c08101359060e0810135906101000135610a28565b6101af6004803603608081101561023c57600080fd5b506001600160a01b03813581169160208101359091169060408101359060600135610b35565b6101af6004803603604081101561027857600080fd5b5080359060200135610ba0565b6101af6004803603604081101561029b57600080fd5b813591908101906040810160208201356401000000008111156102bd57600080fd5b8201836020820111156102cf57600080fd5b803590602001918460018302840111640100000000831117156102f157600080fd5b509092509050610c72565b6101af6004803603602081101561031257600080fd5b5035610d87565b6101af6004803603602081101561032f57600080fd5b50356001600160a01b0316610e46565b6101af6004803603602081101561035557600080fd5b50356001600160a01b0316610ed1565b6101af600480360361010081101561037c57600080fd5b6001600160a01b03823516916020810135918101906060810160408201356401000000008111156103ac57600080fd5b8201836020820111156103be57600080fd5b803590602001918460018302840111640100000000831117156103e057600080fd5b919350915080359060208101359060408101359060608101359060800135610f91565b6101af600480360360a081101561041957600080fd5b81019060208101813564010000000081111561043457600080fd5b82018360208201111561044657600080fd5b8035906020019184602083028401116401000000008311171561046857600080fd5b91939092909160208101903564010000000081111561048657600080fd5b82018360208201111561049857600080fd5b803590602001918460208302840111640100000000831117156104ba57600080fd5b9193909290916020810190356401000000008111156104d857600080fd5b8201836020820111156104ea57600080fd5b8035906020019184602083028401116401000000008311171561050c57600080fd5b91939092909160208101903564010000000081111561052a57600080fd5b82018360208201111561053c57600080fd5b8035906020019184602083028401116401000000008311171561055e57600080fd5b9193509150356110ab565b6101af6004803603604081101561057f57600080fd5b506001600160a01b038135169060200135611270565b6101af611394565b6101af600480360360408110156105b357600080fd5b506001600160a01b03813516906020013561144f565b6105d1611516565b604080516001600160a01b039092168252519081900360200190f35b6105f5611525565b604080519115158252519081900360200190f35b6101af6004803603604081101561061f57600080fd5b5080359060200135611536565b6101af6004803603602081101561064257600080fd5b81019060208101813564010000000081111561065d57600080fd5b82018360208201111561066f57600080fd5b8035906020019184600183028401116401000000008311171561069157600080fd5b509092509050611602565b6101af600480360360608110156106b257600080fd5b506001600160a01b0381358116916020810135821691604090910135166116eb565b6101af600480360360408110156106ea57600080fd5b506001600160a01b0381358116916020013516611838565b6101af6004803603602081101561071857600080fd5b81019060208101813564010000000081111561073357600080fd5b82018360208201111561074557600080fd5b8035906020019184602083028401116401000000008311171561076757600080fd5b509092509050611900565b6101af6004803603602081101561078857600080fd5b50356001600160a01b03166119df565b6101af600480360360408110156107ae57600080fd5b506001600160a01b0381358116916020013516611a41565b6066546001600160a01b03163314610825576040805162461bcd60e51b815260206004820152601e60248201527f63616c6c6572206973206e6f74207468652053464320636f6e74726163740000604482015290519081900360640190fd5b60675460408051808201909152601a81527f7b2245636f6e6f6d79223a7b224d696e4761735072696365223a00000000000060208201526001600160a01b039091169063b9cc6b1c906108b69061087b85611b04565b6040518060400160405280600281526020017f7d7d000000000000000000000000000000000000000000000000000000000000815250611c28565b6040518263ffffffff1660e01b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156109025781810151838201526020016108ea565b50505050905090810190601f16801561092f5780820380516001836020036101000a031916815260200191505b5092505050600060405180830381600087803b15801561094e57600080fd5b505af1158015610962573d6000803e3d6000fd5b5050505050565b610971611525565b6109c2576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b606754604080517f0aeeca000000000000000000000000000000000000000000000000000000000081526004810184905290516001600160a01b0390921691630aeeca009160248082019260009290919082900301818387803b15801561094e57600080fd5b6067546001600160a01b03163314610a715760405162461bcd60e51b81526004018080602001828103825260258152602001806122106025913960400191505060405180910390fd5b606654604080517f18f628d40000000000000000000000000000000000000000000000000000000081526001600160a01b038c81166004830152602482018c9052604482018b9052606482018a90526084820189905260a4820188905260c4820187905260e482018690526101048201859052915191909216916318f628d49161012480830192600092919082900301818387803b158015610b1257600080fd5b505af1158015610b26573d6000803e3d6000fd5b50505050505050505050505050565b610b3d611525565b610b8e576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b610b9a84848484611dc6565b50505050565b6067546001600160a01b03163314610be95760405162461bcd60e51b81526004018080602001828103825260258152602001806122106025913960400191505060405180910390fd5b606654604080517f1e702f83000000000000000000000000000000000000000000000000000000008152600481018590526024810184905290516001600160a01b0390921691631e702f839160448082019260009290919082900301818387803b158015610c5657600080fd5b505af1158015610c6a573d6000803e3d6000fd5b505050505050565b6066546001600160a01b03163314610cd1576040805162461bcd60e51b815260206004820152601e60248201527f63616c6c6572206973206e6f74207468652053464320636f6e74726163740000604482015290519081900360640190fd5b606754604080517f242a6e3f0000000000000000000000000000000000000000000000000000000081526004810186815260248201928352604482018590526001600160a01b039093169263242a6e3f928792879287929091606401848480828437600081840152601f19601f820116905080830192505050945050505050600060405180830381600087803b158015610d6a57600080fd5b505af1158015610d7e573d6000803e3d6000fd5b50505050505050565b610d8f611525565b610de0576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b606754604080517f267ab4460000000000000000000000000000000000000000000000000000000081526004810184905290516001600160a01b039092169163267ab4469160248082019260009290919082900301818387803b15801561094e57600080fd5b610e4e611525565b610e9f576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b610ece81610eab611516565b610eb430611ef0565b606754610ec9906001600160a01b0316611ef0565b611dc6565b50565b610ed9611525565b610f2a576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b606754604080517fda7fc24f0000000000000000000000000000000000000000000000000000000081526001600160a01b0384811660048301529151919092169163da7fc24f91602480830192600092919082900301818387803b15801561094e57600080fd5b6067546001600160a01b03163314610fda5760405162461bcd60e51b81526004018080602001828103825260258152602001806122106025913960400191505060405180910390fd5b606660009054906101000a90046001600160a01b03166001600160a01b0316634feb92f38a8a8a8a8a8a8a8a8a6040518a63ffffffff1660e01b8152600401808a6001600160a01b03166001600160a01b03168152602001898152602001806020018781526020018681526020018581526020018481526020018381526020018281038252898982818152602001925080828437600081840152601f19601f8201169050808301925050509a5050505050505050505050600060405180830381600087803b158015610b1257600080fd5b6067546001600160a01b031633146110f45760405162461bcd60e51b81526004018080602001828103825260258152602001806122106025913960400191505060405180910390fd5b606660009054906101000a90046001600160a01b03166001600160a01b031663592fe0c08a8a8a8a8a8a8a8a8a6040518a63ffffffff1660e01b8152600401808060200180602001806020018060200186815260200185810385528e8e82818152602001925060200280828437600083820152601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01690910186810385528c8152602090810191508d908d0280828437600083820152601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01690910186810384528a8152602090810191508b908b0280828437600083820152601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169091018681038352888152602090810191508990890280828437600081840152601f19601f8201169050808301925050509d5050505050505050505050505050600060405180830381600087803b158015610b1257600080fd5b6066546001600160a01b031633146112cf576040805162461bcd60e51b815260206004820152601e60248201527f63616c6c6572206973206e6f74207468652053464320636f6e74726163740000604482015290519081900360640190fd5b6066546001600160a01b0383811691161461131b5760405162461bcd60e51b81526004018080602001828103825260218152602001806121ef6021913960400191505060405180910390fd5b6067546001600160a01b039081169063e30443bc908490611345908216318563ffffffff611ef416565b6040518363ffffffff1660e01b815260040180836001600160a01b03166001600160a01b0316815260200182815260200192505050600060405180830381600087803b158015610c5657600080fd5b61139c611525565b6113ed576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6033546040516000916001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3603380547fffffffffffffffffffffffff0000000000000000000000000000000000000000169055565b611457611525565b6114a8576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b606754604080517f79bead380000000000000000000000000000000000000000000000000000000081526001600160a01b03858116600483015260248201859052915191909216916379bead3891604480830192600092919082900301818387803b158015610c5657600080fd5b6033546001600160a01b031690565b6033546001600160a01b0316331490565b6066546001600160a01b03163314611595576040805162461bcd60e51b815260206004820152601e60248201527f63616c6c6572206973206e6f74207468652053464320636f6e74726163740000604482015290519081900360640190fd5b606754604080517fa4066fbe000000000000000000000000000000000000000000000000000000008152600481018590526024810184905290516001600160a01b039092169163a4066fbe9160448082019260009290919082900301818387803b158015610c5657600080fd5b61160a611525565b61165b576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6067546040517fb9cc6b1c000000000000000000000000000000000000000000000000000000008152602060048201908152602482018490526001600160a01b039092169163b9cc6b1c91859185918190604401848480828437600081840152601f19601f8201169050808301925050509350505050600060405180830381600087803b158015610c5657600080fd5b600054610100900460ff16806117045750611704611f55565b80611712575060005460ff16155b61174d5760405162461bcd60e51b815260040180806020018281038252602e8152602001806121c1602e913960400191505060405180910390fd5b600054610100900460ff161580156117b357600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff909116610100171660011790555b6117bc82611f5b565b606780546001600160a01b038086167fffffffffffffffffffffffff00000000000000000000000000000000000000009283161790925560668054928716929091169190911790558015610b9a57600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff16905550505050565b611840611525565b611891576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b606754604080517fd6a0c7af0000000000000000000000000000000000000000000000000000000081526001600160a01b03858116600483015284811660248301529151919092169163d6a0c7af91604480830192600092919082900301818387803b158015610c5657600080fd5b6067546001600160a01b031633146119495760405162461bcd60e51b81526004018080602001828103825260258152602001806122106025913960400191505060405180910390fd5b6066546040517fe08d7e66000000000000000000000000000000000000000000000000000000008152602060048201818152602483018590526001600160a01b039093169263e08d7e6692869286929182916044909101908590850280828437600081840152601f19601f8201169050808301925050509350505050600060405180830381600087803b158015610c5657600080fd5b6119e7611525565b611a38576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b610ece816120bd565b611a49611525565b611a9a576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b611aa382612176565b8015611ab35750611ab381612176565b611891576040805162461bcd60e51b815260206004820152600e60248201527f6e6f74206120636f6e7472616374000000000000000000000000000000000000604482015290519081900360640190fd5b606081611b45575060408051808201909152600181527f30000000000000000000000000000000000000000000000000000000000000006020820152611c23565b6000611b508361217c565b90506060816040519080825280601f01601f191660200182016040528015611b7f576020820181803883390190505b5090507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82015b8415611c1e57600a850660300160f81b828281518110611bc257fe5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600a850494507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01611ba6565b509150505b919050565b60608084905060608490506060849050606081518351855101016040519080825280601f01601f191660200182016040528015611c6c576020820181803883390190505b509050806000805b8651811015611cdd57868181518110611c8957fe5b602001015160f81c60f81b838380600101945081518110611ca657fe5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600101611c74565b5060005b8551811015611d4a57858181518110611cf657fe5b602001015160f81c60f81b838380600101945081518110611d1357fe5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600101611ce1565b5060005b8451811015611db757848181518110611d6357fe5b602001015160f81c60f81b838380600101945081518110611d8057fe5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600101611d4e565b50909998505050505050505050565b611dcf846120bd565b836001600160a01b031663614619546040518163ffffffff1660e01b8152600401600060405180830381600087803b158015611e0a57600080fd5b505af1158015611e1e573d6000803e3d6000fd5b50505050611e2b836120bd565b81611e3530611ef0565b14611e87576040805162461bcd60e51b815260206004820152601c60248201527f73656c6620636f6465206861736820646f65736e2774206d6174636800000000604482015290519081900360640190fd5b6067548190611e9e906001600160a01b0316611ef0565b14610b9a576040805162461bcd60e51b815260206004820152601e60248201527f64726976657220636f6465206861736820646f65736e2774206d617463680000604482015290519081900360640190fd5b3f90565b600082820183811015611f4e576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b303b1590565b600054610100900460ff1680611f745750611f74611f55565b80611f82575060005460ff16155b611fbd5760405162461bcd60e51b815260040180806020018281038252602e8152602001806121c1602e913960400191505060405180910390fd5b600054610100900460ff1615801561202357600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff909116610100171660011790555b603380547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0384811691909117918290556040519116906000907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a380156120b957600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff1690555b5050565b6001600160a01b0381166121025760405162461bcd60e51b815260040180806020018281038252602681526020018061219b6026913960400191505060405180910390fd5b6033546040516001600160a01b038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3603380547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b3b151590565b6000805b821561219457600101600a83049250612180565b9291505056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373436f6e747261637420696e7374616e63652068617320616c7265616479206265656e20696e697469616c697a6564726563697069656e74206973206e6f74207468652053464320636f6e747261637463616c6c6572206973206e6f7420746865204e6f646544726976657220636f6e7472616374a265627a7a72315820e32e2bd9d4306bc53a2f1341ed34b7c36a48a87713cbfbf664b6cde5edf9f98e64736f6c63430005110032' +abi = json.loads('[{"type":"event","name":"OwnershipTransferred","inputs":[{"type":"address","name":"previousOwner","internalType":"address","indexed":true},{"type":"address","name":"newOwner","internalType":"address","indexed":true}],"anonymous":false},{"type":"function","stateMutability":"nonpayable","payable":false,"outputs":[],"name":"advanceEpochs","inputs":[{"type":"uint256","name":"num","internalType":"uint256"}],"constant":false},{"type":"function","stateMutability":"nonpayable","payable":false,"outputs":[],"name":"copyCode","inputs":[{"type":"address","name":"acc","internalType":"address"},{"type":"address","name":"from","internalType":"address"}],"constant":false},{"type":"function","stateMutability":"nonpayable","payable":false,"outputs":[],"name":"deactivateValidator","inputs":[{"type":"uint256","name":"validatorID","internalType":"uint256"},{"type":"uint256","name":"status","internalType":"uint256"}],"constant":false},{"type":"function","stateMutability":"nonpayable","payable":false,"outputs":[],"name":"execute","inputs":[{"type":"address","name":"executable","internalType":"address"}],"constant":false},{"type":"function","stateMutability":"nonpayable","payable":false,"outputs":[],"name":"incBalance","inputs":[{"type":"address","name":"acc","internalType":"address"},{"type":"uint256","name":"diff","internalType":"uint256"}],"constant":false},{"type":"function","stateMutability":"nonpayable","payable":false,"outputs":[],"name":"incNonce","inputs":[{"type":"address","name":"acc","internalType":"address"},{"type":"uint256","name":"diff","internalType":"uint256"}],"constant":false},{"type":"function","stateMutability":"nonpayable","payable":false,"outputs":[],"name":"initialize","inputs":[{"type":"address","name":"_sfc","internalType":"address payable"},{"type":"address","name":"_driver","internalType":"address"},{"type":"address","name":"_owner","internalType":"address"}],"constant":false},{"type":"function","stateMutability":"view","payable":false,"outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"isOwner","inputs":[],"constant":true},{"type":"function","stateMutability":"nonpayable","payable":false,"outputs":[],"name":"migrateTo","inputs":[{"type":"address","name":"newDriverAuth","internalType":"address"}],"constant":false},{"type":"function","stateMutability":"nonpayable","payable":false,"outputs":[],"name":"mutExecute","inputs":[{"type":"address","name":"executable","internalType":"address"},{"type":"address","name":"newOwner","internalType":"address"},{"type":"bytes32","name":"selfCodeHash","internalType":"bytes32"},{"type":"bytes32","name":"driverCodeHash","internalType":"bytes32"}],"constant":false},{"type":"function","stateMutability":"view","payable":false,"outputs":[{"type":"address","name":"","internalType":"address"}],"name":"owner","inputs":[],"constant":true},{"type":"function","stateMutability":"nonpayable","payable":false,"outputs":[],"name":"renounceOwnership","inputs":[],"constant":false},{"type":"function","stateMutability":"nonpayable","payable":false,"outputs":[],"name":"sealEpoch","inputs":[{"type":"uint256[]","name":"offlineTimes","internalType":"uint256[]"},{"type":"uint256[]","name":"offlineBlocks","internalType":"uint256[]"},{"type":"uint256[]","name":"uptimes","internalType":"uint256[]"},{"type":"uint256[]","name":"originatedTxsFee","internalType":"uint256[]"},{"type":"uint256","name":"usedGas","internalType":"uint256"}],"constant":false},{"type":"function","stateMutability":"nonpayable","payable":false,"outputs":[],"name":"sealEpochValidators","inputs":[{"type":"uint256[]","name":"nextValidatorIDs","internalType":"uint256[]"}],"constant":false},{"type":"function","stateMutability":"nonpayable","payable":false,"outputs":[],"name":"setGenesisDelegation","inputs":[{"type":"address","name":"delegator","internalType":"address"},{"type":"uint256","name":"toValidatorID","internalType":"uint256"},{"type":"uint256","name":"stake","internalType":"uint256"},{"type":"uint256","name":"lockedStake","internalType":"uint256"},{"type":"uint256","name":"lockupFromEpoch","internalType":"uint256"},{"type":"uint256","name":"lockupEndTime","internalType":"uint256"},{"type":"uint256","name":"lockupDuration","internalType":"uint256"},{"type":"uint256","name":"earlyUnlockPenalty","internalType":"uint256"},{"type":"uint256","name":"rewards","internalType":"uint256"}],"constant":false},{"type":"function","stateMutability":"nonpayable","payable":false,"outputs":[],"name":"setGenesisValidator","inputs":[{"type":"address","name":"_auth","internalType":"address"},{"type":"uint256","name":"validatorID","internalType":"uint256"},{"type":"bytes","name":"pubkey","internalType":"bytes"},{"type":"uint256","name":"status","internalType":"uint256"},{"type":"uint256","name":"createdEpoch","internalType":"uint256"},{"type":"uint256","name":"createdTime","internalType":"uint256"},{"type":"uint256","name":"deactivatedEpoch","internalType":"uint256"},{"type":"uint256","name":"deactivatedTime","internalType":"uint256"}],"constant":false},{"type":"function","stateMutability":"nonpayable","payable":false,"outputs":[],"name":"transferOwnership","inputs":[{"type":"address","name":"newOwner","internalType":"address"}],"constant":false},{"type":"function","stateMutability":"nonpayable","payable":false,"outputs":[],"name":"updateMinGasPrice","inputs":[{"type":"uint256","name":"minGasPrice","internalType":"uint256"}],"constant":false},{"type":"function","stateMutability":"nonpayable","payable":false,"outputs":[],"name":"updateNetworkRules","inputs":[{"type":"bytes","name":"diff","internalType":"bytes"}],"constant":false},{"type":"function","stateMutability":"nonpayable","payable":false,"outputs":[],"name":"updateNetworkVersion","inputs":[{"type":"uint256","name":"version","internalType":"uint256"}],"constant":false},{"type":"function","stateMutability":"nonpayable","payable":false,"outputs":[],"name":"updateValidatorPubkey","inputs":[{"type":"uint256","name":"validatorID","internalType":"uint256"},{"type":"bytes","name":"pubkey","internalType":"bytes"}],"constant":false},{"type":"function","stateMutability":"nonpayable","payable":false,"outputs":[],"name":"updateValidatorWeight","inputs":[{"type":"uint256","name":"validatorID","internalType":"uint256"},{"type":"uint256","name":"value","internalType":"uint256"}],"constant":false},{"type":"function","stateMutability":"nonpayable","payable":false,"outputs":[],"name":"upgradeCode","inputs":[{"type":"address","name":"acc","internalType":"address"},{"type":"address","name":"from","internalType":"address"}],"constant":false}]') + +ConstantsManager = w3.eth.contract( + abi=abi, bytecode=bytecode, address='0xD100ae0000000000000000000000000000000000') + + +owner = ConstantsManager.functions.owner().call() +print(owner) + +tx_hash = ConstantsManager.functions.updateNetworkVersion(1000001000004).transact({'from': acct1.address}) +tx_receipt = w3.eth.wait_for_transaction_receipt(tx_hash) +print(tx_receipt) From 0821d175bdb7cd9d07c7795372c64edcc21f3507 Mon Sep 17 00:00:00 2001 From: Nicholas Pettas Date: Mon, 29 Jan 2024 16:14:33 -0800 Subject: [PATCH 2/2] fix tx rate grafana chart --- .../grafana/var/lib/grafana/dashboards/home.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docker/networksimulator/grafana/var/lib/grafana/dashboards/home.json b/docker/networksimulator/grafana/var/lib/grafana/dashboards/home.json index c5d16afd8..fa8f5021e 100755 --- a/docker/networksimulator/grafana/var/lib/grafana/dashboards/home.json +++ b/docker/networksimulator/grafana/var/lib/grafana/dashboards/home.json @@ -2378,7 +2378,7 @@ } ] }, - "unit": "short", + "unit": "reqps", "unitScale": true }, "overrides": [] @@ -2410,14 +2410,14 @@ "uid": "${datasource}" }, "editorMode": "code", - "expr": "max(increase(chain_txs[$interval]))\n", + "expr": "max(rate(chain_txs[$interval]))\n", "instant": false, "legendFormat": "TXs", "range": true, "refId": "A" } ], - "title": "Transaction Receipt Count", + "title": "Transaction Recipt Rate", "type": "timeseries" }, {