Skip to content

Latest commit

 

History

History
352 lines (302 loc) · 30.9 KB

CHANGELOG.md

File metadata and controls

352 lines (302 loc) · 30.9 KB

Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

[Unreleased]

Nibiru EVM

  • #2119 - fix(evm): Guarantee that gas consumed during any send operation of the "NibiruBankKeeper" depends only on the "bankkeeper.BaseKeeper"'s gas consumption.
  • #2120 - fix: Use canonical hexadecimal strings for Eip155 address encoding
  • #2122 - test(evm): more bank extension tests and EVM ABCI integration tests to prevent regressions
  • #2124 - refactor(evm): Remove unnecessary argument in the VerifyFee function, which returns the token payment required based on the effective fee from the tx data. Improve documentation.
  • #2125 - feat(evm-precompile):Emit EVM events created to reflect the ABCI events that occur outside the EVM to make sure that block explorers and indexers can find indexed ABCI event information.
  • #2127 - fix(vesting): disabled built in auth/vesting module functionality
  • #2129 - fix(evm): issue with infinite recursion in erc20 funtoken contracts
  • #2130 - fix(evm): proper nonce management in statedb
  • #2132 - fix(evm): proper tx gas refund
  • #2134 - fix(evm): query of NIBI should use bank state, not the StateDB
  • #2139 - fix(evm): erc20 born funtoken: properly burn bank coins after converting coin back to erc20
  • #2140 - fix(bank): bank keeper extension now charges gas for the bank operations
  • #2141 - refactor: simplify account retrieval operation in nibid q evm account.
  • #2142 - fix(bank): add additional missing methods to the NibiruBankKeeper
  • #2144 - feat(token-registry): Implement strongly typed Nibiru Token Registry and generation command
  • #2145 - chore(token-registry): add xNIBI Astrovault LST to registry
  • #2147 - fix(simapp): manually add x/vesting Cosmos-SDK module types to the codec in simulation tests since they are expected by default
  • #2149 - feat(evm-oracle): add Solidity contract that we can use to expose the Nibiru Oracle in the ChainLink interface. Publish all precompiled contracts and ABIs on npm under the @nibiruchain/solidity package.
  • #2151 - feat(evm): randao support for evm
  • #2152 - fix(precompile): consume gas for precompile calls regardless of error
  • #2154 - fix(evm): JSON encoding for the EIP55Addr struct was not following the Go conventions and needed to include double quotes around the hexadecimal string.
  • #2156 - test(evm-e2e): add E2E test using the Nibiru Oracle's ChainLink impl
  • #2157 - fix(evm): Fix unit inconsistency related to AuthInfo.Fee and txData.Fee using effective fee
  • #2160 - fix(evm-precompile): use bank.MsgServer Send in precompile IFunToken.bankMsgSend
  • #2162 - test(testutil): try retrying for 'panic: pebbledb: closed'
  • #2167 - refactor(evm): removed blockGasUsed transient variable
  • #2168 - chore(evm-solidity): Move unrelated docs, gen-embeds, and add Solidity docs
  • #2165 - fix(evm): use Singleton StateDB pattern for EVM txs

Nibiru EVM | Before Audit 2 - 2024-12-06

