Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

release 1.0.1 #530

Merged
merged 22 commits into from
Oct 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
05e088f
Added missing observer call (metrics) in LedgerTransactionsProcessor
krzlabrdx Sep 28, 2023
445beb7
return validation error if from state version is beyond known ledger tip
PawelPawelec-RDX Sep 29, 2023
741fabd
Merge pull request #517 from radixdlt/return-validation-error-if-from…
krzlabrdx Sep 29, 2023
dfc987b
Merge pull request #513 from radixdlt/metrics-fix
krzlabrdx Sep 29, 2023
1cc9d63
Fixed invalid response model for HTTP 400 Bad Request responses on in…
krzlabrdx Oct 4, 2023
1fdf256
Merge pull request #518 from radixdlt/validation-model-fix
PawelPawelec-RDX Oct 4, 2023
64ae061
Update releases.yml (#470)
Oct 4, 2023
22818b9
add missing entry to changelog (Return 400 with validation error inst…
PawelPawelec-RDX Oct 4, 2023
8ea3678
Use lazy loading of Core API provider in CoreApiHandler to prevent ct…
krzlabrdx Oct 5, 2023
85ec9a4
Merge pull request #519 from radixdlt/lazy-coreapi-handler
krzlabrdx Oct 5, 2023
bb8f73c
add node name to transaction preview/submit metrics.
PawelPawelec-RDX Oct 5, 2023
fcfea49
exception handling reworked.
PawelPawelec-RDX Oct 5, 2023
b33020b
cleanup.
PawelPawelec-RDX Oct 5, 2023
b8e5104
fix pull request comments.
PawelPawelec-RDX Oct 5, 2023
9bdd85a
add warning when failed to parse transaction by toolkit.
PawelPawelec-RDX Oct 6, 2023
3e35d9c
Merge pull request #523 from radixdlt/log-warning-when-toolkit-throws…
PawelPawelec-RDX Oct 6, 2023
d08fc2e
Merge pull request #520 from radixdlt/rework-exception-handling
PawelPawelec-RDX Oct 6, 2023
4c09998
fix metrics label for transaction submission. Put n/a for internal fa…
PawelPawelec-RDX Oct 9, 2023
a0711de
Merge pull request #524 from radixdlt/fix-metrics-with-empty-node-if-…
PawelPawelec-RDX Oct 9, 2023
e9634fa
CVE 2023 4911 for development branch (#527)
Oct 9, 2023
89d9179
CVE-2023-4911 (#526)
Oct 9, 2023
59075d7
Merge branch 'main' into develop
Oct 9, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions .github/workflows/releases.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ env:
jobs:
build:
runs-on: ubuntu-22.04
environment: release
steps:
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9
- name: Setup .NET SDK
Expand Down Expand Up @@ -78,7 +77,6 @@ jobs:
context: "."
dockerfile: "./apps/DatabaseMigrations/Dockerfile"
platforms: "linux/amd64"
environment: release
cache_tag_suffix: "release"
enable_dockerhub: "true"
restore_artifact: "true"
Expand Down Expand Up @@ -127,7 +125,6 @@ jobs:
context: "."
dockerfile: "./apps/DataAggregator/Dockerfile"
platforms: "linux/amd64"
environment: release
cache_tag_suffix: "release"
enable_dockerhub: "true"
restore_artifact: "true"
Expand Down Expand Up @@ -176,7 +173,6 @@ jobs:
context: "."
dockerfile: "./apps/GatewayApi/Dockerfile"
platforms: "linux/amd64"
environment: release
cache_tag_suffix: "release"
enable_dockerhub: "true"
restore_artifact: "true"
Expand Down
10 changes: 7 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
## 1.0.0 - Babylon Launch
## 1.0.1 - Babylon
Release Date: _unreleased_

### Breaking changes
_None_
- Fixed missing `RecordTopOfDbLedger` observer call in `LedgerTransactionsProcessor`.
- Fixed invalid response model for HTTP 400 Bad Request responses on input parameter validation failure.
- Return 400 with validation error instead of 500 if `from_ledger_state` `state_version` is beyond known ledger tip.

## 1.0.0 - Babylon Launch
Release Date: 28.09.2023

### What’s new?
- log warning if sql query takes longer than configured threshold (default to 250ms) for both entity framework and dapper queries.
Expand Down
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
</PropertyGroup>

<PropertyGroup>
<VersionPrefix>1.0.0</VersionPrefix>
<VersionPrefix>1.0.1</VersionPrefix>
<VersionSuffix>develop</VersionSuffix>
</PropertyGroup>

Expand Down
9 changes: 9 additions & 0 deletions apps/DataAggregator/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@
FROM mcr.microsoft.com/dotnet/aspnet:7.0-bookworm-slim AS base
WORKDIR /app

# Fixes CVE-2023-4911 can be removed when we update the base OS image to include this fix
# docker run -it mcr.microsoft.com/dotnet/aspnet:7.0-bookworm-slim ldd --version
# This fix can be removed as long as the version printed in the above command is 2.36-9+deb12u3 or above
RUN apt-get update -y \
&& apt-get -y --no-install-recommends install \
libc6=2.36-9+deb12u3 \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

FROM mcr.microsoft.com/dotnet/sdk:7.0-bookworm-slim AS build
WORKDIR /src
COPY . .
Expand Down
9 changes: 9 additions & 0 deletions apps/DatabaseMigrations/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@
FROM mcr.microsoft.com/dotnet/aspnet:7.0-bookworm-slim AS base
WORKDIR /app

# Fixes CVE-2023-4911 can be removed when we update the base OS image to include this fix
# docker run -it mcr.microsoft.com/dotnet/aspnet:7.0-bookworm-slim ldd --version
# This fix can be removed as long as the version printed in the above command is 2.36-9+deb12u3 or above
RUN apt-get update -y \
&& apt-get -y --no-install-recommends install \
libc6=2.36-9+deb12u3 \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

FROM mcr.microsoft.com/dotnet/sdk:7.0-bookworm-slim AS build
WORKDIR /src
COPY . .
Expand Down
3 changes: 0 additions & 3 deletions apps/GatewayApi/Controllers/StateEntityController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@
*/

using Microsoft.AspNetCore.Mvc;
using RadixDlt.NetworkGateway.GatewayApi.AspNetCore;
using RadixDlt.NetworkGateway.GatewayApi.Handlers;
using System.Threading;
using System.Threading.Tasks;
Expand All @@ -73,8 +72,6 @@ namespace GatewayApi.Controllers;

[ApiController]
[Route("state/entity")]
[ServiceFilter(typeof(ExceptionFilter))]
[ServiceFilter(typeof(InvalidModelStateFilter))]
public class StateController : ControllerBase
{
private readonly IEntityHandler _entityHandler;
Expand Down
3 changes: 0 additions & 3 deletions apps/GatewayApi/Controllers/StateKeyValueStoreController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@
*/

using Microsoft.AspNetCore.Mvc;
using RadixDlt.NetworkGateway.GatewayApi.AspNetCore;
using RadixDlt.NetworkGateway.GatewayApi.Handlers;
using System.Threading;
using System.Threading.Tasks;
Expand All @@ -73,8 +72,6 @@ namespace GatewayApi.Controllers;

[ApiController]
[Route("state/key-value-store")]
[ServiceFilter(typeof(ExceptionFilter))]
[ServiceFilter(typeof(InvalidModelStateFilter))]
public class StateKeyValueStoreController : ControllerBase
{
private readonly IKeyValueStoreHandler _keyValueStoreHandler;
Expand Down
3 changes: 0 additions & 3 deletions apps/GatewayApi/Controllers/StateNonFungibleController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@
*/

using Microsoft.AspNetCore.Mvc;
using RadixDlt.NetworkGateway.GatewayApi.AspNetCore;
using RadixDlt.NetworkGateway.GatewayApi.Handlers;
using System.Threading;
using System.Threading.Tasks;
Expand All @@ -73,8 +72,6 @@ namespace GatewayApi.Controllers;

[ApiController]
[Route("state/non-fungible")]
[ServiceFilter(typeof(ExceptionFilter))]
[ServiceFilter(typeof(InvalidModelStateFilter))]
public class StateNonFungibleController : ControllerBase
{
private readonly INonFungibleHandler _nonFungibleHandler;
Expand Down
3 changes: 0 additions & 3 deletions apps/GatewayApi/Controllers/StatisticsController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@
*/

using Microsoft.AspNetCore.Mvc;
using RadixDlt.NetworkGateway.GatewayApi.AspNetCore;
using RadixDlt.NetworkGateway.GatewayApi.Handlers;
using System.Threading;
using System.Threading.Tasks;
Expand All @@ -73,8 +72,6 @@ namespace GatewayApi.Controllers;

[ApiController]
[Route("statistics")]
[ServiceFilter(typeof(ExceptionFilter))]
[ServiceFilter(typeof(InvalidModelStateFilter))]
public class StatisticsController : ControllerBase
{
private readonly IValidatorHandler _validatorHandler;
Expand Down
3 changes: 0 additions & 3 deletions apps/GatewayApi/Controllers/StatusController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@
*/

using Microsoft.AspNetCore.Mvc;
using RadixDlt.NetworkGateway.GatewayApi.AspNetCore;
using RadixDlt.NetworkGateway.GatewayApi.Handlers;
using RadixDlt.NetworkGateway.GatewayApi.Services;
using System.Threading;
Expand All @@ -74,8 +73,6 @@ namespace GatewayApi.Controllers;

[ApiController]
[Route("status")]
[ServiceFilter(typeof(ExceptionFilter))]
[ServiceFilter(typeof(InvalidModelStateFilter))]
public sealed class StatusController : ControllerBase
{
private readonly IStatusHandler _statusHandler;
Expand Down
3 changes: 0 additions & 3 deletions apps/GatewayApi/Controllers/StreamController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@
*/

using Microsoft.AspNetCore.Mvc;
using RadixDlt.NetworkGateway.GatewayApi.AspNetCore;
using RadixDlt.NetworkGateway.GatewayApi.Handlers;
using System.Threading;
using System.Threading.Tasks;
Expand All @@ -73,8 +72,6 @@ namespace GatewayApi.Controllers;

[ApiController]
[Route("stream")]
[ServiceFilter(typeof(ExceptionFilter))]
[ServiceFilter(typeof(InvalidModelStateFilter))]
public sealed class StreamController : ControllerBase
{
private readonly ITransactionHandler _transactionHandler;
Expand Down
3 changes: 0 additions & 3 deletions apps/GatewayApi/Controllers/TransactionController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@
*/

using Microsoft.AspNetCore.Mvc;
using RadixDlt.NetworkGateway.GatewayApi.AspNetCore;
using RadixDlt.NetworkGateway.GatewayApi.Handlers;
using System.Threading;
using System.Threading.Tasks;
Expand All @@ -73,8 +72,6 @@ namespace GatewayApi.Controllers;

[ApiController]
[Route("transaction")]
[ServiceFilter(typeof(ExceptionFilter))]
[ServiceFilter(typeof(InvalidModelStateFilter))]
public sealed class TransactionController : ControllerBase
{
private readonly ITransactionHandler _transactionHandler;
Expand Down
3 changes: 0 additions & 3 deletions apps/GatewayApi/Controllers/ValidatorStateController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@
*/

using Microsoft.AspNetCore.Mvc;
using RadixDlt.NetworkGateway.GatewayApi.AspNetCore;
using RadixDlt.NetworkGateway.GatewayApi.Handlers;
using System.Threading;
using System.Threading.Tasks;
Expand All @@ -73,8 +72,6 @@ namespace GatewayApi.Controllers;

[ApiController]
[Route("state/validators")]
[ServiceFilter(typeof(ExceptionFilter))]
[ServiceFilter(typeof(InvalidModelStateFilter))]
public class ValidatorController : ControllerBase
{
private readonly IValidatorStateHandler _validatorStateHandler;
Expand Down
9 changes: 9 additions & 0 deletions apps/GatewayApi/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@
FROM mcr.microsoft.com/dotnet/aspnet:7.0-bookworm-slim AS base
WORKDIR /app

# Fixes CVE-2023-4911 can be removed when we update the base OS image to include this fix
# docker run -it mcr.microsoft.com/dotnet/aspnet:7.0-bookworm-slim ldd --version
# This fix can be removed as long as the version printed in the above command is 2.36-9+deb12u3 or above
RUN apt-get update -y \
&& apt-get -y --no-install-recommends install \
libc6=2.36-9+deb12u3 \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

FROM mcr.microsoft.com/dotnet/sdk:7.0-bookworm-slim AS build
WORKDIR /src
COPY . .
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,28 +62,14 @@
* permissions under this License.
*/

using Microsoft.AspNetCore.Mvc.Filters;
using Microsoft.Extensions.DependencyInjection;
using RadixDlt.NetworkGateway.GatewayApi.Services;
using Microsoft.AspNetCore.Builder;

namespace RadixDlt.NetworkGateway.GatewayApi.AspNetCore;
namespace GatewayApi.ExceptionHandlingMiddleware;

public sealed class InvalidModelStateFilter : IActionFilter, IOrderedFilter
public static class ApplicationBuilderExtension
{
public int Order => -3000;

public void OnActionExecuting(ActionExecutingContext context)
{
if (context.Result == null && !context.ModelState.IsValid)
{
var validationErrorHandler = context.HttpContext.RequestServices.GetRequiredService<IValidationErrorHandler>();

context.Result = validationErrorHandler.GetClientError(context);
}
}

public void OnActionExecuted(ActionExecutedContext context)
public static IApplicationBuilder UseGatewayExceptionHandler(this IApplicationBuilder app)
{
// no-op
return app.UseMiddleware<ExceptionHandlingMiddleware>();
}
}
Loading
Loading