Skip to content

Commit

Permalink
Merge branch 'main' into will/upgrade-geth
Browse files Browse the repository at this point in the history
  • Loading branch information
badgersrus authored Jul 10, 2024
2 parents 9da3d92 + 6a4bc5b commit 41da44a
Show file tree
Hide file tree
Showing 109 changed files with 3,210 additions and 1,048 deletions.
37 changes: 37 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,43 @@
---
# Ten Testnet Change Log

# July 2024-07-03 (v0.25.0)
* This is an L2 deployment release meaning state will be lost in order to upgrade the network. Any dApps on the
network will need to be redeployed. The release predominantly addresses performance improvements for large numbers
of transactions in the network, and for event log queries.
* A full list of the PRs merged in this release is as below;
* `ef0bf45e` Fix for xchain messages (#1973)
* `0dc7d5c5` Fix for integration test (#1971)
* `186bc2c3` Host db performance fixes (#1969)
* `c0ea9b43` Bundle submission rework (#1966)
* `0b01bfd1` Assets fix and clear console warnings (#1959)
* `ddff74a5` Update db schema (#1967)
* `e1c91243` Rework event logs and transaction database schema (#1961)
* `291a698d` Add db query tool (#1963)
* `b1af061b` Initiate bridge deployment (#1965)
* `95f35150` Initiate bridge deployment (#1960)
* `447ff489` Placeholder commit for new gh action workflow (#1964)
* `9d6e7747` Fix for startup (#1962)
* `b537d2e6` Add indexed events (#1954)
* `c6e5a48f` Adds log constraints to docker containers not instantiated by the go client (#1956)
* `85e6cd0d` Ignore empty l1 head status from enclave (#1955)
* `a9485fef` Fixes for ethereum bridge and json representation of batch header (#1953)
* `e6453082` Deploy separate ten gateway for dexynth (#1949)
* `b8935c31` Network tests: util func for l1 transfers (#1948)
* `0f3d42bf` Network tests: start gateway synchronously to fix race (#1947)
* `9cee2fd4` Increase max message size grpc config (#1946)
* `c0bf4086` Small mem pool fixes (#1943)
* `b335bd1e` Avoid spamming stuck l1 transactions (#1941)
* `99a8aeee` Fix panic on uninitialised mem pool (#1940)
* `1daffac0` Replace health-check db query (#1938)
* `a880b169` Hardcode response to client version request (#1937)
* `5780140e` Check conversions (#1936)
* `b97d0b93` Fix flakyness errors (#1927)
* `6e432a1a` Add net_version support and test (#1934)
* `4f39832e` Fixing log spam (#1931)
* `f8b86b52` Fix log spam (#1929)
* `762dfef9` Fix for interval (#1926)

# May 2024-05-20 (v0.24.0)
* This is an L2 deployment release meaning state will be lost in order to upgrade the network. Any dApps on the
network will need to be redeployed. High level changes made in the release include;
Expand Down
66 changes: 64 additions & 2 deletions contracts/generated/ManagementContract/ManagementContract.go

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion contracts/src/bridge/frontend/src/lib/constants.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export const socialLinks = {
github: "https://github.com/ten-protocol",
discord: "https://discord.gg/QJZ39Den7d",
discord: "https://discord.gg/tenprotocol",
twitter: "https://twitter.com/tenprotocol",
twitterHandle: "@tenprotocol",
};
Expand Down
20 changes: 18 additions & 2 deletions contracts/src/management/ManagementContract.sol
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ contract ManagementContract is Initializable, OwnableUpgradeable {
MessageBus.IMessageBus public messageBus;
MerkleTreeMessageBus.IMerkleTreeMessageBus public merkleMessageBus;
mapping(bytes32 =>bool) public isWithdrawalSpent;
mapping(bytes32 =>bool) public isBundleSaved;

bytes32 public lastBatchHash;

Expand Down Expand Up @@ -102,14 +103,24 @@ contract ManagementContract is Initializable, OwnableUpgradeable {
}
}

function isBundleAvailable(bytes[] memory crossChainHashes) public view returns (bool) {
bytes32 bundleHash = bytes32(0);

for(uint256 i = 0; i < crossChainHashes.length; i++) {
bundleHash = keccak256(abi.encode(bundleHash, bytes32(crossChainHashes[i])));
}

return isBundleSaved[bundleHash];
}

function addCrossChainMessagesRoot(bytes32 _lastBatchHash, bytes32 blockHash, uint256 blockNum, bytes[] memory crossChainHashes, bytes calldata signature, uint256 rollupNumber, bytes32 forkID) external {
if (block.number > blockNum + 255) {
/* if (block.number > blockNum + 255) {
revert("Block binding too old");
}
if ((blockhash(blockNum) != blockHash)) {
revert(string(abi.encodePacked("Invalid block binding:", Strings.toString(block.number),":", Strings.toString(uint256(blockHash)), ":", Strings.toString(uint256(blockhash(blockNum))))));
}
} */

if (rollups.toUniqueForkID[rollupNumber] != forkID) {
revert("Invalid forkID");
Expand All @@ -120,9 +131,14 @@ contract ManagementContract is Initializable, OwnableUpgradeable {

lastBatchHash = _lastBatchHash;

bytes32 bundleHash = bytes32(0);

for(uint256 i = 0; i < crossChainHashes.length; i++) {
merkleMessageBus.addStateRoot(bytes32(crossChainHashes[i]), block.timestamp); //todo: change the activation time.
bundleHash = keccak256(abi.encode(bundleHash, bytes32(crossChainHashes[i])));
}

isBundleSaved[bundleHash] = true;
}

// TODO: ensure challenge period is added on top of block timestamp.
Expand Down
4 changes: 2 additions & 2 deletions dockerfiles/enclave.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# Defaults to restricted flag mode
ARG TESTMODE=false

FROM ghcr.io/edgelesssys/ego-dev:v1.5.0 AS build-base
FROM ghcr.io/edgelesssys/ego-dev:v1.5.3 AS build-base

# setup container data structure
RUN mkdir -p /home/obscuro/go-obscuro
Expand Down Expand Up @@ -48,7 +48,7 @@ RUN ego sign enclave-test.json
FROM build-enclave-testmode-${TESTMODE} as build-enclave

# Trigger a new build stage and use the smaller ego version:
FROM ghcr.io/edgelesssys/ego-deploy:v1.5.0
FROM ghcr.io/edgelesssys/ego-deploy:v1.5.3

# Copy just the binary for the enclave into this build stage
COPY --from=build-enclave \
Expand Down
33 changes: 16 additions & 17 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
module github.com/ten-protocol/go-ten

go 1.21
go 1.21.11

replace github.com/docker/docker => github.com/docker/docker v20.10.3-0.20220224222438-c78f6963a1c0+incompatible

require (
github.com/FantasyJony/openzeppelin-merkle-tree-go v1.1.2
github.com/Microsoft/go-winio v0.6.1
github.com/Microsoft/go-winio v0.6.2
github.com/andybalholm/brotli v1.1.0
github.com/codeclysm/extract/v3 v3.1.1
github.com/deckarep/golang-set/v2 v2.6.0
github.com/dgraph-io/ristretto v0.1.1
github.com/docker/docker v25.0.4+incompatible
github.com/docker/go-connections v0.5.0
github.com/edgelesssys/ego v1.5.0
github.com/edgelesssys/ego v1.5.3
github.com/eko/gocache/lib/v4 v4.1.5
github.com/eko/gocache/store/ristretto/v4 v4.2.1
github.com/ethereum/go-ethereum v1.14.0
github.com/ethereum/go-ethereum v1.14.6
github.com/fjl/memsize v0.0.2
github.com/gin-contrib/cors v1.7.0
github.com/gin-gonic/gin v1.9.1
github.com/go-kit/kit v0.13.0
github.com/go-sql-driver/mysql v1.8.0
github.com/go-sql-driver/mysql v1.8.1
github.com/gofrs/flock v0.8.1
github.com/golang-jwt/jwt v3.2.2+incompatible
github.com/golang-jwt/jwt/v4 v4.5.0
Expand All @@ -45,7 +45,7 @@ require (
github.com/urfave/cli/v2 v2.27.1
github.com/valyala/fasthttp v1.52.0
gitlab.com/NebulousLabs/fastrand v0.0.0-20181126182046-603482d69e40
golang.org/x/crypto v0.22.0
golang.org/x/crypto v0.24.0
golang.org/x/exp v0.0.0-20240318143956-a85f2c67cd81
golang.org/x/sync v0.7.0
google.golang.org/grpc v1.62.1
Expand All @@ -64,19 +64,20 @@ require (
github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect
github.com/btcsuite/btcd/chaincfg/chainhash v1.1.0 // indirect
github.com/bytedance/sonic v1.11.3 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/chenzhuoyu/base64x v0.0.0-20230717121745-296ad89f973d // indirect
github.com/chenzhuoyu/iasm v0.9.1 // indirect
github.com/cockroachdb/errors v1.11.1 // indirect
github.com/cockroachdb/errors v1.11.3 // indirect
github.com/cockroachdb/fifo v0.0.0-20240606204812-0bbfbd93a7ce // indirect
github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect
github.com/cockroachdb/pebble v1.1.0 // indirect
github.com/cockroachdb/pebble v1.1.1 // indirect
github.com/cockroachdb/redact v1.1.5 // indirect
github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect
github.com/consensys/bavard v0.1.13 // indirect
github.com/consensys/gnark-crypto v0.12.1 // indirect
github.com/containerd/containerd v1.7.14 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.4 // indirect
github.com/crate-crypto/go-ipa v0.0.0-20231025140028-3c0104f4b233 // indirect
github.com/crate-crypto/go-ipa v0.0.0-20240223125850-b1e8a79f509c // indirect
github.com/crate-crypto/go-kzg-4844 v1.0.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect
Expand All @@ -85,12 +86,13 @@ require (
github.com/docker/go-units v0.5.0 // indirect
github.com/dustin/go-humanize v1.0.1 // indirect
github.com/ethereum/c-kzg-4844 v1.0.0 // indirect
github.com/ethereum/go-verkle v0.1.1-0.20240306133620-7d920df305f0 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
github.com/gabriel-vasile/mimetype v1.4.3 // indirect
github.com/gballet/go-libpcsclite v0.0.0-20191108122812-4678299bea08 // indirect
github.com/gballet/go-verkle v0.1.1-0.20231031103413-a67434b50f46 // indirect
github.com/getsentry/sentry-go v0.27.0 // indirect
github.com/gin-contrib/sse v0.1.0 // indirect
github.com/go-jose/go-jose/v4 v4.0.2 // indirect
github.com/go-kit/log v0.2.1 // indirect
github.com/go-logfmt/logfmt v0.6.0 // indirect
github.com/go-ole/go-ole v1.3.0 // indirect
Expand Down Expand Up @@ -155,14 +157,11 @@ require (
github.com/xrash/smetrics v0.0.0-20240312152122-5f08fbb34913 // indirect
github.com/yusufpapurcu/wmi v1.2.4 // indirect
golang.org/x/arch v0.7.0 // indirect
golang.org/x/mod v0.17.0 // indirect
golang.org/x/net v0.24.0 // indirect
golang.org/x/sys v0.19.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/tools v0.20.0 // indirect
golang.org/x/net v0.25.0 // indirect
golang.org/x/sys v0.21.0 // indirect
golang.org/x/text v0.16.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240318140521-94a12d6c2237 // indirect
gopkg.in/mgo.v2 v2.0.0-20190816093944-a6b53ec6cb22 // indirect
gopkg.in/square/go-jose.v2 v2.6.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
gotest.tools/v3 v3.5.1 // indirect
rsc.io/tmplfunc v0.0.3 // indirect
Expand Down
Loading

0 comments on commit 41da44a

Please sign in to comment.