The codebase went through a third-party Code4rena Zenith Audit, running from 2024-10-07 until 2024-11-01 and including both a primary review period and mitigation/remission period. This section describes code changes that occurred after that audit in preparation for a second audit starting in November 2024.

  • #2068 - feat: enable wasm light clients on IBC (08-wasm)
  • #2074 - fix(evm-keeper): better utilize ERC20 metadata during FunToken creation. The bank metadata for a new FunToken mapping ties a connection between the Bank Coin's DenomUnit and the ERC20 contract metadata like the name, decimals, and symbol. This change brings parity between EVM wallets, such as MetaMask, and Interchain wallets like Keplr and Leap.
  • #2076 - fix(evm-gas-fees): Use effective gas price in RefundGas and make sure that units are properly reflected on all occurrences of "base fee" in the codebase. This fixes #2059 and the related comments from @Unique-Divine and @berndartmueller.
  • #2084 - feat(evm-forge): foundry support and template for Nibiru EVM development
  • #2086 - fix(evm-precomples): Fix state consistency in precompile execution by ensuring proper journaling of state changes in the StateDB. This pull request makes sure that state is committed as expected, fixes the StateDB.Commit to follow its guidelines more closely, and solves for a critical state inconsistency producible from the FunToken.sol precompiled contract. It also aligns the precompiles to use consistent setup and dynamic gas calculations, addressing the following tickets.
  • #2088 - refactor(evm): remove outdated comment and improper error message text
  • #2089 - better handling of gas consumption within erc20 contract execution
  • #2090 - fix(evm): Account for (1) ERC20 transfers with tokens that return false success values instead of throwing an error and (2) ERC20 transfers with other operations that don't bring about the expected resulting balance for the transfer recipient.
  • #2091 - feat(evm): add fun token creation fee validation
  • #2093 - feat(evm): gas usage in precompiles: limits, local gas meters
  • #2092 - feat(evm): add validation for wasm multi message execution
  • #2094 - fix(evm): Following from the changs in #2086, this pull request implements a new JournalChange struct that saves a deep copy of the state multi store before each state-modifying, Nibiru-specific precompiled contract is called (OnRunStart). Additionally, we commit the StateDB there as well. This guarantees that the non-EVM and EVM state will be in sync even if there are complex, multi-step Ethereum transactions, such as in the case of an EthereumTx that influences the StateDB, then calls a precompile that also changes non-EVM state, and then EVM reverts inside of a try-catch.
  • #2095 - fix(evm): This change records NIBI (ether) transfers on the StateDB during precompiled contract calls using the NibiruBankKeeper, which is struct extension of the bankkeeper.BaseKeeper that is used throughout Nibiru. The NibiruBankKeeper holds a reference to the current EVM StateDB and records balance changes in wei as journal changes automatically. This guarantees that commits and reversions of the StateDB do not misalign with the state of the Bank module. This code change uses the NibiruBankKeeper on all modules that depend on x/bank, such as the EVM and Wasm modules.
  • #2097 - feat(evm): Add new query to get dated price from the oracle precompile
  • #2098 - test(evm): statedb tests for race conditions within funtoken precompile
  • #2100 - refactor: cleanup statedb and precompile sections
  • #2101 - fix(evm): tx receipt proper marshalling
  • #2105 - test(evm): precompile call with revert
  • #2106 - chore: scheduled basic e2e tests for evm testnet endpoint
  • #2107 - feat(evm-funtoken-precompile): Implement methods: balance, bankBalance, whoAmI
  • #2108 - fix(evm): removed deprecated root key from eth_getTransactionReceipt
  • #2110 - fix(evm): Restore StateDB to its state prior to ApplyEvmMsg call to ensure deterministic gas usage. This fixes an issue where the StateDB pointer field in NibiruBankKeeper was being updated during readonly query endpoints like eth_estimateGas, leading to non-deterministic gas usage in subsequent transactions.
  • #2111 - fix: e2e-evm-cron.yml
  • #2114 - fix(evm): make gas cost zero in conditional bank keeper flow
  • #2116 - fix(precompile-funtoken.go): Fixes a bug where the err != nil check is missing in the bankBalance precompile method
  • #2117 - fix(oracle): The timestamps resulting from ctx.WithBlock* don't actually correspond to the block header information from specified blocks in the chain's history, so the oracle exchange rates need a way to correctly retrieve this information. This change fixes that discrepancy, giving the expected block timestamp for the EVM's oracle precompiled contract. The change also simplifies and corrects the code in x/oracle.

Nibiru EVM | Before Audit 1 - 2024-10-18

  • #1837 - feat(eth): protos, eth types, and evm module types
  • #1838 - feat(eth): Go-ethereum, crypto, encoding, and unit tests for evm/types
  • #1841 - feat(eth): Collections encoders for bytes, Ethereum addresses, and Ethereum hashes
  • #1855 - feat(eth-pubsub): Implement in-memory EventBus for real-time topic management and event distribution
  • #1856 - feat(eth-rpc): Conversion types and functions between Ethereum txs and blocks and Tendermint ones.
  • #1861 - feat(eth-rpc): RPC backend, Ethereum tracer, KV indexer, and RPC APIs
  • #1869 - feat(eth): Module and start of keeper tests
  • #1871 - feat(evm): app config and json-rpc
  • #1873 - feat(evm): keeper collections and grpc query impls for EthAccount, NibiruAccount
  • #1883 - feat(evm): keeper logic, Ante handlers, EthCall, and EVM transactions.
  • #1887 - test(evm): eth api integration test suite
  • #1889 - feat: implemented basic evm tx methods
  • #1895 - refactor(geth): Reference go-ethereum as a submodule for easier change tracking with upstream
  • #1901 - test(evm): more e2e test contracts for edge cases
  • #1907 - test(evm): grpc_query full coverage
  • #1909 - chore(evm): set is_london true by default and removed from config
  • #1911 - chore(evm): simplified config by removing old eth forks
  • #1912 - test(evm): unit tests for evm_ante
  • #1914 - refactor(evm): Remove dead code and document non-EVM ante handler
  • #1917 - test(e2e-evm): TypeScript support. Type generation from compiled contracts. Formatter for TS code.
  • #1922 - feat(evm): tracer option is read from the config.
  • #1936 - feat(evm): EVM fungible token protobufs and encoding tests
  • #1947 - fix(evm): fix FunToken state marshalling
  • #1949 - feat(evm): add fungible token mapping queries
  • #1950 - feat(evm): Tx to create FunToken mapping from ERC20, contract embeds, and ERC20 queries.
  • #1956 - feat(evm): msg to send bank coin to erc20
  • #1958 - chore(evm): wiped deprecated evm apis: miner, personal
  • #1959 - feat(evm): Add precompile to the EVM that enables transfers of ERC20 tokens to "nibi" accounts as regular Ethereum transactions
  • #1960 - test(network): graceful cleanup for more consistent CI runs
  • #1961 - chore(test): reverted funtoken precompile test back to the isolated state
  • #1962 - chore(evm): code cleanup, unused code, typos, styles, warnings
  • #1963 - feat(evm): Deduct a fee during the creation of a FunToken mapping. Implemented by deductCreateFunTokenFee inside of the eth.evm.v1.MsgCreateFunToken transaction.
  • #1965 - refactor(evm): remove evm post-processing hooks
  • #1966 - refactor(evm): clean up AnteHandler setup
  • #1967 - feat(evm): export genesis
  • #1968 - refactor(evm): funtoken events, cli commands and queries
  • #1970 - refactor(evm): move evm antehandlers to separate package. Remove "gosdk/sequence_test.go", which causes a race condition in CI.
  • #1971 - feat(evm): typed events for contract creation, contract execution and transfer
  • #1973 - chore(appconst): Add chain IDs ending in "3" to the "knownEthChainIDMap". This makes it possible to use devnet 3 and testnet 3.
  • #1976 - refactor(evm): unique chain ids for all networks
  • #1977 - fix(localnet): rolled back change of evm validator address with cosmos derivation path
  • #1979 - refactor(db): use pebbledb as the default db in integration tests
  • #1981 - fix(evm): remove isCheckTx() short circuit on AnteDecVerifyEthAcc
  • #1982 - feat(evm): add GlobalMinGasPrices
  • #1983 - chore(evm): remove ExtensionOptionsWeb3Tx and ExtensionOptionDynamicFeeTx
  • #1984 - refactor(evm): embeds
  • #1985 - feat(evm)!: Use atto denomination for the wei units in the EVM so that NIBI is "ether" to clients. Only micronibi (unibi) amounts can be transferred. All clients follow the constraint equation, 1 ether == 1 NIBI == 10^6 unibi == 10^18 wei.
  • #1986 - feat(evm): Combine both account queries into "/eth.evm.v1.Query/EthAccount", accepting both nibi-prefixed Bech32 addresses and Ethereum-type hexadecimal addresses as input.
  • #1989 - refactor(evm): simplify evm module address
  • #1996 - perf(evm-keeper-precompile): implement sorted map for k.precompiles to remove dead code
  • #1997 - refactor(evm): Remove unnecessary params: "enable_call", "enable_create".
  • #2000 - refactor(evm): simplify ERC-20 keeper methods
  • #2001 - refactor(evm): simplify FunToken methods and tests
  • #2002 - feat(evm): Add the account query to the EVM command. Cover the CLI with tests.
  • #2003 - fix(evm): fix FunToken conversions between Cosmos and EVM
  • #2004 - refactor(evm)!: replace HexAddr with EIP55Addr
  • #2006 - test(evm): e2e tests for eth_* endpoints
  • #2008 - refactor(evm): clean up precompile setups
  • #2013 - chore(evm): Set appropriate gas value for the required gas of the "IFunToken.sol" precompile.
  • #2014 - feat(evm): Emit block bloom event in EndBlock hook.
  • #2017 - fix(evm): Fix DynamicFeeTx gas cap parameters
  • #2019 - chore(evm): enabled debug rpc api on localnet.
  • #2020 - test(evm): e2e tests for debug namespace
  • #2022 - feat(evm): debug_traceCall method implemented
  • #2023 - fix(evm)!: adjusted generation and parsing of the block bloom events
  • #2030 - refactor(eth/rpc): Delete unused code and improve logging in the eth and debug namespaces
  • #2031 - fix(evm): debug calls with custom tracer and tracer options
  • #2032 - feat(evm): ante handler to prohibit authz grant evm messages
  • #2039 - refactor(rpc-backend): remove unnecessary interface code
  • #2044 - feat(evm): evm tx indexer service implemented
  • #2045 - test(evm): backend tests with test network and real txs
  • #2053 - refactor(evm): converted untyped event to typed and cleaned up
  • #2054 - feat(evm-precompile): Precompile for one-way EVM calls to invoke/execute Wasm contracts.
  • #2060 - fix(evm-precompiles): add assertNumArgs validation
  • #2056 - feat(evm): add oracle precompile
  • #2065 - refactor(evm)!: Refactor out dead code from the evm.Params
  • #2135 - feat(evm): add precompile for calling bank to evm from evm

State Machine Breaking (Other)

For next mainnet version

  • #1766 - refactor(app-wasmext)!: remove wasmbinding CosmosMsg::Custom bindings.
  • #1776 - feat(inflation): make inflation params a collection and add commands to update them
  • #1872 - chore(math): use cosmossdk.io/math to replace sdk types
  • #1874 - chore(proto): remove the proto stringer as per Cosmos SDK migration guidelines
  • #1932 - fix(gosdk): fix keyring import functions

Dapp modules: perp, spot, oracle, etc

  • #1573 - feat(perp): Close markets and compute settlement price
  • #1632 - feat(perp): Add settle position transaction
  • #1656 - feat(perp): Make the collateral denom a stateful collections.Item
  • #1663 - feat(perp): Add volume based rebates
  • #1669 - feat(perp): add query to get collateral metadata
  • #1677 - fix(perp): make Gen_market set initial perp versions
  • #1680 - feat(perp): MsgShiftPegMultiplier, MsgShiftSwapInvariant.
  • #1683 - feat(perp): Add StartDnREpoch to AfterEpochEnd hook
  • #1686 - test(perp): add more tests for perp module msg server for DnR
  • #1687 - chore(wasmbinding): delete CustomQuerier since we have QueryRequest::Stargate now
  • #1705 - feat(perp): Add oracle pair to market object
  • #1718 - fix(perp): fees does not require additional funds
  • #1734 - feat(perp): MsgDonateToPerpFund sudo call as part of #1642
  • #1749 - feat(perp): move close market from Wasm Binding to MsgCloseMarket
  • #1752 - feat(oracle): MsgEditOracleParams sudo tx msg as part of #1642
  • #1755 - feat(oracle): Add more events on validator's performance
  • #1764 - fix(perp): make updateswapinvariant aware of total short supply to avoid panics
  • #1710 - refactor(perp): Clean and organize module errors for x/perp

Non-breaking/Compatible Improvements

  • #1893 - feat(gosdk): migrate Go-sdk into the Nibiru blockchain repo.
  • #1899 - build(deps): cometbft v0.37.5, cosmos-sdk v0.47.11, proto-builder v0.14.0
  • #1913 - fix(tests): race condition from heavy Network tests
  • #1992 - chore: enabled grpc for localnet
  • #1999 - chore: update nibi go package version to v2
  • #2050 - refactor(oracle): remove unused code and collapse empty client/cli directory

Dependencies

  • Bump github.com/grpc-ecosystem/grpc-gateway/v2 from 2.18.1 to 2.19.1 (#1767, #1782)
  • Bump robinraju/release-downloader from 1.8 to 1.11 (#1783, #1839, #1948)
  • Bump github.com/prometheus/client_golang from 1.17.0 to 1.18.0 (#1750)
  • Bump golang.org/x/crypto from 0.15.0 to 0.31.0 (#1724, #1843, #2123)
  • Bump github.com/holiman/uint256 from 1.2.3 to 1.2.4 (#1730)
  • Bump github.com/dvsekhvalnov/jose2go from 1.5.0 to 1.6.0 (#1733)
  • Bump github.com/spf13/cast from 1.5.1 to 1.6.0 (#1689)
  • Bump cosmossdk.io/math from 1.1.2 to 1.4.0 (#1676, #2115)
  • Bump github.com/grpc-ecosystem/grpc-gateway/v2 from 2.18.0 to 2.18.1 (#1675)
  • Bump actions/setup-go from 4 to 5 (#1696)
  • Bump golang from 1.19 to 1.21 (#1698)
  • #1678 - chore(deps): collections to v0.4.0 for math.Int value encoder
  • Bump golang.org/x/net from 0.0.0-20220607020251-c690dde0001d to 0.23.0 in /geth (#1849)
  • Bump golang.org/x/net from 0.20.0 to 0.23.0 (#1850)
  • Bump github.com/supranational/blst from 0.3.8-0.20220526154634-513d2456b344 to 0.3.11 (#1851)
  • Bump golangci/golangci-lint-action from 4 to 6 (#1854, #1867)
  • Bump github.com/hashicorp/go-getter from 1.7.1 to 1.7.5 (#1858, #1938)
  • Bump github.com/btcsuite/btcd from 0.23.3 to 0.24.2 (#1862, #2070)
  • Bump pozetroninc/github-action-get-latest-release from 0.7.0 to 0.8.0 (#1863)
  • Bump bufbuild/buf-setup-action from 1.30.1 to 1.47.2 (#1891, #1900, #1923, #1972, #1974, #1988, #2043, #2057, #2062, #2069, #2102, #2113)
  • Bump axios from 1.7.3 to 1.7.4 (#2016)
  • Bump github.com/CosmWasm/wasmvm from 1.5.0 to 1.5.5 (#2047)
  • Bump docker/build-push-action from 5 to 6 (#1924)
  • Bump codecov/codecov-action from 4 to 5 (#2112)

v1.5.0 - 2024-06-21

Nibiru v1.5.0 enables IBC CosmWasm smart contracts.

Features

  • #1931 - feat(ibc): add wasm route to IBC router

v1.4.0 - 2024-06-04

Nibiru v1.4.0 adds PebbleDB support and increases the wasm contract size limit to 3MB.

State Machine Breaking

  • #1906 - feat(wasm): increase contract size limit to 3MB

Features

  • #1818 - feat: add pebbledb support
  • #1908 - chore: make pebbledb the default db backend

v1.3.0 - 2024-05-07

Nibiru v1.3.0 adds interchain accounts.

Features

  • #1820 - feat: add interchain accounts

Bug Fixes

  • #1864 - fix(ica): add ICA controller stack

Improvements

  • #1859 - refactor(oracle): add oracle slashing events

LEGACY CHANGELOG